/spec command
#5

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;
}
Reply


Messages In This Thread
/spec command - by Johnson_Brooks - 10.06.2014, 20:21
Re: /spec command - by KtotheYle - 10.06.2014, 21:21
Re: /spec command - by Johnson_Brooks - 10.06.2014, 22:04
Re: /spec command - by Threshold - 10.06.2014, 22:19
Re: /spec command - by Dignity - 10.06.2014, 22:23
Re: /spec command - by Johnson_Brooks - 10.06.2014, 22:37
Re: /spec command - by Dignity - 10.06.2014, 22:41
Re: /spec command - by Johnson_Brooks - 10.06.2014, 22:48

Forum Jump:


Users browsing this thread: 1 Guest(s)