15.02.2011, 09:53
Hello. I need some help with command again. Looks like ok (no errors or warnings). When I typed /goto 0, it was ok. /goto libra (my name) worked too. But when I type /goto wbueqngiuwrhbg, it teleports me to ID 0. Could anyone solve this? (Don't tell to use sscanf )
Код:
dcmd_goto(playerid,params[]) { new playerid2; new tmp[128], Index, string[128]; tmp = strtok(params,Index), playerid2 = strval(tmp); if(!strlen(params)) return SendClientMessage(playerid,red,"USAGE: /goto [ID]"); if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,red,"ERROR: Player is not connected!"); new Float:x,Float:y,Float:z; GetPlayerPos(playerid2, x, y, z); SetPlayerPos(playerid, x+2, y, z); format(string,sizeof(string),"You have teleported to %s's location!",GetName(playerid2)); SendClientMessage(playerid,blue,string); format(string,sizeof(string),"Player %s has teleported to you!",GetName(playerid)); SendClientMessage(playerid,blue,string); return 1; }