Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <regex>
- #define REPLACE_TEXT "{FF0000}[РЕЛАМА ЗАПРЕЩЕННА]{FFFFFF}"
- new RegEx:anti_reklama;
- public OnFilterScriptInit()
- {
- anti_reklama = regex_build("(((file|gopher|news|nntp|telnet|http|ftp|https|ftps|sftp|samp)://)|(www\\.|\\,|))+(([a-zA-Z0-9\\.\\,_-]+(\\.|\\,)[a-zA-Z]{2,6})|([0-9]{1,3}(\\.|\\,)[0-9]{1,3}(\\.|\\,)[0-9]{1,3}(\\.|\\,)[0-9]{1,3}))(/[a-zA-Z0-9\\&%_\\./-~-]*)?");
- printf("Антиреклама by Romanius загруженна!");
- return 1;
- }
- public OnFilterScriptExit()
- {
- regex_delete(anti_reklama);
- printf("Антиреклама by Romanius выгруженна!");
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new message[256];
- regex_replace_exid(text, anti_reklama, REPLACE_TEXT, message);
- SendPlayerMessageToAll(playerid, message);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement