06.04.2014, 16:54
Hello, here is my /goto command :
But this dont work well.. sometimes it work for me,sometimes it just send me "[SERVER]:You cant teleport to yourself!" .. so i guess something isnt well with :
I tested this ten times with my friend, he sometimes can goto me,but also sometimes he just get that Error msg..
Any ideas how to fix this ?
pawn Код:
CMD:goto(playerid,params[])
{
new id,Float:x,Float:y,Float:z,name[MAX_PLAYER_NAME],msg[128];
if(PlayerInfo[playerid][pAdmin] == 5) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:You must be and Admin level 6 or higher to use this command!");
else if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:You must be and Admin to use this command!");
else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:Player is not connected anymore!");
else if(id == playerid) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:You cant teleport to yourself!");
else if(sscanf(params,"u",id)) return SendClientMessage(playerid,COLOR_RED,"[SERVER]:Usage:/goto [name/id]");
else
{
GetPlayerPos(id,x,y,z);
SetPlayerPos(playerid,x+1,y+1,z);
GetPlayerName(id,name,sizeof(name));
format(msg,sizeof(msg),"[SERVER]:You've been teleported to %s(%d)!",name,id);
SendClientMessage(playerid,COLOR_GREEN,msg);
}
return 1;
}
pawn Код:
else if(id == playerid)
Any ideas how to fix this ?