Advertisement
Guest User

Untitled

a guest
Jan 14th, 2018
99
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.     new alphaText[192]
  23.     new len = strlen(text);
  24.     new pos = 0;
  25.    
  26.     for (new i=0; i<len; ++i)
  27.     {
  28.         if (isalpha(text[i]))
  29.         {
  30.             alphaText[pos++] = text[i];
  31.         }
  32.     }
  33.    
  34.     read_args(text, 192)
  35.     remove_quotes(text)
  36.    
  37.     new bool:isAd = false;
  38.    
  39.     for (new i=0; i<sizeof(ads); ++i)
  40.     {
  41.         if (containi(text, ads[i]))
  42.         {
  43.             isAd = true;
  44.             break;
  45.         }
  46.     }
  47.    
  48.     return isAd? PLUGIN_HANDLED : PLUGIN_CONTINUE;
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement