PHP код:
CMD:goto(playerid, params[])
{
new ID;
if(sscanf(params, "u", ID)) SendClientMessage(playerid, -1, "USAGE: /goto [playerid]");
else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, -1, "Player is not connected!");
else
{
new Float:X, Float:Y, Float:Z, Float:Angle;
if(IsPlayerInAnyVehicle(ID))GetVehiclePos(GetPlayerVehicleID(ID), X, Y, Z), GetVehicleZAngle(GetPlayerVehicleID(ID), Angle);
else GetPlayerPos(ID, X, Y, Z), GetPlayerFacingAngle(playerid, Angle);
if(IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), X+1.0, Y+1.0, Z), SetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
else SetPlayerPos(playerid, X+1.0, Y+1.0, Z), SetPlayerFacingAngle(playerid, Angle);
}
return true;
}