Advertisement
EdoKing

EDWARD ROSE ™️

Dec 22nd, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. ============================
  2. ANTI SPAM - EDWARD ROSE ©️
  3. ============================
  4.  
  5. new spamming[MAX_PLAYERS][2];
  6. new tick;
  7. new kickplayer[MAX_PLAYERS];
  8.  
  9. #define Red "{FF0000}"
  10. #define White "{FFFFFF}"
  11. #define Grey "{B8B8B8}"
  12.  
  13. GetTickCount2()
  14. {
  15. new count = GetTickCount();
  16. return count < 0 ? count +- tick : count - tick;
  17. }
  18.  
  19. PlayerName(playerid)
  20. {
  21. new name[25];
  22. GetPlayerName(playerid, name, sizeof(name));
  23. return name;
  24. }
  25. public OnPlayerText(playerid, text[])
  26. {
  27. new count = GetTickCount2();
  28. new string[270];
  29. if (count-spamming[playerid][1] < 1000) {
  30. spamming[playerid][0] ++;
  31. if (spamming[playerid][0] == 3) {
  32. SendClientMessage(playerid, -1, "{FF0000}[WARNING]: Ve molime prestanete da spamate!!!");
  33. }
  34. if (spamming[playerid][0] == 5) {
  35. spamming[playerid][0] = 0;
  36. SendClientMessage(playerid, -1, "{B8B8B8}[SERVER]{FFFFFF} Iskluceni ste od server pricina: {FF0000}SPAM{FFFFFF}");
  37. kickplayer[playerid] = SetTimerEx("KickOrBan", 50, 0, "dd", playerid, 1);
  38. format(string, 128, "{B8B8B8}[SERVER]:{FFFFFF} %s e isklucen od server pricina: {FF0000}SPAM.", PlayerName(playerid));
  39. ABroadcast(-1, string);
  40. return 0;
  41. }
  42. }
  43. else
  44. {
  45. spamming[playerid][0] = 1;
  46. }
  47. spamming[playerid][1] = count;
  48. return 1;
  49. }
  50.  
  51. forward KickOrBan(playerid, kickorban);
  52. public KickOrBan(playerid, kickorban)
  53. {
  54. switch (kickorban)
  55. {
  56. case 1: Kick(playerid);
  57. case 2: {
  58. Ban(playerid);
  59. }
  60. }
  61. KillTimer(kickplayer[playerid]);
  62. kickplayer[playerid] = 0;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement