Raised This Month: $ Target: $400
 0% 

[HELP] Player say message?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Guxi
Junior Member
Join Date: Aug 2014
Old 12-07-2014 , 10:37   [HELP] Player say message?
Reply With Quote #1

I need to take player's SAY message. For example;
Player write's a message on chat -> say: "!632" generally it's in this format: "!n"
I have to be able to recognize that number "n" / (e.g."632) ", how can i do that?
Since i'm not expecting a static message like "!command", but rather dynamic input such as "!n", but n can be any INT value.

Thank you for your time in advance!
Guxi is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 12-07-2014 , 10:57   Re: [HELP] Player say message?
Reply With Quote #2

You may catch the "say" or "say_team" command (or both). Then you read_args() with some string. The you can check if szArgs[0] == '!', and if so, get the rest after the ! mark. You can do it using the following string - szArgs[0].
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 12-07-2014 , 11:45   Re: [HELP] Player say message?
Reply With Quote #3

Code:
register_clcmd("say", "ClientCommandSay") register_clcmd("say_team", "ClientCommandSay") public ClientCommandSay(id) {     new PlayerMessage[192]     read_args(PlayerMessage, charsmax(PlayerMessage))     remove_quotes(PlayerMessage)         if(PlayerMessage[0] == '!')     {         format(PlayerMessage, charsmax(PlayerMessage), "%s", PlayerMessage[1])         new Number = str_to_num(PlayerMessage)     } }
Something like that..
__________________

Last edited by HamletEagle; 12-07-2014 at 11:49.
HamletEagle 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 15:20.


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