CLEO Help [HELP]how to get 2 or more string/integer

CLEO related
Status
Not open for further replies.

snaptrap

Active member
Joined
Feb 7, 2014
Messages
56
Reaction score
1
how to get 2 or more integer/string behind register command instead 1 like this /weapon 29 1000  :imoverit:    give me an example script
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Code:
0b34: "weapon" @WEAPON

while true
wait 0
end


:WEAPON
0B35: samp 0@ = get_last_command_params /
if 0AD4: 4@ = scan_string 0@ format "%d %d" 1@ 2@
then 01B2: give_actor $player_actor weapon 1@ ammo 2@ // Load the weapon model before
end
0B43: cmd_ret

When you type the command with parameters like /weap 24 999 this save as string, using 0AD4 you can check the string for intergers/hex/floats etc.

Like this, 0AD4: 4@ = scan_string 0@ format "%f %f %f" 1@ 2@ 3@ {/teleport 0.2111 -12.111 4.55}
 
Status
Not open for further replies.
Top