14.02.2014, 17:24
pawn Код:
CMD:goto(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
new pID, string[128], Float:x, Float:y, Float:z, IGRAC1[MAX_PLAYER_NAME];
GetPlayerName(playerid, IGRAC1, sizeof(IGRAC1));
if(sscanf(params, "u", pID))return SendClientMessage(playerid, -1, ""HEX_PLAVA"[ERROR]"HEX_BELA" Pravilan sintaks komande: /goto [Ime/ID]");
if(pID == INVALID_PLAYER_ID)return SendClientMessage(playerid, -1, ""HEX_PLAVA"[ERROR] "HEX_BELA"Igrac nije konektovan ili nije logovan.");
format(string, sizeof(string), ""HEX_PLAVA"[Info]"HEX_BELA" Teleportovali ste se do igraca %s.", IGRAC1);
GetPlayerPos(pID, x, y, z);
SendClientMessage(playerid, -1, string);
if(IsPlayerInAnyVehicle(playerid))return SetPlayerPos(playerid, x+3, y+3, z+3) && SetVehiclePos(GetPlayerVehicleID(playerid), x+3, y+3, z+3) && PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
if(IsPlayerInAnyVehicle(pID))return PutPlayerInVehicle(playerid, GetPlayerVehicleID(pID), 1);
SetPlayerPos(playerid, x, y, z);
}
else
{
SendClientMessage(playerid, -1, ""HEX_PLAVA"[ERROR] "HEX_BELA"Niste ovlasteni da koristite ovu komandu.");
}
return 1;
}