06.07.2012, 01:13
pawn Код:
CMD:tv(playerid, params[])
{
new userid;
if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, C_ERRO, "Vocк nгo tem autorizaзгo para utilizar este comando");
new bool: TVPlayer[MAX_PLAYERS], ID;
if(!TVPlayer[playerid])
{
if(sscanf(params, "u", ID)) return SendClientMessage(playerid, -1, "Use: /TV [{FF0000}ID{C0C0C0}]");
TogglePlayerSpectating(playerid, 1);
if(IsPlayerInAnyVehicle(ID)) return PlayerSpectateVehicle(playerid, GetPlayerVehicleID(ID));
PlayerSpectatePlayer(playerid, userid);
format(String, sizeof(String), "Vocк estб de TV em: %s", NomeDoPlayer(playerid));
SendClientMessage(playerid, C_ERRO, String);
TVPlayer[playerid] = true;
return true;
}
else
{
TogglePlayerSpectating(playerid, 0);
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
TVPlayer[playerid] = false;
return true;
}
}