Thread: [Solved] code Problem
View Single Post
Author Message
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 01-01-2021 , 09:41   code Problem
Reply With Quote #1

Hi. I have This code. This code detects the sentences I want in the chat and does something. But the problem is that if there is a space in a sentence, the code can not recognize it. This code only recognizes words and is not able to recognize sentences. This is my first problem. The second problem is that this code only recognizes words sent by users. I want, for example, if the server also sends words in the chat, the code can recognize it. Is this possible? Thanks.
Code :
PHP Code:
public ChatGlobalCommand(id)
{
    static 
lastsaid[512], said[512]
    
read_args(said512)
    if(
equal(saidlastsaid))
        return 
PLUGIN_CONTINUE
        
    
for(new 0sizeof BAD_WORDSi++)
    {
        if(
containi(saidBAD_WORDS[i]))
            
replace_all(saidcharsmax(said), BAD_WORDS[i], "***")    
    }
    
formatex(lastsaidcharsmax(lastsaid), "%s"said)
    
client_cmd(id"say %s"said)
    return 
PLUGIN_HANDLED


Last edited by ho83; 01-05-2021 at 08:22.
ho83 is offline