/spec command
#1

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 ?
Reply
#2

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

Then for specoff SetCameraBehindPlayer(playerid);
Reply
#3

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
Reply
#4

There are plenty of examples and/or filterscripts to be found on the forums. Use the 'search' button.
Reply
#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
#6

delete this post
Reply
#7

Update your a_samp.inc include.
Reply
#8

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


Forum Jump:


Users browsing this thread: 2 Guest(s)