Advertisement
Guest User

Untitled

a guest
Jan 14th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <amxmodx>
  2. #include <amxmisc>
  3.  
  4. #define PLUGIN  "BlockAds"
  5. #define AUTHOR  "Andrei."
  6. #define VERSION "1.0"
  7.  
  8. new ads[][] =
  9. {
  10.     "wwwgooglecom"
  11. }
  12.  
  13. public plugin_init()
  14. {
  15.     register_plugin(PLUGIN, VERSION, AUTHOR)
  16.     register_clcmd("say", "hookSay");
  17. }
  18.  
  19. public hookSay(id)
  20. {
  21.     new text[192];
  22.    
  23.     read_args(text, 192)
  24.     remove_quotes(text)
  25.    
  26.     new alphaText[192]
  27.     new len = strlen(text);
  28.     new pos = 0;
  29.    
  30.     for (new i=0; i<len; ++i)
  31.     {
  32.         if (isalpha(text[i]))
  33.         {
  34.             alphaText[pos++] = text[i];
  35.         }
  36.     }
  37.    
  38.     new bool:isAd = false;
  39.    
  40.     for (new i=0; i<sizeof(ads); ++i)
  41.     {
  42.         if (containi(alphaText, ads[i]))
  43.         {
  44.             isAd = true;
  45.             break;
  46.         }
  47.     }
  48.    
  49.     return isAd? PLUGIN_HANDLED : PLUGIN_CONTINUE;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement