30.11.2012, 10:14
pawn Код:
dcmd_spec(playerid, params[])
{
new id;
if (sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_WHITE, "USAGE: /spec [ID]");
else if (id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_GREY, "* Player[ID] is not found!");
else
if(PlayerInfo[playerid][pAdmin] >= 4)
{
GetPlayerPos(playerid, TeleportDest[playerid][0],TeleportDest[playerid][1],TeleportDest[playerid][2]);
if(IsPlayerInAnyVehicle(id))
{
new int = GetPlayerInterior(id);
SetPlayerInterior(playerid, int);
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
}
else
{
new int = GetPlayerInterior(id);
SetPlayerInterior(playerid, int);
TogglePlayerSpectating(playerid, 1);
PlayerSpectatePlayer(playerid, id);
}
}
return 1;
}
pawn Код:
dcmd_specoff(playerid, params[])
{
#pragma unused params
TogglePlayerSpectating(playerid, 0);
Specing[playerid] = 0;
return 1;
}
When you do /specoff, I need it to return you, to your last position before /spec [ID].