[HELP] Goto Command
#1

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.

PHP код:
CMD:go(playeridparams[])
{
    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(playerid0xFF0000FF"USAGE: /goto [id]");//checks if you have written something after /goto if no it sends error
    
else if(!IsPlayerConnected(id) || id == playerid) return SendClientMessage(playerid0xFF0000FF"This player is offline or it is yourself"); <--------------This is the error line.
    else
//ELSE what will happen if no errors
    
{
    new 
Float:xFloat:yFloat:z;//creates new floats
    
GetPlayerPos(IDxyz);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
    
SetPlayerPos(playeridx+1y+1z);//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;

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);
Reply


Messages In This Thread
[HELP] Goto Command - by kbalor - 27.06.2012, 06:44
Re: [HELP] Goto Command - by [A]ndrei - 27.06.2012, 06:46
Re: [HELP] Goto Command - by kbalor - 27.06.2012, 06:47
Re: [HELP] Goto Command - by Kindred - 27.06.2012, 06:50
Re: [HELP] Goto Command - by kbalor - 27.06.2012, 06:58
Re: [HELP] Goto Command - by Kindred - 27.06.2012, 07:06
Re: [HELP] Goto Command - by kbalor - 27.06.2012, 07:18
Re: [HELP] Goto Command - by Kindred - 27.06.2012, 07:23
Re: [HELP] Goto Command - by kbalor - 27.06.2012, 07:31
Re: [HELP] Goto Command - by Skaizo - 27.06.2012, 08:20

Forum Jump:


Users browsing this thread: 1 Guest(s)