SA-MP Forums Archive
Anti 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: Anti Spam (/showthread.php?tid=93077)



Anti Spam - Puzi - 23.08.2009

Hey there,

I would like to make my own Anti Spam but I am quite lost with making it. What I am looking for is when a player spams, he gets muted for about 20 seconds, but when he spams 3 times, he gets kicked automatically. Is that possible? If yes, please help.

Thanks and Regards
Puzi

P.S - I was searching around SA-MP forums, Anti Spams seem to be only in admin scripts which don't suit my script, I get load of errors.


Re: Anti Spam - ronyx69 - 23.08.2009

Do something like:
Код:
OnPlayerText(blblaabl....)
  {
  if(spam=1)
    {
    return 0;
    }
  else
    {
    SetTimer(balablblabla to your callback which changes the "spam" to 0, like 1 second);
    return 1;
    }
  }



Re: Anti Spam - Puzi - 23.08.2009

Doesn't work, changed the blabla bits :P


Re: Anti Spam - ronyx69 - 23.08.2009

Did you make a callback which makes the spam 0 and called it with the timer?

BTW it needs to be spam[playerid], and where you create it needs to be new spam[MAX_PLAYERS];