CLEO Help Marker Help

CLEO related
Status
Not open for further replies.

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
Code:
{$CLEO .cs}

0000:

:Check
wait 0
0A8D: 5@ = read_memory 0xC7DEEA size 1 virtual_protect 0
if 
  5@ == 1
jf @Check
0ACD: "~g~Checkpoint Active" 2000
call @get_cp_pos 0 X 1@ Y 2@ Z 3@
02A8: 6@ = create_marker 56 2@ 3@ 4@


:get_cp_pos
IF 0AA2: 0@ = loadlib "samp.dll"
THEN 0A8E: 1@ = 0@ + 0x212A94
    0A8D: 1@ = readMem 1@ sz 4 vp 0
    1@ += 0xC
    0A8D: 2@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 3@ = readMem 1@ sz 4 vp 0
    1@ += 0x4
    0A8D: 4@ = readMem 1@ sz 4 vp 0
    0AA3: freelib 0@
END
0AB2: ret 3 2@ 3@ 4@
It creates a marker at the active checkpoint but it crashes every time. Please help me.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
@Husnain  What this memory do?.:
0xC7DEEA


@Husnain

[shcode=cpp]
{$CLEO .cs}

0000:

wait 10000

while true
wait 0

if
call @is_cp_active 0
then
printf "~g~Checkpoint Active" 2000
call @get_cp_pos 0 X 1@ Y 2@ Z 3@
0167: 4@ = create_marker_at 1@ 2@ 3@ color 0 flag 2
if or
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0
00ED: actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0 on_foot
then
0164: disable_marker 4@
end
end



:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485: return_true
ELSE 059A: return_false
END
0AA3: freelib 0@
0AB2: ret 0

:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@
[/shcode]
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
[shcode=cpp]
{$CLEO .cs}

0000:

wait 10000

while true
wait 0

if
call @is_cp_active 0
then
printf "~g~Checkpoint Active" 2000
call @get_cp_pos 0 X 1@ Y 2@ Z 3@
22@ = Marker.CreateIconAndSphere(41, 1@,2@,3@)
end

if or
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0
00ED: actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0 on_foot
then
Marker.Disable(22@)
end

end



:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485: return_true
ELSE 059A: return_false
END
0AA3: freelib 0@
0AB2: ret 0

:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@
[/shcode]
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
Alright after doing more your above script (first one) works but ^^ one does not and it is not removing the marker. Maybe because he keeps looping and creating markers on markers until the condition won't get true and when I come near to the point it does not remove. why? because it will remove the first marker not all so because of that loop. Can you fix it?
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
Husnain said:
Alright after doing more your above script (first one) works but ^^ one does not and it is not removing the marker. Maybe because he keeps looping and creating markers on markers until the condition won't get true and when I come near to the point it does not remove. why? because it will remove the first marker not all so because of that loop. Can you fix it?

If marker not removing do it with const
Soo, if u using Parazitas code try this

Code:
 {$CLEO .cs}
  
0000:
  
wait 10000

const
MarkerOn = 1
MarkerOff = 2
end 
  
while true
wait 0
  
if   
call @is_cp_active 0
then
    printf "~g~Checkpoint Active" 2000
    call @get_cp_pos 0 X 1@ Y 2@ Z 3@
    22@ = Marker.CreateIconAndSphere(41, 1@,2@,3@)
    7@ = MarkerOn
end
 
if and
7@ = MarkerOn
00EC:   actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0
then
    Marker.Disable(22@)
    7@ = MarkerOff
end
 
end
  
  
  
:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AA3: freelib 0@
0AB2: ret 0
  
:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
in the condition is_cp_active you could add 7@== marker_off, otherwise it will spam the same way making countless markers
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Ech... what so hard create imitate with enable / disable?

[shcode=cpp]
{$CLEO .cs}

0000:

wait 10000

const
CreateMaker = 1
StopCreateMaker = 2
end

31@ = CreateMaker

while true
wait 0

if and
31@ == CreateMaker
call @is_cp_active 0
then
printf "~g~Checkpoint Active" 2000
call @get_cp_pos 0 X 1@ Y 2@ Z 3@
22@ = Marker.CreateIconAndSphere(41, 1@,2@,3@)
31@ = StopCreateMaker
end

if or
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0
00ED: actor $PLAYER_ACTOR sphere 0 near_point 1@ 2@ radius 1.0 1.0 on_foot
then
if
31@ == StopCreateMaker
then
Marker.Disable(22@)
31@ = CreateMaker
end
end

end



:is_cp_active
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x24
0A8D: 1@ = readMem 1@ sz 4 vp 0
IF 1@ == TRUE
THEN 0485: return_true
ELSE 059A: return_false
END
0AA3: freelib 0@
0AB2: ret 0

:get_cp_pos
0AA2: 0@ = loadlib "samp.dll"
0A8E: 1@ = 0@ + 0x21A10C
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0xC
0A8D: 2@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 3@ = readMem 1@ sz 4 vp 0
1@ += 0x4
0A8D: 4@ = readMem 1@ sz 4 vp 0
0AA3: freelib 0@
0AB2: ret 3 2@ 3@ 4@
[/shcode]
 
Status
Not open for further replies.
Top