Raised This Month: $ Target: $400
 0% 

problem with say commands


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 05-03-2006 , 18:26   problem with say commands
Reply With Quote #1

hi i'm having a problem with say commands like
Code:
register_clcmd("say /test","test")
I made a test plugin
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "New Plug-In" #define VERSION "beta1" #define AUTHOR "wonsae" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say /test","test") } public test(id){     client_print(id,print_chat,"TestTEST!")     return PLUGIN_HANDLED }

but when i say /test it doens't do anything at all just shows /test as i said it
wonsae is offline
KoST
Senior Member
Join Date: Jul 2005
Old 05-03-2006 , 18:31  
Reply With Quote #2

im not sure, but i think
Code:
return PLUGIN_HANDLED
blocks the client_print
try:
Code:
return PLUGIN_CONTINUE
__________________
KoST is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 05-03-2006 , 18:37  
Reply With Quote #3

Nope it does the same thing
edit: not even console commands work now :\
wonsae is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-03-2006 , 20:11  
Reply With Quote #4

Code:
#include <amxmodx> public plugin_init() {   register_plugin("test" , "0.1" , "v3x");   register_clcmd("say" , "hook_say"); } public hook_say(id) {   new said[201];   read_args(said , 200);   remove_quotes(said);   if(equal(said , "/test"))   {     client_print(id , print_chat , "zomg gabster");     return PLUGIN_HANDLED; // block the text from appearing   }   return PLUGIN_CONTINUE; // let the rest of the text appear normally }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-04-2006 , 10:49  
Reply With Quote #5

wonsae: your code is fine, the problem is somewhere outside that
VEN is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 05-04-2006 , 17:57  
Reply With Quote #6

I know it's fine but it won't do anything
wonsae is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 05-04-2006 , 18:32  
Reply With Quote #7

@Wonsae: Your code is fine. Try disabling all your custom plugins and try again.

@V3X: That's off course another way, but he was asking why his code didn't work. Your code is more CPU-intensive too
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
organizedKaoS
Senior Member
Join Date: Feb 2006
Old 05-04-2006 , 19:46  
Reply With Quote #8

Code:
register_concmd("say /text", "cmdtext") public cmdtext(id) {      your code here }

This always seems to do the trick for me. Simple and all you have to do is input whatever you want into the public function tied to the say command. I have used PLUGIN_HANDLED in this type of function and it has not kept the function from running. Hope it helps you out.
organizedKaoS is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-04-2006 , 20:32  
Reply With Quote #9

My way is the proper way. Also, you can do more without needing to add more functions to hook other say commands
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 05-04-2006 , 20:33  
Reply With Quote #10

i dont know why, but when i was making something like this for my own uses, i had to go into console and type
Code:
say test
for some reason. but the hooksay that v3x posted makes it so you can just say test instead of going into console
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
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 05:09.


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