Hello guys,i need a cleo,when 1 type my command,he execute other,but with variables.
Example : When i type /s 3 5 7 9 [numbers is id of the player]
he take each number and add the command
when i type /s [ID1] [ID2] [ID3] [ID4]
He execute the commands :
/sellweapons ID1 EAGLE
/sellweapons ID2 eagle
/sellweapons ID3 eagle
/sellweapons ID4 eagle
How to make it
Example : When i type /s 3 5 7 9 [numbers is id of the player]
he take each number and add the command
Code:
{$CLEO .cs}
0000: NOP
if 0@ = SAMP.Base()
then
while not SAMP.Available()
wait 500
end
0B34: samp register_client_command "s" to_label @varma
else end_thread
end
while true
wait 0
end
:varma
0B35: samp 0@ = get_last_command_params
0C17: 1@ = strlen 0@
if not 1@ == 0
then
0ab1: @get_playerid_by_name 1 0@ 1@
0B36: samp 3@ = get_player_nickname 1@
0AF8: samp say_msg "/sellweapons %d eagle" 1@
else 0AF8: samp add_message_to_chat "invalid" color 0xFF6347
end
0B43: samp cmd_ret
:get_playerid_by_name
for 1@ = 0 to 1000
if SAMP.IsPlayerConnected(1@)
then
2@ = SAMP.GetPlayerNickname(1@)
if 0C14: strcmp string1 0@ string2 2@
then break
end
end
end
0ab2: 1 1@
when i type /s [ID1] [ID2] [ID3] [ID4]
He execute the commands :
/sellweapons ID1 EAGLE
/sellweapons ID2 eagle
/sellweapons ID3 eagle
/sellweapons ID4 eagle
How to make it