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

How to get what player is saying in chat?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Grovliom
Member
Join Date: Mar 2020
Location: somewhere in Serbia
Old 06-10-2020 , 08:35   How to get what player is saying in chat?
Reply With Quote #1

i already know about register_clcmd and register_concmd, but is there another way to get what player is saying, like input name and calculator, and not in plugin_init?

Last edited by Grovliom; 06-10-2020 at 08:35.
Grovliom is offline
thEsp
BANNED
Join Date: Aug 2017
Old 06-10-2020 , 09:28   Re: How to get what player is saying in chat?
Reply With Quote #2

If you're asking about the input (text) you type before you say something (a.k.a messagemode), then that's not possible.

Last edited by thEsp; 06-12-2020 at 18:50.
thEsp is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 06-10-2020 , 12:27   Re: How to get what player is saying in chat?
Reply With Quote #3

register_message(get_user_msgid("SayText"), "fw_saytext_message_hook");
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 06-10-2020 , 14:33   Re: How to get what player is saying in chat?
Reply With Quote #4

You can register the "say" command with "register_clcmd" and get the message in it with "read_args".
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
mahbodsr
Member
Join Date: Jun 2016
Old 06-12-2020 , 18:16   Re: How to get what player is saying in chat?
Reply With Quote #5

Quote:
Originally Posted by Grovliom View Post
i already know about register_clcmd and register_concmd, but is there another way to get what player is saying, like input name and calculator, and not in plugin_init?
try this:

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("BlaBla" "1.0" "MahBodSr")
    
register_clcmd"say" "handleSay" )
}

public 
handleSay()
{
    new 
msg[256]
    
read_argsmsg 255 // this is what client has written ( with Double-Qoutes at the beginning and end of string )
    
remove_quotesmsg // remove Double-Qoutes from the beggining and end of string


Last edited by mahbodsr; 06-12-2020 at 18:17.
mahbodsr 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 09:07.


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