15.02.2011, 09:57
You can use sscanf and you won't have problems like this.
Edit: I made it quickly and in text document(I'm in school) so I'm not sure if this is gonna work.
WITH SSCANF!
Edit: I made it quickly and in text document(I'm in school) so I'm not sure if this is gonna work.
WITH SSCANF!
pawn Код:
dcmd_goto(playerid,params[])
{
new playerid2, string[128];
if(!sscanf(params, "u", playerid2))
{
if(IsPlayerConnected(playerid2))
{
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);
}
else return SendClientMessage(playerid,red,"ERROR: Player is not connected!");
}
else return SendClientMessage(playerid,red,"USAGE: /goto [ID]");
return 1;
}