SA-MP Forums Archive
/spec command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /spec command (/showthread.php?tid=518626)



/spec command - Johnson_Brooks - 10.06.2014

How can i make a /spec , /specoff command ?
I've only seen a code in the default fs's but i can't use that .
Could someone help me with this ?


Re: /spec command - KtotheYle - 10.06.2014

You could SetCameraBehindPlayer([Id of the player being spectated]);

Then for specoff SetCameraBehindPlayer(playerid);


Re: /spec command - Johnson_Brooks - 10.06.2014

Quote:
Originally Posted by KtotheYle
Посмотреть сообщение
You could SetCameraBehindPlayer([Id of the player being spectated]);

Then for specoff SetCameraBehindPlayer(playerid);
Im delighted now ... I Dont think that it would work like that


Re: /spec command - Threshold - 10.06.2014

There are plenty of examples and/or filterscripts to be found on the forums. Use the 'search' button.


Re: /spec command - Dignity - 10.06.2014

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



Re: /spec command - Johnson_Brooks - 10.06.2014

delete this post


Re: /spec command - Dignity - 10.06.2014

Update your a_samp.inc include.


Re: /spec command - Johnson_Brooks - 10.06.2014

Quote:
Originally Posted by Mionee
Посмотреть сообщение
Update your a_samp.inc include.
Its not my a_samp.inc .
It was something else , i fixed it -_-