14.03.2013, 00:08
pawn Код:
dcmd_goto(playerid, params[])
{
new ID;
if(IsInDM[playerid] == 1) SendClientMessage(playerid,COLOR_RED,"ERROR: {FFFFFF}You can not use commands in DM use /leavedm");
else if(sscanf(params, "u", ID)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /goto [ID]");
else if(!IsPlayerConnected(ID) || ID == playerid) SendClientMessage(playerid, COLOR_RED, "ERROR: {FFFFFF}This player is offline or it is yourself");
else if(toggoto[ID] == 1) SendClientMessage(playerid, COLOR_RED, "ERROR: {FFFFFF}This player has DISABLED goto command or is in DM /toggoto");
else if(GetPlayerVirtualWorld(ID) != GetPlayerVirtualWorld(playerid)) // SendClientMessage That player is in different world
else
{
new Float:x, Float:y, Float:z;
GetPlayerPos(ID, x, y, z);
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
SetVehiclePos(GetPlayerVehicleID(playerid), x+4, y, z);
else
SetPlayerPos(playerid, x+2, y, z);
SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(ID));
}
return 1;
}