SA-MP Forums Archive
[SOLVED] Anti Command Spam. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [SOLVED] Anti Command Spam. (/showthread.php?tid=87999)



[SOLVED] Anti Command Spam. - BP13 - 23.07.2009

how do I make it so if they are typing a command 4 times+ in a row it wikk kick them Reason command spam. cause on my server you will see something like this.

TELE:BP13 has gone to mostercrash. (/monstercrash)
TELE:BP13 has gone to mostercrash. (/monstercrash)
TELE:BP13 has gone to mostercrash. (/monstercrash)
TELE:BP13 has gone to mostercrash. (/monstercrash)
TELE:BP13 has gone to mostercrash. (/monstercrash)
TELE:BP13 has gone to mostercrash. (/monstercrash)

some people think its (fun?) or something to type it alot of times for no reason. And FYI I searched Anti command spam and nothing of my interest came up. Thanks for helping.


Re: Anti Command Spam. - Correlli - 23.07.2009

http://forum.sa-mp.com/index.php?topic=96625.0
This anticheat has message/command anti-spam feature i see. Easy to find.


Re: Anti Command Spam. - BP13 - 23.07.2009

I tried that. All it did was make it so that no chat worked at all. I fixed it to make it work. but the command spam did not work


Re: Anti Command Spam. - Correlli - 23.07.2009

Strange.. because i tried it now and it works normally.


Re: Anti Command Spam. - BP13 - 23.07.2009

maybe suggest another one because it does not work for ME


Re: Anti Command Spam. - Correlli - 23.07.2009

Quote:
Originally Posted by [SU
BP13 ]
maybe suggest another one because it does not work for ME
Or maybe you don't know how to use it properly?
Try and search for another one, i won't search for everything you need.


Re: Anti Command Spam. - BP13 - 23.07.2009

yes I am aware how to install it. I have even got the creator of it to do it for me. I don not want a full anticheat I only want a stand alone anti-command spam.


Re: Anti Command Spam. - BP13 - 26.07.2009

umm help?


Re: Anti Command Spam. - Joe Staff - 26.07.2009

It's pretty simple and can be done in many different ways. While reading your posts I had thought of a pretty cool method. Now for the benefit for everyone else I will create the snippet.

pawn Код:
#define MAX_COMMAND_FREQUENCY 4 //effects how many times a player can type a command without being stopped
new PlayerCmdFrq[MAX_PLAYERS]; //Player Command Frequency
forward UpdateCmdFreq();

public OnPlayerCommandText(playerid,cmdtext[])
{
    PlayerCmdFrq[playerid]++;
    if(PlayerCmdFrq[playerid]>MAX_COMMAND_FREQUENCY)
    {
        SendClientMessage(playerid,0xFF0000FF,"You can't use commands so often.");
        return 1;
    }
    //Then your commands and everything else go here
}
public OnGameModeInit()
{
    SetTimer("UpdateCmdFreq",2000,1);
}
public UpdateCmdFreq()
{
    for(new playerid;playerid<MAX_PLAYERS;playerid++)
    {
      if(PlayerCmdFrq[playerid])PlayerCmdFrq[playerid]--;
    }
}
This will allow a player to do up to 4 but then only let them do 1 per second, which that 1 will roll over to the next second (allowing a build up of 4 again).

Enjoy it!


Re: Anti Command Spam. - [top_Shoter] - 26.07.2009

i was bout to post mine but i see its already been done. that exsample is like same as mine just has diffrent names