SA-MP Forums Archive
Anti cmd 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 cmd spam (/showthread.php?tid=87390)



Anti cmd spam - jonybomb - 19.07.2009

Hi, i made a comand for my server, /lol, when we writte that we have "* jonybomb is LOL", but I need a script for the players can not use the command repeatedly, for example, can only use 1 time per 3 seconds. How i do that?


Re: Anti cmd spam - jonybomb - 20.07.2009

Nobody knows or nobody fucking care?


Re: Anti cmd spam - James_Alex - 20.07.2009

first do not double post please
then try this
pawn Код:
// put this in the top of script

new pTyped[MAX_PLAYERS];

// then this is an example of the command

if(strcmp(cmd, "/lol", true) == 0)
{
  if(pTyped[playerid] == 1)
  {
    SendClientMessageToAll(COLOR_LIGHTRED, "don't abuse of this command !");  
    return 1;
  }
  SendClientMessageToAll(thecolor, "* jonybomb is LOL");
  pTyped[playerid] = 1;
  SetTimerEx("Spam", 3000, false, "i", playerid);
  return 1;
}

forward Spam(playerid);
public Spam(playerid)
{
  pTyped[playerid] = 0;
  return 1;
}



Re: Anti cmd spam - jonybomb - 20.07.2009

It's that, thanks

sorry double post