Thread: [Solved] Warning to the player
View Single Post
amirwolf
Senior Member
Join Date: Feb 2019
Location: Iran
Old 02-18-2020 , 08:48   Re: Warning to the player
Reply With Quote #7

Quote:
Originally Posted by Napoleon_be View Post
Untested
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Warn System"
#define VERSION "1.0"
#define AUTHOR "NapoleoN#"

new const szWords[][] =
{
    
"Black",
    
"White",
    
"Green",
    
"Brown"
};

new 
iWarned[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""HandleSay");
}

public 
client_disconnect(id)
{
    
iWarned[id] = 0;
}

public 
HandleSay(id)
{
    new 
szArg[20];
    
read_args(szArgcharsmax(szArg))
    
    for(new 
isizeof(szWords); i++)
    {
        if(
containi(szArgszWords[i]))
        {
            
client_print(idprint_chat"You have been warned for saying the word: %s"szWords[i]);
            
iWarned[id]++;
            break;
        }
    }
    
    if(
iWarned[id] == 3)
    {
        new 
szAuthid[35];
        
get_user_authid(idszAuthidcharsmax(szAuthid));
            
        
server_cmd("kick #%d"szAuthid);
    }

That was exactly what I wanted
Thanks big man
amirwolf is offline