inappropriate words
#1

I'm currently editing my @OnPlayerText callback and I need some support.

Its about inappropriate words...

@OnPlayerText CODE:

PHP код:
    for(new psovkapsovka sizeof(NeprikladneRijeci); psovka++)
    {
          if(
PlayerInfo[playerid][pAdministrator] == && PlayerInfo[playerid][pSupporter] == 0)
          {
             if(
strfind(text,NeprikladneRijeci[psovka],true) != -1)
             {
                 
SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Upisali ste neprikladnu rijec i ona se nece pojaviti u chatu.");
                
format(poruka,256,"{FF0000}[A-INFO]:{FFFFFF} %s je upisao neprikladnu rijec: '%s'",GetName(playerid),text);
                
SendAdminMessage(-1,poruka);
                return 
0;
            }
            else
            {
                  
format(poruka,256,"{FF8000}%s{C0C0C0} kaze:{FFFFFF} %s",GetName(playerid),text);
                
SendNearMessage(playerid,20.0,-1,poruka);
                return 
0;
            }
        }
         
//
         
if(PlayerInfo[playerid][pSupporter] > 0)
         {
            if(
strfind(text,NeprikladneRijeci[psovka],true) != -1)
            {
                
SendClientMessage(playerid,-1,"{FF0000}Greska:{FFFFFF} Upisali ste neprikladnu rijec i ona se nece pojaviti u chatu.");
                
format(poruka,256,"{FF0000}[A-INFO]: %s %s je upisao neprikladnu rijec: '%s'",GetPlayerSupporterRank(playerid),GetName(playerid),text);
                
SendAdminMessage(-1,poruka);
                return 
0;
            }
             else
            {
                
format(poruka,256,"{FFFF00}%s{FFFFFF} kaze:{FFFF00} %s",GetName(playerid),text);
                
SendNearMessage(playerid,20.0,-1,poruka);
                return 
0;
            }
        }
    } 
The problem is when I test this anti swear system only the 1st word actually gets blocked and the others don't.

InappropriateWords:

PHP код:
new NeprikladneRijeci[] =
{
    
"kurac"// This one works. It means penis on English.
    
"smrad",
    
"govno",
    
"drek",
    
"picka",
    
"sisa",
    
"pizdo",
    
"jebo te",
    
"jebote",
    
"jebi se",
    
"sisaj mi kurac",
    
"pusi kurac",
    
"jebem ti mater",
    
"jebem ti sve",
    
"picka ti materina",
    
"cigane",
    
"idiot",
    
"kreten",
    
"moron",
    
"debil",
    
"nabijem te",
    
"mrs",
    
"odjebi",
    
"sranje",
    
"budala",
    
"ddos",
    
"kurcina",
    
"smrdo"
}; 
EDIT: + No errors.
Reply
#2

what seems to be ur problem?
Reply
#3

The problem is when I test this anti swear system only the 1st word actually gets blocked and the others don't.

EDIT: read more carefully.
Reply
#4

It is because of the "return" statement in your loop.
Reply
#5

well, in my RP server i am using this under OnPlayerText:
PHP код:
if(strfind(text"lol"true) != -1) {
      
GivePlayerCash(playerid, -10000);
      
format(string,sizeof(string), "Admin: %s[ID %d} was fined $10000 by Anti-Cheat: using 'lol' in IC Chat"GetPlayerNameEx(playerid),playerid);
      
SendClientMessageToAll(COLOR_LIGHTREDstring);
      return 
0;
      } 
in place of my code, you can use what you want like ProxDetector with empty String to hide full message etc..
Hope it gave you some idea
Reply
#6

Quote:
Originally Posted by Virtual1ty
Посмотреть сообщение
It is because of the "return" statement in your loop.
Can you explain a bit more?

EDIT: Thanks for support GTLS
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)