Guest User

Ant-Flood

a guest
Nov 17th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. #include <a_samp>
  2. //~~~~~~~~~~~~~~~~~~
  3. forward TaCalado();
  4. forward FoiAvisado();
  5. //~~~~~~~~~~~~~~~~~~
  6. static TempoChat[MAX_PLAYERS];
  7. static ChatMsg[MAX_PLAYERS][128];
  8. //~~~~~~~~~~~~~~~~~~
  9. new PlCalado[MAX_PLAYERS]= 0;
  10. new TAviso[MAX_PLAYERS]= 0;
  11. new nomedele[MAX_PLAYER_NAME];
  12. //~~~~~~~~~~~~~~~~~~
  13. public OnFilterScriptInit()
  14. {
  15. print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  16. print("~ FilterScript Ant-Flood Carregado Com Sucesso ~");
  17. print("~ By: .:: [LF]PlaYer ::. ");
  18. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  19. SetTimer("TaCalado", 40000, 1);
  20. SetTimer("FoiAvisado", 2000, 1);
  21. return 1;
  22. }
  23.  
  24. public OnFilterScriptExit()
  25. {
  26. print("\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  27. print("~ FilterScript Ant-Flood Descarregado Com Sucesso ~");
  28. print("~ By: .:: [LF]PlaYer ::. ");
  29. print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
  30. return 1;
  31. }
  32.  
  33.  
  34. stock FazendoFlood(playerid)
  35. {
  36. if(GetTickCount() - TempoChat[playerid] < 2000)
  37. return 1;
  38.  
  39. return 0;
  40. }
  41.  
  42. public OnPlayerText(playerid, text[])
  43. {
  44. if(PlCalado[playerid] == 1)
  45. {
  46. SendClientMessage(playerid, 0x12900BBF, "[x] Você não pode falar pois foi Calado - [Motivo: Flood]!");
  47. return 0;
  48. }
  49.  
  50. if(TAviso[playerid] == 1)
  51. {
  52. new string[222];
  53. GetPlayerName(playerid, nomedele, MAX_PLAYER_NAME);
  54. format(string, sizeof(string), "[x] - [LF]PlaYer calou o jogador %s - [Motivo: Flood].", nomedele);
  55. SendClientMessageToAll(0x12900BBF,string);
  56. PlCalado[playerid]= 1;
  57. TAviso[playerid]= 0;
  58. return 0;
  59. }
  60. if(FazendoFlood(playerid) && !IsPlayerAdmin(playerid))
  61. {
  62. GetPlayerName(playerid, nomedele, MAX_PLAYER_NAME);
  63. SendClientMessage(playerid, 0xFFFF00AA, "(~) Pare de fazer flood ou você vai ser Calado!!");
  64. TAviso[playerid]= 1;
  65. return 0;
  66. }
  67. if(!IsPlayerAdmin(playerid))
  68. {
  69. if(strlen(text) == strlen(ChatMsg[playerid]) && !strcmp(ChatMsg[playerid], text, false))
  70. {
  71. SendClientMessage(playerid, 0xAA3333AA, "[x] - Não repita esta mensagen.");
  72. format(ChatMsg[playerid], 128, "%s", text);
  73. return 0;
  74. }
  75. }
  76. format(ChatMsg[playerid], 128, "%s", text);
  77. TempoChat[playerid] = GetTickCount();
  78. return 1;
  79. }
  80.  
  81. public TaCalado(){
  82. for(new pl=0;pl<MAX_PLAYERS;pl++){
  83. if(IsPlayerConnected(pl)){
  84. if(PlCalado[pl] == 1){
  85. PlCalado[pl]= 0;
  86. SendClientMessage(pl, 0x9955DEEE, "(~) Você foi descalado, não faça mais flood.");
  87. }
  88. }
  89. }
  90. }
  91.  
  92. public FoiAvisado(){
  93. for(new pl=0;pl<MAX_PLAYERS;pl++){
  94. if(IsPlayerConnected(pl)){
  95. if(TAviso[pl] == 1){
  96. TAviso[pl]= 0;
  97. }
  98. }
  99. }
  100. }
  101.  
  102. /*
  103. .:: Criado Por ::.
  104. .:: [LF]PlaYer/BlackSky ::.
  105. */
  106.  
Advertisement
Add Comment
Please, Sign In to add comment