Advertisement
Chip7

[FS] Ant-Flood v1.5

Apr 28th, 2012
481
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.81 KB | None | 0 0
  1. /*VISITE NOSSO SITE: http://www.sampknd.com/
  2.   SAMP KND MELHOR BLOG DE SAMP DO BRASIL
  3. */
  4.  
  5. #include <a_samp>
  6.  
  7. new IsFlooding[MAX_PLAYERS];
  8. new Flooder[MAX_PLAYERS];
  9. new szPlayerChatMsg[MAX_PLAYERS][128];
  10.  
  11. public OnGameModeInit()
  12. {
  13.     print("\n--------------------------------------");
  14.     print(" FilterScript Ant-Flood BY: [LF]PlaYer");
  15.     print("--------------------------------------\n");
  16.     return 1;
  17. }
  18.  
  19.  
  20. public OnPlayerText(playerid, text[])
  21. {
  22.     if(Flooder[playerid] == 1)
  23.     {
  24.         SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Você está calado e não pode usar o chat !");
  25.         return 0;
  26.     }
  27.     IsFlooding[playerid]++;
  28.     if(!IsPlayerAdmin(playerid))
  29.     {
  30.         if(strlen(text) == strlen(szPlayerChatMsg[playerid]) && !strcmp(szPlayerChatMsg[playerid], text,  false))
  31.         {
  32.             SendClientMessage(playerid, -1, "{FF0000}[ERRO]{FFFFFF} Não repita a mesma mensagem!");
  33.             format(szPlayerChatMsg[playerid], 128, "%s", text);
  34.             return 0;
  35.         }
  36.     }
  37.     if(IsFlooding[playerid] >= 3)
  38.     {
  39.         IsFlooding[playerid] = 0;
  40.         Flooder[playerid] = 1;
  41.         SendClientMessage(playerid, -1, "{FF0000}[INFO]{FFFFFF} Você foi calado por 1 minuto. Motivo: Flood !");
  42.         SetTimerEx("LiberarChat", 60000, false, "i", playerid);
  43.         return 0;
  44.     }
  45.     else
  46.     {
  47.         SetTimerEx("SemFlood", 2000, false, "i", playerid);
  48.     }
  49.     return 1;
  50. }
  51.  
  52. forward SemFlood(playerid);
  53. public SemFlood(playerid)
  54. {
  55.     IsFlooding[playerid] = 0;
  56.     return 1;
  57. }
  58.  
  59. forward LiberarChat(playerid);
  60. public LiberarChat(playerid)
  61. {
  62.     Flooder[playerid] = 0;
  63.     SendClientMessage(playerid, -1, "Você foi descalado, não faça mais flood !");
  64.     return 1;
  65. }
  66. /* Não retire os creditos Criador: [LF]PlaYer  
  67. Com Ajuda de rjjj */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement