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

custom say text :)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 02-22-2010 , 13:13   custom say text :)
Reply With Quote #1

Alrighty first some code then the question.
PHP Code:
...
new 
cSay;
...

public 
plugin_init() {
...

/* -- Chat handling -- */
    
register_clcmd("say""c_say");
    
register_clcmd("say_team""c_say");
    
    
cSay get_user_msgid("SayText");
}

public 
c_say(id) {
    new 
say_content[150],name[31];
    
    
read_args(say_contentsizeof(say_content));
    
remove_quotes(say_content);
    
get_user_name(idnamesizeof(name) -1);
    
    
format(say_content191"[%s] %s: %s",tag,name,say_content);
    
message_begin(MSG_ONEcSay_id);
    
write_byte(id);
    
write_string(say_content);
    
message_end();

So when i execute this code on "say" "say_team" commands,
it writes:
Code:
[TAG] Lure.d: some text
Lure.d: some text
And i need it to destroy original message, and replace it with my "custom" one.
Help!

Last edited by Lure.d; 02-22-2010 at 13:30.
Lure.d is offline
Send a message via Skype™ to Lure.d
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-22-2010 , 13:21   Re: custom say text :)
Reply With Quote #2

PHP Code:
public c_say(id) {
    new 
say_content[150],name[32];
 
    
read_args(say_contentsizeof(say_content));
    
remove_quotes(say_content);
    
get_user_name(idnamesizeof(name) - 1);
 
    
format(say_content191"[%s] %s: %s",tag,name,say_content);
    
message_begin(MSG_ONEcSay_id);
    
write_byte(id);
    
write_string(say_content);
    
message_end();
 
    return 
PLUGIN_HANDLED;

Also fixed name[].
__________________
hleV is offline
Lure.d
BANNED
Join Date: Dec 2009
Location: Lithuania->USA
Old 02-22-2010 , 13:24   Re: custom say text :)
Reply With Quote #3

thanks! im still a "rookie" of amxx
LTU: Dekui, dar tik pradmenis++ moku tai daug dar mokintis reikia

EDIT:
Yeah i should do it, forgot that arrays start at 0 but you know i HAVE a little surprise for my new plugin,
so thats why i need certainly 31 in lenght of name.
Anyways thanks, the return of plugin_handled is working.

Last edited by Lure.d; 02-22-2010 at 13:30.
Lure.d is offline
Send a message via Skype™ to Lure.d
Reply


Thread Tools
Display Modes

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 02:20.


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