Spectate Script not working
#1

Hello!

I just downloaded that spectate filterscript : https://sampforum.blast.hk/showthread.php?tid=127354

and its not working ,i compiled to .amx file and i placed it fs folder and added SpecFS to filterscript line in server.cfg but when I type /spec in server it says SERVER: Unknown Command.Can someone fix it maybe?
Reply
#2

Did it load up in the server log?
Reply
#3

It loaded FS:

[22:51:22] Filterscripts
[22:51:22] ---------------
[22:51:22] Loading filterscript 'motd.amx'...
[22:51:22]
--------------------------------------
[22:51:22] Textdraw MOTD (Message Of The Day) by AiRa LoKa
[22:51:22] --------------------------------------

[22:51:22] Loading filterscript 'SpecFS.amx'...
[22:51:22] Loaded 2 filterscripts.

I Got only 2 FS
Reply
#4

Please someone give me script/FS for the admin spectating mode (/spec and /specoff).I need it immediatly.
Reply
#5

hi,

actually you can find this kind of commands in every admin FS but here is a raw command structure that might help you for the start

pawn Код:
//OnPlayerCommandText(Performed)
dcmd(spec,4,cmdtext);
dcmd(specoff,7,cmdtext);

//Commands using dcmd and sscanf (required includes!)
dcmd_spec(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id;
        if(sscanf(params,"u",id))return SendClientMessage(playerid,0xFF0000FF,"Usage: /spec[ID]");
        if(!IsPlayerConnected(id))return SendClientMessage(playerid,0xFF0000FF,"Player ID/Name not found!");
        if(id == playerid)return SendClientMessage(playerid,0xFF0000FF,"You can't spectate yourself!");
        if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,"Invalid PlayerID!");
        new string[64],name[24];
        GetPlayerName(id,name,24);
        SetPlayerInterior(playerid,GetPlayerInterior(id));
        TogglePlayerSpectating(playerid,true);
        PlayerSpectatePlayer(playerid,id);
        format(string,sizeof(string),"You are now spectating player: %s",name);
        SendClientMessage(playerid,0xFF0000FF,string);
    }else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
    return 1;
}
dcmd_specoff(playerid,params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
        TogglePlayerSpectating(playerid,false);
        SetCameraBehindPlayer(playerid);
        SendClientMessage(playerid,0xFF0000FF,"You have turned the spectating mode off.");
    }else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
    return 1;
}
Is that the kind of commands you have requested?
Reply
#6

Yes,but I dont use dcmd.I use CMD (CMD: spec,CMD: specoff).Could you please make that script in CMD,because i dont know how to do it?

Thanks
Reply
#7

Do you mean ZCMD?

here you go:

pawn Код:
CMD:spec(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        new id;
        if(sscanf(params,"u",id))return SendClientMessage(playerid,0xFF0000FF,"Usage: /spec[ID]");
        if(!IsPlayerConnected(id))return SendClientMessage(playerid,0xFF0000FF,"Player ID/Name not found!");
        if(id == playerid)return SendClientMessage(playerid,0xFF0000FF,"You can't spectate yourself!");
        if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid,0xFF0000FF,"Invalid PlayerID!");
        new string[64],name[24];
        GetPlayerName(id,name,24);
        SetPlayerInterior(playerid,GetPlayerInterior(id));
        TogglePlayerSpectating(playerid,true);
        PlayerSpectatePlayer(playerid,id);
        format(string,sizeof(string),"You are now spectating player: %s",name);
        SendClientMessage(playerid,0xFF0000FF,string);
    }else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
    return 1;
}
CMD:specoff(playerid,params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
        TogglePlayerSpectating(playerid,false);
        SetCameraBehindPlayer(playerid);
        SendClientMessage(playerid,0xFF0000FF,"You have turned the spectating mode off.");
    }else return SendClientMessage(playerid, 0xFF0000FF, "You are not an admin!");
    return 1;
}
Reply
#8

Thanks a lot
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)