Advertisement
Guest User

Untitled

a guest
Apr 16th, 2011
729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.39 KB | None | 0 0
  1. // By GROVE4L.
  2.  
  3. #include <a_samp>
  4.  
  5. public OnGameModeInit()
  6. {
  7.     //Debug Mode
  8.     if(DetectSPAM("190.218.8.452:7777")) print(" >>> [ANTI-SPAM]SPAM Detected! <<<");
  9.     return 1;
  10. }
  11.        
  12. public OnPlayerText(playerid, text[])
  13. {
  14.     if(DetectSPAM(text)) { SendClientMessage(playerid,0xFFFFFFFF,"SPAM is not allowed!"); return 0; }
  15.     return 1;
  16. }
  17.  
  18. DetectSPAM(SPAM[])
  19. {
  20.     new StringSPAM;
  21.     new COUNTP,COUNTN,COUNTW,COUNTTP;
  22.     for(StringSPAM = 0; StringSPAM < strlen(SPAM); StringSPAM ++)
  23.     {
  24.         if(SPAM[StringSPAM] == '.') COUNTP ++; //Count of the points
  25.         if(SPAM[StringSPAM] == '0' || SPAM[StringSPAM] == '1' || SPAM[StringSPAM] == '2' || SPAM[StringSPAM] == '3' || SPAM[StringSPAM] == '4' || SPAM[StringSPAM] == '5' || SPAM[StringSPAM] == '6' || SPAM[StringSPAM] == '7' || SPAM[StringSPAM] == '8' || SPAM[StringSPAM] == '9') COUNTN ++; //Count ot the Numbers
  26.         if(SPAM[StringSPAM] == 'w' || SPAM[StringSPAM] == 'W') COUNTW ++; //Count of the "W"
  27.         if(SPAM[StringSPAM] == ':') COUNTTP ++; //Count of the ":"
  28.     }
  29.     if(COUNTP >= 3 && COUNTN >= 4) return 1;
  30.     if(COUNTW >= 3) return 1;
  31.     if(strfind(SPAM, ".com", true) != -1 || strfind(SPAM, ".com.ar", true) != -1 || strfind(SPAM, ".org", true) != -1 || strfind(SPAM, ".net", true) != -1 || strfind(SPAM, ".es", true) != -1 || strfind(SPAM, ".tk", true) != -1) return 1;
  32.     if(COUNTTP >= 1 && COUNTN >= 4) return 1;
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement