Help Cleo - SAMPFUNCS | How to create command arguments

pwpwpwn

Member
Joined
May 4, 2024
Messages
19
Reaction score
0
I know how to create a command, all good. But how to create arguments in command?
For example how to make a simple command like this:
CMD: /say [nickname]
Use: /say george and to print in samp chat: hello george!

Thank you!
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,288
Solutions
6
Reaction score
929
Location
Lithuania
PHP:
{$CLEO .cs}

0000:

REPEAT
WAIT 0
UNTIL 0AFA:

0B34: samp register_client_command "say" to_label @cmd_mycmd

WHILE TRUE
WAIT 0
END


:cmd_mycmd
0B35: samp 31@ = get_last_command_params
IF 0AD4: $NOT_USED = scan_string 31@ format "%s" 30@
THEN
    0AF9: samp say_msg "Hello %s!" 30@
END
0B43: samp cmd_ret
 
Top