AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   HandleSay and stuff (https://forums.alliedmods.net/showthread.php?t=26483)

NewUser 04-03-2006 00:05

HandleSay and stuff
 
I know how to do the HandleSay with containi statements, but not equali statements. The whole chat system isn't functioning now!

Code:
public HandleSay(id) {     new Speech[192];     read_args(Speech,191)     remove_quotes(Speech)             if(equali(Speech, "/Test"))     {         client_print(id,print_chat, "[Gaben] Testage.");         return PLUGIN_HANDLED;     }    return PLUGIN_HANDLED; }

I've also tried
Code:

if(equali(Speech, "/test") != -1)
But all that does is make anything you say, do that function... The chat system is still defiled anyhow.

Edit: There are no errors what so ever.

jtp10181 04-03-2006 00:22

if you return plugin_handled it cancels the chat that the plugin was looking at. Since the only thing you return is plugin_handled you are canceling all the chat.

capndurk 04-03-2006 00:23

Post your whole code, and does it print anything?

v3x 04-03-2006 00:48

Code:
return PLUGIN_CONTINUE;

capndurk 04-03-2006 00:53

Quote:

Originally Posted by v3x
Code:
return PLUGIN_CONTINUE;

I thought if you just returned PLUGIN_HANDLED in that type of function it would execute the commands before it, and not print the text that the user typed in, and if you returned CONTINUE, it would both execute the commands and print the text... Does it not execute the commands if you return HANDLED?

v3x 04-03-2006 01:23

He has "return PLUGIN_HANDLED" as the last return in that function so server chat would be totally disabled. Using my suggestion would fix this problem.

capndurk 04-03-2006 01:33

Quote:

Originally Posted by v3x
He has "return PLUGIN_HANDLED" as the last return in that function so server chat would be totally disabled. Using my suggestion would fix this problem.

oh, okay


All times are GMT -4. The time now is 16:40.

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