define playerid HELP PLEASE
#1

Hi im really stumped. For a certain reason i need to use the word "playerid" in the section Public OnGameModeInit
cause i am using the function
GetPlayerWorld(playerid)
But the problem is playerid wont work in OnGameModeInit, for some reason it needs to be defined.
So i tried fixing it by at the top of the script under main() i placed
PlayerWorld = GetPlayerVirtualWorld(playerid);
new playerid;
playerid =
but i dont know what the function would be to go after playerid =
so im really screw up here. why is that some areas understand what playerid means and others dont?
PLEASE HELP
Reply
#2

OnGameMode init will be called before any players are on so why would you need GetPlayerWorld(playerid) there?
Reply
#3

well actually sorry not actually there i thought that would have fixed it. Its meant to go in a pulblic call back i made not the ones it already comes with. and i thought maybe putting it in gamemode init will save me from putting it in each callback that requires it
Reply
#4

Quote:
Originally Posted by bluray
why is that some areas understand what playerid means and others dont?
Look at the public callback line.

For example:

public OnGameModeInit() - has no parameters.

public OnPlayerConnect(playerid) - has playerid defined.

public OnPlayerDeath(playerid, killerid, reason) - has playerid, killerid and reason defined.

You can use the parameters defined in the callback.





Reply
#5

Quote:
Originally Posted by MadeMan
Quote:
Originally Posted by bluray
why is that some areas understand what playerid means and others dont?
Look at the public callback line.

For example:

public OnGameModeInit() - has no parameters.

public OnPlayerConnect(playerid) - has playerid defined.

public OnPlayerDeath(playerid, killerid, reason) - has playerid, killerid and reason defined.

You can use the parameters defined in the callback.





so can i just add player id in the brackets
Reply
#6

Quote:
Originally Posted by bluray
so can i just add player id in the brackets
No, you can only use those that are already there.
Reply
#7

what about for your own created callbacks
Reply
#8

If you make your own functions, then yes you can.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)