Advertisement
Jakwob-WG

Anti-Swear

Nov 25th, 2014
640
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.04 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4.  
  5. new SwearWarn[MAX_PLAYERS];
  6. new SwearKick[MAX_PLAYERS];
  7.  
  8. new str[128], string[128];
  9.  
  10. public OnPlayerConnect(playerid)
  11. {
  12.     SwearWarn[playerid] = 0;
  13.     return 1;
  14. }
  15.  
  16. public OnPlayerDisconnect(playerid, reason)
  17. {
  18.     SwearWarn[playerid] = 0;
  19.     return 1;
  20. }
  21.  
  22. public OnPlayerUpdate(playerid)
  23. {
  24.     if(SwearWarn[playerid] == 5)
  25.     {
  26.         format(string, 128, "[Swear Bot]: You have been kicked for swearing!");
  27.         KickWithMessage(playerid, string);
  28.         SwearKick[playerid] ++;
  29.         return 0;
  30.     }
  31.  
  32.     if(SwearKick[playerid] == 5)
  33.     {
  34.         Ban(playerid);
  35.         return 0;
  36.     }
  37.     return 1;
  38. }
  39.  
  40. public OnPlayerText(playerid, text[])
  41. {
  42.     if(strfind(text, "fuck", true))
  43.     {
  44.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  45.         SendClientMessage(playerid, -1, str);
  46.         SwearWarn[playerid] ++;
  47.         return 0;
  48.     }
  49.  
  50.     if(strfind(text, "nigga", true))
  51.     {
  52.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  53.         SendClientMessage(playerid, -1, str);
  54.         SwearWarn[playerid] ++;
  55.         return 0;
  56.     }
  57.  
  58.     if(strfind(text, "hoe", true))
  59.     {
  60.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  61.         SendClientMessage(playerid, -1, str);
  62.         SwearWarn[playerid] ++;
  63.         return 0;
  64.     }
  65.  
  66.     if(strfind(text, "bitch", true))
  67.     {
  68.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  69.         SendClientMessage(playerid, -1, str);
  70.         SwearWarn[playerid] ++;
  71.         return 0;
  72.     }
  73.  
  74.     if(strfind(text, "shit", true))
  75.     {
  76.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  77.         SendClientMessage(playerid, -1, str);
  78.         SwearWarn[playerid] ++;
  79.         return 0;
  80.     }
  81.  
  82.     if(strfind(text, "dick", true))
  83.     {
  84.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  85.         SendClientMessage(playerid, -1, str);
  86.         SwearWarn[playerid] ++;
  87.         return 0;
  88.     }
  89.  
  90.     if(strfind(text, "cock", true))
  91.     {
  92.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  93.         SendClientMessage(playerid, -1, str);
  94.         SwearWarn[playerid] ++;
  95.         return 0;
  96.     }
  97.  
  98.     if(strfind(text, "twat", true))
  99.     {
  100.         format(str, sizeof(str), "[Swear Bot]: {AFAFAF}%s {33CCFF}Please do not swear!", GetName(playerid));
  101.         SendClientMessage(playerid, -1, str);
  102.         SwearWarn[playerid] ++;
  103.         return 0;
  104.     }
  105.     return 1;
  106. }
  107.  
  108. forward KickPublic(playerid);
  109. public KickPublic(playerid) { Kick(playerid); }
  110.  
  111. stock KickWithMessage(playerid, message[])
  112. {
  113.     SendClientMessage(playerid, 0xFF4444FF, message);
  114.     SetTimerEx("KickPublic", 1000, 0, "d", playerid);
  115. }
  116.  
  117.  
  118. stock GetName(playerid)
  119. {
  120.     new Name[MAX_PLAYER_NAME];
  121.     GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  122.     return Name;
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement