Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerText(playerid,text[])
- {
- if(strlen(text) > 0x40) {
- SendClientMessage(playerid,0xC9170EFF,"Limite de caracters atingido, resuma");
- return false;
- }
- return isValidBadWord(playerid,text);
- }
- /*=============================================================================
- Cleanner Chat
- @ author - DraKiNs (www.ips-team.blogspot.com)
- @ date - 2 Junho 2010
- @ update - 2 Junho 2011
- //=============================================================================*/
- stock isValidBadWord(iPlayer,sStringText[])
- {
- new
- iLoop = 0,
- iCount = 0,
- iAndress= 0,
- sTemp[0065],
- sText[0065];
- new sPalavras[][] = {
- "buceta",
- "cu",
- "porra",
- "cadela",
- "viado"
- };
- #define isLower(%0) ((%0 >= 0x61 && %0 <= 0x7A))
- #define setLetter(%0) (%0 = ((%0== 0x34) ? 0x61 : (%0== 0x33) ? 0x65 : (%0== 0x35) ? 0x73 :(%0== 0x38) ? 0x62 : (%0== 0x37) ? 0x74 : (%0== 0x30) ? 0x6F : (%0== 0x31) ? 0x69 : %0))
- strcat(sText,sStringText);
- // Filtrar Texto
- iLoop = 0;
- for( ; sText[iLoop] ; ++iLoop) {
- setLetter(sText[iLoop]);
- if((sText[iLoop] >= 0x41 && sText[iLoop] <= 0x5A)) {
- sStringText[iLoop] += 0x20;
- }
- if(isLower(sText[iLoop])) {
- sTemp[iCount++] = (!iCount || iCount && sTemp[iCount - 1] != sText[iLoop]) ? (sText[iLoop]) : (sTemp[iCount--]);
- }
- else {
- iAndress++;
- }
- }
- // Checar Palavreado
- iLoop = 0;
- for ( ; iLoop < sizeof(sPalavras) ; iLoop++) {
- if(strfind(sTemp,sPalavras[iLoop],true) != -1) {
- SendClientMessage(iPlayer,3373731583,"Por favor, cuidado com que fale, suspeita de palavreado ...");
- return false;
- }
- }
- // Checar Publicação
- if (iAndress >= 0x8 && iAndress <= 0x20) {
- iLoop = 2;
- SendClientMessage(iPlayer,0xC9170EFF,"Kickado por publicar");
- Kick(iPlayer);
- return false;
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement