10.06.2014, 22:23
Compiles but hasn't been tested. Allows you to use just one command for spectating.
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
new bool: IsPlayerSpectating[MAX_PLAYERS];
CMD:spec(playerid, params[])
{
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "/spec [id/name]");
TogglePlayerSpectating(playerid, true);
if(!IsPlayerSpectating[playerid])
{
PlayerSpectatePlayer(playerid, targetid, SPECTATE_MODE_FIXED);
IsPlayerSpectating[playerid] = true;
}
else if(IsPlayerSpectating[playerid])
{
TogglePlayerSpectating(playerid, false);
IsPlayerSpectating[playerid] = false;
}
return true;
}