05.08.2011, 05:04
pawn Код:
#include <a_samp>
new tmp[256];
new OtherID = strval(tmp);
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/tp", cmdtext, true, 6) == 0)
{
new tmp[256];
new OtherID = strval(tmp);
}
if(!strlen(tmp)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /tp [id]");
if(!IsPlayerConnected(OtherID) || IsPlayerNPC(OtherID)) return SendClientMessage(playerid,0xFF0000FF,"The player is not online!");
new Float:X, Float:Y, Float:Z;
}
GetPlayerPos(OtherID, X, Y, Z);
}
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(GetPlayerVehicleID(playerid), X+5, Y+5, Z);
}
else
{
SetPlayerPos(playerid, X+5, Y+5, Z);
}
SendClientMessage(playerid, 0xFF0000FF, "You've been teleported to the requested player!");
return 1;
}
return 0;
}