Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define PROTECT_CHAT(%2,%3,%4); \
- AntiPublic(playerid,text); \
- if(MaxString(text,%2)) return SendClientMessage(playerid,%3,%4); \
- StringMinuscula(text); \
- if(AntiBadWord(text)) return false;
- public OnPlayerText(playerid,text[])
- {
- PROTECT_CHAT(64,0xC9170EFF,"[ERRO]: Número de Caraters Agingido [64]");
- return true;
- }
- stock AntiBadWord(text[])
- {
- #define N_PALAVREADO 23
- new Word[N_PALAVREADO][] =
- {
- "puta", "fdp","aranga", "vagab","broxa","ignorant","comed",
- "ejacu","prosti","cachorr", "surub","peni","chup","pau","viad","perere","mae",
- "bucet","cu","bicha.","bixa","gay","desgra"
- };
- #define Parar break;
- #define SearchTrue(%1,%2) \
- if(strfind(%1,%2,true)!=-1) return true;
- new string[128]; format(string,128,text);
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '4') string[ st ] = 'a';
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '3') string[ st ] = 'e';
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '5') string[ st ] = 's';
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '8') string[ st ] = 'b';
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '7') string[ st ] = 't';
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '0') string[ st ] = 'o';
- for(new st = 0 , j = strlen(text) ; st <= j; ++st)
- if(string[ st ] == '1') string[ st ] = 'i';
- new cs;
- for( new st = 0 , j = 22; st <= j; ++st)
- {
- if((string[ st ]>='a' && string[ st ]<='z') || (string[ st ]>='A' && string[ st ]<='Z'))
- {
- if(! cs || ( cs && string[ cs - 1 ] != string[ st ]))
- {
- string[ cs ] = string[ st ];
- cs++;
- }
- }
- if( cs >= string[ st ])
- Parar
- }
- for(new s = 0 ; s <= N_PALAVREADO;++ s) SearchTrue(string,Word[ s ])
- return false;
- }
- stock AntiSites(text[])
- {
- new string[ 128 ]; format(string,128,text);
- #define N_SITES 23
- #define SearchTrue(%1,%2) if(strfind(%1,%2,true)!=-1) return true;
- new Sites[ N_SITES ][] =
- {
- ".net", ".ch",".com", ".br",
- "art.br",".ru",".zip",".blogspot",".forumeiros",
- ".info", ".org",".edu",".jus","wiki.","vlog.br",
- "adm.br","co.cc",".tk","www.","http",".us",".tv"
- };
- for(new s = 0 ; s <= N_SITES; ++ s) SearchTrue(string,Word [ s ])
- return false;
- }
- stock MaxString(text[],max)
- {
- new size = strlen(text);
- if(size > max)
- return true;
- return false;
- }
- stock AntiPublic(playerid,text[])
- {
- new sizes_s = strlen(text);
- new cont = 0;
- for (new i = 0 ; i <= sizes_s; i++) if ((text[ i ] >= 47) && (text[ i ] <= 58)) cont++;
- if (cont >= 8 && cont <= 16)
- {
- for (new xs = 0; xs <= sizes_s; xs++) if((text[ xs ] == 46) || (text[ xs ] == 58))
- {
- Kick(playerid);
- return false;
- }
- }
- return true;
- }
- stock StringMinuscula(text[])
- {
- new size=strlen(text);
- for (new LowerC = 0; LowerC <= size; LowerC ++)
- if (text[ LowerC ] > 64 && text[ LowerC ] < 91 ) text[ LowerC ] += 32;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement