Toggled by someone saying a certain word.
Ok, this is what I need help on. (Probably a noobish question, I am new so..)
When someone says "blank" in chat, how would I get it to print something in chat to all the players. (PrintToChatAll) I have: RegConsoleCmd("say", Command_Say) RegConsoleCmd("say_team", Command_Say) How would i get that to work out? I got it to print that to chat when the map starts, but how would I make it so that when a person says "blank". Thanks. |
Re: Toggled by someone saying a certain word.
You could probably register "say blank" or if you mean he can say it anywhere in the chat line then you will have to register it like you have it and check if what was said contains the word "blank".
Also, your request is for SourceMod :). SourceMod section is below AMX Mod X section (this section). |
Re: Toggled by someone saying a certain word.
I think he wants that if someone types "blank" in a sentence. If so, register the "say" cmd and if you want, also the "say_team" cmd.
Then at ur function read the args, and use contain(). Be aware, false == -1 |
Re: Toggled by someone saying a certain word.
Quote:
|
Re: Toggled by someone saying a certain word.
Quote:
Still it would be the same way. |
Re: Toggled by someone saying a certain word.
Oh, srry guys. I clicked Scripting on AMX instead of Scripting on Sourcemod. Uhm. Could a moderator, or someone who can, move it to sourcemod > scripting please.
Alright, ill check StrContains out. |
Re: Toggled by someone saying a certain word.
Alright. On the API site, It says this for StrContains:
Quote:
And, I would put that If, in the Command_Say, right? [public Action:Command_Say(client, args)] Thanks. |
Re: Toggled by someone saying a certain word.
I'm not sure about the rest, but to do the StrContains:
PHP Code:
|
Re: Toggled by someone saying a certain word.
It comes up with an error, that says: Undefined symbol "msg". Is there something I should have changed from your example? (Again, im new.)
|
Re: Toggled by someone saying a certain word.
Quote:
Remember you are talking with AMX'ers :). Code:
if( StrContains(your_string_var_here, "blank", false) != -1 ) |
| All times are GMT -4. The time now is 14:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.