"Player Id" and "Player whichPlayer"

Dois

New Member
Reaction score
1
This is confusing me...

JASS:


that gives an error in JassCraft... but

this works
JASS:
CreateUnitAtLoc(GetOwningPlayer(GetTriggerUnit()), 'h000', L, 0.0 )


The thing is JassCraft says
JASS:
CreateUnitAtLoc         takes player id, integer unitid, location whichLocation, real face returns unit


that it takes player id...

so is Player Id and Player whichPlayer the same? I mean yeah they're both "player" but then whats "GetPlayerId" for? "Player Id" isn't an integer?
 

darkbeer

Beer is Good!
Reaction score
84
as it says it takes of variable of TYPE player and its called id, that has nothing to do with the id of thy player.

yea, but theres not such thing which takes integer i think, everything that creates a unit uses player.
 

0zaru

Learning vJASS ;)
Reaction score
60
For example
JASS:
function Asd takes integer playerid returns nothing //you can name playerid with another name but you must replace it Inside the function
call DisplayTextToPlayer(Player(playerid),0,0,"This id is the player " + I2S(playerid+1))
endfunction


If you put a 0 in there will display a text for the player red (Usually the player 1..) Displaying this id is the player 1.

But if It takes a player then you have to use the player directly Not the Player(playerid) and use GetPlayerId(player) inside the I2S.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top