AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   button Y (https://forums.alliedmods.net/showthread.php?t=328097)

loiraolhosazul 10-26-2020 12:54

button Y
 
is there a hook to find out if the user presses Y?

already tried
PHP Code:

register_clcmd("messagemode""func"

dont work

r0ma 10-26-2020 20:00

Re: button Y
 
PHP Code:

public plugin_init() {
    
register_clcmd("nice_try""nice_try");
}

public 
nice_try(id) {
    new 
szBuffer[33];
    
    
read_args(szBuffercharsmax(szBuffer));
    
remove_quotes(szBuffer);
    
    
client_print(idprint_chat"messagemode -> %s"szBuffer);
    
    return 
PLUGIN_HANDLED;
}
//somewhere
client_cmd(id"messagemode nice_try"); 


fysiks 10-26-2020 20:26

Re: button Y
 
It is not possible to know which buttons have been pressed. You can only hook commands that are sent to the server. Specifically regarding messagemode, it is not a command that is sent to the server and therefore you cannot detect when it occurs. You can only detect when they hit enter and the command is sent to the server as the "say" command. You can hook "say" and then parse the data that is provided (i.e. the chat message text) and do what you want with it.

I expect that this isn't he answer you would like so if you want to solve your actual problem, you'll need to provide more details of what you are actually trying to do.


All times are GMT -4. The time now is 13:47.

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