Advertisement
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("(((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}(\\b))(\\s+|)(\\.|\\,)(\\s+|)[0-9]{1,3}(\\s+|)(\\.|\\,)(\\s+|)[0-9]{1,3}(\\s+|)(\\.|\\,)(\\s+|)[0-9]{1,3}))(((\\s+|)\\:(\\s+|)[0-9]{2,}(\\b))|\\b)(\\/[a-zA-Z0-9\\&%_\\.\\/-~-]*)?");
- 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
Advertisement