CLEO Help Marker Help

CLEO related
Status
Not open for further replies.

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
Hello

So i'm using this..

04CE: 11@ = create_icon_marker_without_sphere 0 at 1@ 2@ 3@   

And i added plenty off them

and i tried to use this to remove them Marker.Disable(11@) 

But it only removes the last one i added.

Is there anyway to remove them all?

(I cant change this 11@)

Best wishes Spexx
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
You could store every marker handle upon creation in an array, then make a function to disable all.

Code:
for 0@ = 0 to MAX_MARKERS
  1@ = array MARKERS element 0@
  if Marker.Enabled(1@)
  then Marker.Disable(1@)
  end
end

Or, get marker pool addresses from mta/mod_sa, and do the same thing.
 

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
springfield link said:
You could store every marker handle upon creation in an array, then make a function to disable all.

Code:
for 0@ = 0 to MAX_MARKERS
  1@ = array MARKERS element 0@
  if Marker.Enabled(1@)
  then Marker.Disable(1@)
  end
end

Or, get marker pool addresses from mta/mod_sa, and do the same thing.


Tried to add Icons at Radar of players.. But it does not work somewhy, you know why? [member=111]springfield[/member]

:playerRadar_02
wait 0 
FOR 10@ = 0 TO 300
if                                                   
0B23:  samp is_player_connected 10@
jf @PlayerRadar_02
Print "Player connected" 200
0B2F: samp get_streamed_out_player_pos 10@ to 1@ 2@ 3@
04CE: 9@ = create_icon_marker_without_sphere 0 at 1@ 2@ 3@   
0C0E: 12@ = array 9@ element 10@
Print "Added marker" 200
wait 10
if
075C:  marker 12@ enabled   
jf @PlayerRadar_02 
Marker.Disable(12@) 
Jump @PlayerRadar_02
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
Idk, your code doesn't make sense. It's all gibberish.
Read here http://ugbase.eu/tutorials/sanny-builder-syntax/ on how to use for with iterations.
 

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
springfield link said:
Idk, your code doesn't make sense. It's all gibberish.
Read here http://ugbase.eu/tutorials/sanny-builder-syntax/ on how to use for with iterations.

Can you make it "work" for me then?  :eek:key:
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
Post your full code and we'll try to fix it, i won't make it from scratch for you.. this ain't the request section.  :sadpepe:
 

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
springfield link said:
Post your full code and we'll try to fix it, i won't make it from scratch for you.. this ain't the request section.  :sadpepe:

Yeah i post it. [member=111]springfield[/member]

It's not done yet, i just want this function that add marker ID 0 on players..

{$CLEO}

thread "Spexx" 




:playerRadar_01
wait 0
if
0B61:  samp is_local_player_spawned
jf @PlayerRadar_01         
jump @PlayerRadar_02





:playerRadar_02
wait 0 
FOR 10@ = 0 TO 300
if                                                   
0B23:  samp is_player_connected 10@
jf @PlayerRadar_02
Print "Player connected 1" 200
0B2F: samp get_streamed_out_player_pos 10@ to 1@ 2@ 3@
04CE: 9@ = create_icon_marker_without_sphere 0 at 1@ 2@ 3@   
0C0E: 12@ = array 9@ element 10@
Print "Added marker 5" 200
wait 10
if
075C:  marker 12@ enabled   
jf @PlayerRadar_02 
Marker.Disable(12@) 
Jump @PlayerRadar_02
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
273
You posted more shit, you should try and learn the basics of cleo scripting.
Those markers are made to be used with a static pos, gta has native functions for players markers.

Whatever, this is my take on it.
Code:
{$CLEO}
0000:

repeat
wait 400
until 0AFA:

alloc 31@ = 4096

WHILE TRUE
WAIT 0
    FOR 0@ = 0 to 1000
        if 0B23:  samp is_player_connected 0@
        jf continue
        
        if 0B20: 1@ = pedFromSAMPId 0@
        then Actor.StorePos(1@, 2@, 3@, 4@)
        else 0B2F: streamOut 0@ to 2@ 3@ 4@
        end
        
        if and
           8039: 2@ == 0.0
           8039: 3@ == 0.0
        jf continue
        
        5@ = Marker.CreateIconAndSphere(0, 2@, 3@, 4@)
        0C0F: array 31@ element 0@ = 5@
    END
    wait 0 //frameDelay
    call @remove_markers 1 31@
END


:remove_markers
FOR 1@ = 0 to 1000
    0C0E: 2@ = array 0@ element 1@
    if 075C: 2@
    then 0164: 2@
    end
END
RET 0
 

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
springfield link said:
You posted more shit, you should try and learn the basics of cleo scripting.
Those markers are made to be used with a static pos, gta has native functions for players markers.

Whatever, this is my take on it.
Code:
{$CLEO}
0000:

repeat
wait 400
until 0AFA:

alloc 31@ = 4096

WHILE TRUE
WAIT 0
    FOR 0@ = 0 to 1000
        if 0B23:  samp is_player_connected 0@
        jf continue
        
        if 0B20: 1@ = pedFromSAMPId 0@
        then Actor.StorePos(1@, 2@, 3@, 4@)
        else 0B2F: streamOut 0@ to 2@ 3@ 4@
        end
        
        if and
           8039: 2@ == 0.0
           8039: 3@ == 0.0
        jf continue
        
        5@ = Marker.CreateIconAndSphere(0, 2@, 3@, 4@)
        0C0F: array 31@ element 0@ = 5@
    END
    wait 0 //frameDelay
    call @remove_markers 1 31@
END


:remove_markers
FOR 1@ = 0 to 1000
    0C0E: 2@ = array 0@ element 1@
    if 075C: 2@
    then 0164: 2@
    end
END
RET 0

Very nice, Is there anyway to get rid of the blinking?
 
Status
Not open for further replies.
Top