Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <regex>
- #define REPLACE_TEXT " {FF0000}[РЕЛАМА ЗАПРЕЩЕНА]{00FF00} "
- new RegEx:antiReklama;
- public OnFilterScriptInit()
- {
- antiReklama = regex_build("(((\\w+):\\/\\/)|(www\\.|\\,|))+(([\\w\\.\\,_-]{2,}(\\.|\\,)[\\w]{2,6})|(([\\d]{1,3}(\\b))(\\s+|)(\\.|\\,|\\s)(\\s+|)[\\d]{1,3}(\\s+|)(\\.|\\,|\\s)(\\s+|)[\\d]{1,3}(\\s+|)(\\.|\\,|\\s)(\\s+|)[\\d]{1,3}))(((\\s+|)(\\:|\\;|\\s)(\\s+|)[\\d\\s]{2,}(\\b))|\\b)(\\/[\\w\\&\\;\\%_\\.\\/\\-\\~\\-]*)?");
- if(regex_isvalid(antiReklama))
- printf("Антиреклама by Romanius загружена!");
- else
- printf("Проблемма при загрузке скрипта антирекламы. Проверьте правильность регулярного выражения");
- return 1;
- }
- public OnFilterScriptExit()
- {
- regex_delete(antiReklama);
- printf("Антиреклама by Romanius выгружена!");
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- new message[256];
- regex_replace_exid(text, antiReklama, REPLACE_TEXT, message);
- SendPlayerMessageToAll(playerid, message);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment