24.10.2014, 12:02
pawn Код:
CMD:goto(playerid, params[])
{
if(LoggedIN[playerid] == 0) return SCM(playerid, GREY, "YOu have to be logged-in first.");
new id, veh = GetPlayerVehicleID(playerid), Float:X, Float:Y, Float:Z;
if(!PI[playerid][Admin] || !PI[playerid][GameMaster]) return SCM(playerid, GREY, "Not allowed.");
if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Use: /goto [ID / Part of Name]");
if(!IsPlayerConnected(id)) return SCM(playerid, GREY, "That player is not online.");
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(id, X, Y, Z);
SetVehiclePos(veh, X, Y+2, Z);
LinkVehicleToInterior(veh, GetPlayerInterior(id));
SetPlayerVirtualWorld(veh, GetPlayerVirtualWorld(id));
}
else
{
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(playerid, X, Y+2, Z);
SetPlayerInterior(playerid, GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
}
SCM(playerid, GREY, "You have been teleported.");
return 1;
}