Advertisement
Guest User

Esay AntiSpam [KingClem]

a guest
Jun 19th, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.21 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COLOR_RED 0xFF0000AA
  4.  
  5.  
  6. #define ERSTERWARN 2
  7. #define ZWEITERWARN 3
  8. #define KICKW 4
  9.  
  10. #define Timer 3
  11.  
  12.  
  13. new Spam[MAX_PLAYERS];
  14. new Nachricht[MAX_PLAYERS],msg1[156];
  15. public OnFilterScriptInit()
  16. {
  17.     print("\n--------------------------------------");
  18.     print("Anti Spam System ||| By KingClem");
  19.     print("--------------------------------------\n");
  20.     return 1;
  21. }
  22.  
  23. public OnFilterScriptExit()
  24. {
  25.     print("-------------------------------");
  26.     print("Anti Spam System ||| By KingClem");
  27.     print("-------------------------------\n");
  28.     return 1;
  29. }
  30. public Timer1()
  31. {
  32. for(new i=0; i<MAX_PLAYERS; i++)
  33. {
  34. if(Spam[i] > 0 )
  35. Spam[i]--;
  36. }
  37. return 1;
  38. }
  39.  
  40.  
  41. public OnPlayerRequestClass(playerid, classid)
  42. {
  43.     return 1;
  44. }
  45.  
  46. public OnPlayerConnect(playerid)
  47. {
  48. Spam[playerid] = 0;
  49. Nachricht[playerid] = 0;
  50. return 1;
  51. }
  52.  
  53.  
  54.  
  55. public OnPlayerDeath(playerid, killerid, reason)
  56. {
  57.     return 1;
  58. }
  59.  
  60. public OnVehicleSpawn(vehicleid)
  61. {
  62.     return 1;
  63. }
  64.  
  65. public OnVehicleDeath(vehicleid, killerid)
  66. {
  67.     return 1;
  68. }
  69.  
  70. public OnPlayerText(playerid, text[])
  71. {
  72. new name[156],string[256];
  73. GetPlayerName(playerid,name,sizeof(name));
  74. if(Nachricht[playerid]==0)
  75. {
  76. Nachricht[playerid]++;
  77. format(msg1,sizeof(msg1),"%s",text);
  78. }else if(Nachricht[playerid] == 1)
  79. {
  80. if(strcmp(msg1,text,true) == 0){
  81. Nachricht[playerid]++;
  82. SendClientMessage(playerid,COLOR_RED,"Flooding Control - Noch einmal die Selbe Nachricht und du wirst gekickt.");
  83. }
  84. }else if(Nachricht[playerid] == 2)
  85. {
  86. if(strcmp(msg1,text,true) != 0) return Nachricht[playerid] = 0;
  87. format(string,sizeof(string),"Flooding Control - %s wurde gekickt.",name);
  88. SendClientMessageToAll(COLOR_RED,string);
  89. Kick(playerid);
  90.  
  91. }
  92.  
  93. Spam[playerid]++;
  94. if(Spam[playerid] == ERSTERWARN){
  95. SendClientMessage(playerid,COLOR_RED,"Flooding Control - Stop das spammen oder du wirst gekickt[Warnung 1/3]");
  96. }
  97. if(Spam[playerid] == ZWEITERWARN){
  98. SendClientMessage(playerid,COLOR_RED,"Flooding Control - Stop das spammen oder du wirst gekickt[Warnung 2/3]");
  99. }
  100. if(Spam[playerid]== KICKW){
  101. format(string,sizeof(string),"Flooding Control - %s wurde gekickt.",name);
  102. SendClientMessageToAll(COLOR_RED,string);
  103. Kick(playerid);
  104. }
  105. SetTimer("Timer1", Timer*1000, 0);
  106.  
  107. return 1;
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement