27.06.2012, 06:44
So i have here a go command... But after compiling i have this error error 017: undefined symbol "id" i highlight it to make clear.
EDIT: If player disbled his /goff command. if someone try to go to him it will say
GameTextForPlayer(playerid,"Playername Go is disabled",2000,3);
PHP код:
CMD:go(playerid, params[])
{
new ID;//creates a new something idk what we call it :P but it is defined later on or used in something this 1 is used in next line
if(sscanf(params, "u", ID)) SendClientMessage(playerid, 0xFF0000FF, "USAGE: /goto [id]");//checks if you have written something after /goto if no it sends error
else if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid, 0xFF0000FF, "This player is offline or it is yourself"); <--------------This is the error line.
else//ELSE what will happen if no errors
{
new Float:x, Float:y, Float:z;//creates new floats
GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height
}
return 1;
}
GameTextForPlayer(playerid,"Playername Go is disabled",2000,3);