tecsites

tec_AntFlood by Tecsites

Oct 23rd, 2012
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.26 KB | None | 0 0
  1. /* tec_AntFlood v1.0 by tecsites  tslimite.blogspot.com
  2. Não retire os credito
  3.  
  4. */
  5. #include <a_samp>
  6. #define tempo 2
  7. new flood[MAX_PLAYERS];
  8. new playerflood[MAX_PLAYERS];
  9. public OnFilterScriptInit()
  10. {
  11.     print("\n--------------------------------------");
  12.     print(" tec_AntFlood by tecsites tslimite.blogspot.com" );
  13.     print("--------------------------------------\n");
  14.     return 1;
  15. }
  16.  
  17. public OnPlayerConnect(playerid)
  18. {
  19. SendClientMessage(playerid,-1,"tec_AntFlood by Tecsites tslimite.blogspot.com");
  20. return 1;
  21. }
  22.  
  23. public OnPlayerDisconnect(playerid, reason)
  24. {
  25. flood[playerid] = 0;
  26. playerflood[playerid] = 0;
  27.  
  28. return 1;
  29. }
  30. forward antflood(playerid);
  31. public antflood(playerid){
  32. flood[playerid] = 0;
  33. playerflood[playerid] = 0;
  34.  
  35. }
  36.  
  37. public OnPlayerText(playerid, text[])
  38. {
  39. flood[playerid]++;
  40. if(flood[playerid] >= 2 && flood[playerid] <= 19){
  41.  
  42. if(playerflood[playerid] == 0){
  43. playerflood[playerid] = 1;
  44. SetTimerEx("antflood",1000 * tempo,false,"flood",playerid);
  45. }
  46. new string[55];
  47. format(string,sizeof(string),"AntFlood:Voce so pode mandar cada mensagem em %d segundos",tempo);
  48. SendClientMessage(playerid,-1,string);
  49. return 0;
  50.  
  51. }else if(flood[playerid] >= 20){
  52. SendClientMessage(playerid,-1,"Banido por usar Cheats-flood");
  53. Ban(playerid);}
  54. return 1;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment