Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By GROVE4L.
- #include <a_samp>
- public OnGameModeInit()
- {
- //Debug Mode
- if(DetectSPAM("190.218.8.452:7777")) print(" >>> [ANTI-SPAM]SPAM Detected! <<<");
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(DetectSPAM(text)) { SendClientMessage(playerid,0xFFFFFFFF,"SPAM is not allowed!"); return 0; }
- return 1;
- }
- DetectSPAM(SPAM[])
- {
- new StringSPAM;
- new COUNTP,COUNTN,COUNTW,COUNTTP;
- for(StringSPAM = 0; StringSPAM < strlen(SPAM); StringSPAM ++)
- {
- if(SPAM[StringSPAM] == '.') COUNTP ++; //Count of the points
- 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
- if(SPAM[StringSPAM] == 'w' || SPAM[StringSPAM] == 'W') COUNTW ++; //Count of the "W"
- if(SPAM[StringSPAM] == ':') COUNTTP ++; //Count of the ":"
- }
- if(COUNTP >= 3 && COUNTN >= 4) return 1;
- if(COUNTW >= 3) return 1;
- 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;
- if(COUNTTP >= 1 && COUNTN >= 4) return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement