View Single Post
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 04-09-2021 , 11:04   Re: Force client into messagemode say
Reply With Quote #8

Quote:
Originally Posted by Crackhead69 View Post
Is there a way tho to make it work without another public for that ?
Like this:
PHP Code:
//some code... 
To make it continue to the rest of code only when he has first typed something
No way. (I think you know all this without me...) (fysiks said what u need to do)
PHP Code:
public plugin_init() {
    
// Here u are hooking if some player typed "/num" in the chat.
    // When someone types "/num", the "test(id)" function will start.
    
register_clcmd("say /num","test")

    
register_clcmd("test2","function_to_run")
    
// "test2" is command that will be shown in messagemode
    // (note: afaik only actual commands can be used in messagemode or u will get "unknown command" error,
    // so u can't use messagemode without some command.
    // if u will not add some command then u can't operate on inputted arguments)
}

public 
test(id) {
    
// as u added "test2" command, u can use "messagemode" now
    
client_cmd(id"messagemode test2");
}

public 
function_to_run(id){
    
// here u are getting arguments entered for "test2" command
    
new szArgs192 ];
    
read_argsszArgscharsmaxszArgs ) );
    
remove_quotesszArgs ); 
    
    
client_print(id,print_chat,"%s",szArgs// is it for debug?
    
set_user_health(idstr_to_num(szArgs))

Spoiler

Last edited by kww; 04-09-2021 at 11:20.
kww is offline