CLEO Help My code not working

CLEO related
Status
Not open for further replies.

Shakira

Active member
Joined
Jul 11, 2014
Messages
191
Reaction score
0
[font=Consolas,][font=Consolas,][font=Consolas,][font=Consolas,][size=small][font=Consolas,]{$CLEO .CS }[/font][/font][/font][/font][/font][/size]
[font=Consolas,]0000:[/font]
[font=Consolas,]wait[/font][font=Consolas,] [/font][font=Consolas,]3000[/font]
[font=Consolas,]0B34: samp register_client_command [/font][font=Consolas,]"check"[/font][font=Consolas,] to_label[/font][font=Consolas,] @AsIntege[/font]

[font=Consolas,]0B34: samp register_client_command [/font][font=Consolas,]"disable"[/font][font=Consolas,] to_label[/font][font=Consolas,] @disable[/font]
[font=Consolas,]while[/font][font=Consolas,] [/font][font=Consolas,]true[/font]

[font=Consolas,]    [/font][font=Consolas,]wait[/font][font=Consolas,] [/font][font=Consolas,]0[/font]
[font=Consolas,]    [/font][font=Consolas,]if[/font][font=Consolas,] [/font][font=Consolas,]1@[/font][font=Consolas,] == [/font][font=Consolas,]1[/font]
[font=Consolas,]    [/font][font=Consolas,]then[/font]
[font=Consolas,]    0B35: samp [/font][font=Consolas,]2@[/font][font=Consolas,] = get_last_command_params[/font]
[font=Consolas,]    [/font][font=Consolas,]if[/font]
[font=Consolas,]0AD4: 0AD4: [/font][font=Consolas,]2@[/font][font=Consolas,] = scan_string [/font][font=Consolas,]3@[/font][font=Consolas,] format [/font][font=Consolas,]"%f%f%f"[/font][font=Consolas,] [/font][font=Consolas,]7@[/font][font=Consolas,] [/font][font=Consolas,]8@[/font][font=Consolas,] [/font][font=Consolas,]9@[/font]
[font=Consolas,]then[/font]

[font=Consolas,]018A: [/font][font=Consolas,]10@[/font][font=Consolas,] = create_checkpoint_at: [/font][font=Consolas,]7@[/font][font=Consolas,] [/font][font=Consolas,]8@[/font][font=Consolas,] [/font][font=Consolas,]9@[/font]
[font=Consolas,]03BC: [/font][font=Consolas,]11@[/font][font=Consolas,] = create_sphere_at [/font][font=Consolas,]7@[/font][font=Consolas,] [/font][font=Consolas,]8@[/font][font=Consolas,] [/font][font=Consolas,]9@[/font][font=Consolas,]  radius [/font][font=Consolas,]3.0[/font]
[font=Consolas,]    [/font][font=Consolas,]1@[/font][font=Consolas,] = [/font][font=Consolas,]0[/font]
[font=Consolas,]end[/font]
[font=Consolas,]end[/font]
[font=Consolas,]end[/font]

[font=Consolas,]:AsInteger[/font]
[font=Consolas,]1@[/font][font=Consolas,]=[/font][font=Consolas,]1[/font]
[font=Consolas,]wait[/font][font=Consolas,] [/font][font=Consolas,]500[/font]
[font=Consolas,]00BA: text_styled [/font][font=Consolas,]'Created'[/font][font=Consolas,] [/font][font=Consolas,]5000[/font][font=Consolas,] ms [/font][font=Consolas,]1[/font]
[font=Consolas,]samp.CmdRet()[/font]

[font=Consolas,]:disable[/font]
[font=Consolas,]Marker.Disable([/font][font=Consolas,]10@[/font][font=Consolas,])[/font]
[font=Consolas,][font=Consolas,][font=Consolas,][font=Consolas,][size=small][font=Consolas,]samp.cmdret()[/font]

[/font][/font][/font]
[/font][/size]

[font=Consolas,][font=Consolas,][font=Consolas,][font=Consolas,]hope someone fix it[/font][/font][/font][/font]
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
hi, you could check this one​
Code:
0000:
wait 3000
0B34: samp register_client_command "check" to_label @AsInteger

0B34: samp register_client_command "disable" to_label @disable

while true
wait 0
    if 1@ == 1
    then
    wait 500
    1@ = 0
    0B35: samp 2@ = get_last_command_params
        if 0AD4: 0AD4: 2@ = scan_string 3@ format "%f %f %f" 7@ 8@ 9@
        then        
        018A: 10@ = create_checkpoint_at: 7@ 8@ 9@
        03BC: 11@ = create_sphere_at 7@ 8@ 9@  radius 3.0
        end
    end
end

:AsInteger
1@=1
00BA: text_styled 'Created' 5000 ms 1
samp.CmdRet()

:disable
Marker.Disable(10@)
samp.cmdret()


[font=Monaco, Consolas, Courier, monospace]Changed "%f%f%f" into "%[font=Monaco, Consolas, Courier, monospace]f %f %f" because otherwise you'd have to input commands like: /check 1.12.23.3 which could be not working[/font][/font]
 

Shakira

Active member
Joined
Jul 11, 2014
Messages
191
Reaction score
0
monday said:
hi, you could check this one​
Code:
0000:
wait 3000
0B34: samp register_client_command "check" to_label @AsInteger

0B34: samp register_client_command "disable" to_label @disable

while true
wait 0
    if 1@ == 1
    then
    wait 500
    1@ = 0
    0B35: samp 2@ = get_last_command_params
        if 0AD4: 0AD4: 2@ = scan_string 3@ format "%f %f %f" 7@ 8@ 9@
        then        
        018A: 10@ = create_checkpoint_at: 7@ 8@ 9@
        03BC: 11@ = create_sphere_at 7@ 8@ 9@  radius 3.0
        end
    end
end

:AsInteger
1@=1
00BA: text_styled 'Created' 5000 ms 1
samp.CmdRet()

:disable
Marker.Disable(10@)
samp.cmdret()


[font=Monaco, Consolas, Courier, monospace]Changed "%f%f%f" into "%[font=Monaco, Consolas, Courier, monospace]f %f %f" because otherwise you'd have to input commands like: /check 1.12.23.3 which could be not working[/font][/font]

Crash when i /check , i dont know how it works though I have tried many different plan :eek:hgodwhy:
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
if 0AD4: 0AD4: 2@ = scan_string 3@ format "%f %f %f" 7@ 8@ 9@
should be
if 0AD4: 3@ = scan_string 2@ format "%f %f %f" 7@ 8@ 9@

If it still doesn't work you could try moving "get last command params" into the AsInteger label, maybe it has to be used before "samp.cmdret" but that's just a guess
 

Shakira

Active member
Joined
Jul 11, 2014
Messages
191
Reaction score
0
monday said:
if 0AD4: 0AD4: 2@ = scan_string 3@ format "%f %f %f" 7@ 8@ 9@
should be
      if 0AD4: 3@ = scan_string 2@ format "%f %f %f" 7@ 8@ 9@

If it still doesn't work you could try moving "get last command params" into the AsInteger label, maybe it has to be used before "samp.cmdret" but that's just a guess

Yes it working now , but when i /check [font='Open Sans', Arial, sans-serif]379.8749, 2452.0374, 25.1396[/font][font='Open Sans', Arial, sans-serif], it does not show red dots in mini radar[/font]
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
you should use one of the icon opcodes, just type "icon" in the opcode search tool. To see icon list check sannybuilder->Help->Contents->SCM Documentation->GTA SA->Radar icons
 

Shakira

Active member
Joined
Jul 11, 2014
Messages
191
Reaction score
0
Code:
{$CLEO .CS }

0000:
wait 3000
0B34: samp register_client_command "check" to_label @AsInteger

0B34: samp register_client_command "disable" to_label @disable

while true
wait 0
   if 1@ == 1
   then
   wait 500
   1@ = 0
   0B35: samp 2@ = get_last_command_params
       if 0AD4: 3@ = scan_string 2@ format "%f %f %f" 7@ 8@ 9@
       then        
       10@ = Marker.CreateIconAndSphere(41, 7@, 8@, 9@)
       03BC: 11@ = create_sphere_at 7@ 8@ 9@  radius 3.0
       end
   end
end

:AsInteger
1@=1
00BA: text_styled 'Created' 5000 ms 1
samp.CmdRet()

:disable
Marker.Disable(10@)
samp.cmdret()
/check 490.7942, 2408.761, 28.9375 , and i can't see reds dot in radar  :-/
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
try
02A7: 10@ = create_icon_marker_and_sphere 41 at 7@ 8@ 9@
or
0570: 10@ = create_asset_radar_marker_with_icon 41 at 7@ 8@ 9@
or
Marker.CreateIconAndSphere(10@, 41, 7@, 8@, 9@)
 
Status
Not open for further replies.
Top