AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   remove a say command from chat (https://forums.alliedmods.net/showthread.php?t=98833)

HLM 07-29-2009 18:41

remove a say command from chat
 
My plugin works fine (thank you fysiks) but I went a little further, now I want to remove something a client says from appearing in chat, I have looked, but have not found a way to do this.. here is the code for what is said..

PHP Code:

public handle_say(id
{
new 
said[192]
read_args(said,192)
remove_quotes(said)


if( (
containi(said"models") != -1) && !(containi(said"!models") != -1) || (containi(said"model") !=-1) && !(containi(said"!models") != -1) && !(containi(said"!model") !=-1) ) {
    
client_print(idprint_chat"[AMXX] For a menu to select your model, say !models")
    
client_print(id,print_chat"[AMXX] Alternatively if you know the modelname, you can say ^"!model MODELNAME^"")
}

if(
containi(said"!model") != -&& !containi(said"!models"))
{
    
    
replace(said,192,"!model ","")
    if(
is_valid_model(said))
    {
        
tfc_setmodel(idsaid"1")
        
client_print(id,print_chat"[AMXX] Player model set to ^"%s^""said)
    }
    else
    {
        
client_print(id,print_chat"[AMXX] Invalid model, perhaps you should use the menu?")
    }
}

return 
PLUGIN_CONTINUE
}


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("amx_model","set_model",0,"<skin name>"
    
register_concmd("amx_modelmenu""cmdModelMenu"0" - Displays Menu of possible player models.")
    
register_clcmd("say","handle_say")
    
register_clcmd("say !models","cmdModelMenu"0" - Displays Menu of possible player models.")
    
register_clcmd("say !random","random_model",0,"Sets a Random model")
    


thought I should show the plugin_init also..

the say command !model WHATIWANT works fine, but I dont want it showing up in chat (for when someone is going through the list.. and trying out models)

someone want to tell me how this can be done, if it can be done at all?

Exolent[jNr] 07-29-2009 18:42

Re: remove a say command from chat
 
PHP Code:

public handle_say(id
{
new 
said[192]
read_args(said,192)
remove_quotes(said)


if( (
containi(said"models") != -1) && !(containi(said"!models") != -1) || (containi(said"model") !=-1) && !(containi(said"!models") != -1) && !(containi(said"!model") !=-1) ) {
    
client_print(idprint_chat"[AMXX] For a menu to select your model, say !models")
    
client_print(id,print_chat"[AMXX] Alternatively if you know the modelname, you can say ^"!model MODELNAME^"")
}

if(
containi(said"!model") != -&& !containi(said"!models"))
{
    
    
replace(said,192,"!model ","")
    if(
is_valid_model(said))
    {
        
tfc_setmodel(idsaid"1")
        
client_print(id,print_chat"[AMXX] Player model set to ^"%s^""said)
    }
    else
    {
        
client_print(id,print_chat"[AMXX] Invalid model, perhaps you should use the menu?")
    }
    return 
PLUGIN_HANDLED
}

return 
PLUGIN_CONTINUE
}


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("amx_model","set_model",0,"<skin name>"
    
register_concmd("amx_modelmenu""cmdModelMenu"0" - Displays Menu of possible player models.")
    
register_clcmd("say","handle_say")
    
register_clcmd("say !models","cmdModelMenu"0" - Displays Menu of possible player models.")
    
register_clcmd("say !random","random_model",0,"Sets a Random model")
    



HLM 07-29-2009 19:35

Re: remove a say command from chat
 
oh, I see now, it needs to stop it.. that makes perfect sense, thank you Exolent[jNr]!


All times are GMT -4. The time now is 18:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.