SA-MP Forums Archive
OnPlayerText problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerText problem (/showthread.php?tid=358459)



OnPlayerText problem - Squirrel - 10.07.2012

Well I added anti swear sys and now chat aint working at all...


PHP код:
public OnPlayerText(playeridtext[])
{
    static 
LastText[MAX_PLAYERS][128];
    if(
strfind(LastText[playerid], textfalse) != -1) return SendClientMessage(playeridCOLOR_RED"<!>Don't spam!"), 0;
    
strmid(LastText[playerid], text0strlen(text), sizeof(LastText[]));
    new
        
badWords[][] =
        {
            
"bitch",
            
"ass",
            
"fuck",
            
"nigger",
            
"nigga",
            
"jew",
            
"retard",
            
"whore",
            
"hoe",
            
"negro",
            
"chongo",
            
"nazzi",
            
"noob",
            
"motherfucker",
            
"pussy",
            
"puto"
        
}
    ;
    for(new 
i!= sizeof(badWords); ++i)
    {
        
replaceSwear(textbadWords[i]);
    }
    return 
0;
}
stock replaceSwear(string[], badWord[], replace '*')
{
    new
        
i
    
;
    while((
strfind(stringbadWordtrue)) != -1)
    {
        for(new 
= (strlen(badWord)); != x; ++i)
        {
            
string[i] = replace;
        }
    }
    return 
1;

Commands are working fine but each time I try to use chat it just doesnt display the message


Re: OnPlayerText problem - tyler12 - 10.07.2012

try returing 1?


Re: OnPlayerText problem - Squirrel - 10.07.2012

Resolved, there was problem with something else. Thanks anyway