Anti cmd spam
#1

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

Nobody knows or nobody fucking care?
Reply
#3

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

It's that, thanks

sorry double post
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)