Raised This Month: $51 Target: $400
 12% 

Weird problem with clcmd and "say"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PrOzinhubr
Junior Member
Join Date: Jun 2010
Old 03-01-2014 , 14:17   Weird problem with clcmd and "say"
Reply With Quote #1

So I'm doing this:
Code:
[...]
public plugin_init() 
{
    register_clcmd("say","sayyy");
}
public sayyy(id) {
    new text[64];
    read_args(text, 63);
    trim(text);

    if (equali(text, "/shine white")) {
        client_print(0, print_chat, "Done")
        return PLUGIN_HANDLED;
    } else if (equali(text, "/shine blue")) {
        client_print(0, print_chat, "Done")
        return PLUGIN_HANDLED;
    } else {

    }

    return PLUGIN_CONTINUE;
}
[...]
If I press Y and type /shine blue, nothing happens.
If I open the console and type say /shine blue, it works.
What's happening?
PrOzinhubr is offline
minato
Senior Member
Join Date: May 2010
Location: Rosario
Old 03-01-2014 , 16:33   Re: Weird problem with clcmd and "say"
Reply With Quote #2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Color Selection"
#define VERSION "1.0"
#define AUTHOR "thizk"


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


public 
cmd_say(index){
    
    new 
text[64], type[64], color[64];
    
read_args(text63);
    
remove_quotes(text);
    
strtok(texttypecharsmax(type), colorcharsmax(color));
    
    if( 
equali(type"/shine") ){
        if( 
equali(color"white")){
            
client_print(0print_chat"YES THE COLOR IS WHITE!")
            return 
PLUGIN_HANDLED;
        }
    }

    return 
PLUGIN_CONTINUE;

__________________
minato is offline
Send a message via MSN to minato
PrOzinhubr
Junior Member
Join Date: Jun 2010
Old 03-03-2014 , 07:45   Re: Weird problem with clcmd and "say"
Reply With Quote #3

@minato Perfect
PrOzinhubr is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:33.


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