AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get what player is saying in chat? (https://forums.alliedmods.net/showthread.php?t=325157)

Grovliom 06-10-2020 08:35

How to get what player is saying in chat?
 
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?

thEsp 06-10-2020 09:28

Re: How to get what player is saying in chat?
 
If you're asking about the input (text) you type before you say something (a.k.a messagemode), then that's not possible.

Natsheh 06-10-2020 12:27

Re: How to get what player is saying in chat?
 
register_message(get_user_msgid("SayText"), "fw_saytext_message_hook");

OciXCrom 06-10-2020 14:33

Re: How to get what player is saying in chat?
 
You can register the "say" command with "register_clcmd" and get the message in it with "read_args".

mahbodsr 06-12-2020 18:16

Re: How to get what player is saying in chat?
 
Quote:

Originally Posted by Grovliom (Post 2704942)
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




All times are GMT -4. The time now is 17:09.

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