Quote:
Originally Posted by Crackhead69
Is there a way tho to make it work without another public for that ?
Like this:
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 szArgs[ 192 ];
read_args( szArgs, charsmax( szArgs ) );
remove_quotes( szArgs );
client_print(id,print_chat,"%s",szArgs) // is it for debug?
set_user_health(id, str_to_num(szArgs))
}