CLEO Help need help fixing this script

CLEO related

gonog

Member
Joined
Nov 12, 2021
Messages
6
Reaction score
0
Location
Afghanistan
Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03F0: enable_text_draw 1
wait 5000
13@ = 0

:Noname_11
wait 0
if and
0AB0: 75
0AB0: 51
then
    if 13@ == 1
    then
    13@ = 0
    else
    13@ = 1
    end
wait 500
end
if and
   Player.Defined($PLAYER_ACTOR)
   13@ == 1
else_jump @Noname_257
0A8D: 29@ = read_memory 12010652 size 4 virtual_protect 0
29@ += 4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
30@ = 0

:Noname_71
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
29@ += 1
if and
  31@ >= 0
  128 > 31@
else_jump @Noname_232
005A: 31@ += 30@ // (int)
15@ = Object.Model(31@)
Object.StorePos(31@, 1@, 2@, 3@)
0AB1: call_scm_func @Noname_264 3 1@ 2@ 3@ 4@ 5@
for 14@ = 321 to 397 step 1
    if or
    003B: 15@ == 14@
    0039: 15@ == 1240
    then
    0342: set_text_draw_centered 1
    081C: draw_text_outline 1 RGBA 0 0 0 255
    033F: set_text_draw_letter_size 0.3 1.0
    0340: set_text_draw_RGBA 0 255 0 255
    045A: draw_text_1number 4@ 5@ GXT 'NUMBER' number 15@  // ~1~
    end
end

for 29@ = 0 to 8
    0AB1: call_scm_func @GetIDbyIndex 1 29@ _ret 14@
    if or
    003B: 15@ == 14@
    0039: 15@ == 1240
    then
    0342: set_text_draw_centered 1
    081C: draw_text_outline 1 RGBA 0 0 0 255
    033F: set_text_draw_letter_size 0.3 1.0
    0340: set_text_draw_RGBA 0 255 0 255
    045A: draw_text_1number 4@ 5@ GXT 'NUMBER' number 15@  // ~1~
    end
end

:GetIDbyIndex  //3013 && 3016 && 1252 && 1310 && 1252 && 1550 && 1575 && 1650 && 1279 && 2058
    if 0@ == 0
    then
    31@ = 3013
    end
   
    if 0@ == 1
    then
    31@ = 3016
    end
   
    if 0@ == 2
    then
    31@ = 1252
    end
   
    if 0@ ==  3
    then
    31@ = 1310
    end
   
    if 0@ ==  4
    then
    31@ = 1550
    end
   
    if 0@ ==  5
    then
    31@ = 1575
    end
   
    if 0@ ==  6
    then
    31@ = 1650
    end
   
    if 0@ ==  7
    then
    31@ = 1279
    end
   
    if 0@ ==  8
    then
    31@ = 2058
    end
0AB2: ret 1 31@


:Noname_232
30@ += 256
  30@ > 89344
else_jump @Noname_71

:Noname_257
jump @Noname_11

:Noname_264
0AA7: call_function 7392816 num_params 6 pop 6 1 1 7@s 6@s 2@s 0@s 29@
0073: 2@ /= 6@ // (float)
0073: 2@ /= 4@ // (float)
0073: 3@ /= 7@ // (float)
0073: 3@ /= 4@ // (float)
2@ *= 640.0
3@ *= 448.0
0AB2: ret 2 2@ 3@


i found this old script from somewhere tried messing around with it but i cant get it to work as soon as i activate it, it crashes, problems might be at line 43, 48, 58, 116, or 135
 

gonog

Member
Joined
Nov 12, 2021
Messages
6
Reaction score
0
Location
Afghanistan
What it does?
It finds the nearest dropped items and places 3D text on them that can be seen from afar, making it easy to find the object(s) (items) like dayz srvr.

The code below requires sampfuncs and works well, but I tried to change it so that I could use it without sampfuncs.

As you can see, I'm not very good at it; if you could assist me in converting it, that would be greatly appreciated.


Code:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP
03F0: enable_text_draw 1
wait 5000
13@ = 0

:Noname_11
wait 0
if and
0AB0: 75
0AB0: 51
then
    if 13@ == 1
    then
    13@ = 0
    else
    13@ = 1
    end
wait 500
end
if and
   Player.Defined($PLAYER_ACTOR)
   13@ == 1
else_jump @Noname_257
0A8D: 29@ = read_memory 12010652 size 4 virtual_protect 0
29@ += 4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
30@ = 0

:Noname_71
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
29@ += 1
if and
  31@ >= 0
  128 > 31@
else_jump @Noname_232
005A: 31@ += 30@ // (int)
15@ = Object.Model(31@)
Object.StorePos(31@, 1@, 2@, 3@)
call @Noname_264 3 1@ 2@ 3@ 4@ 5@
for 14@ = 321 to 397 step 1
    if or
    003B: 15@ == 14@
    0039: 15@ == 1240
    then
    0342: set_text_draw_centered 1
    081C: draw_text_outline 1 RGBA 0 0 0 255
    033F: set_text_draw_letter_size 0.3 1.0
    0340: set_text_draw_RGBA 0 255 0 255
    045A: draw_text_1number 4@ 5@ GXT 'NUMBER' number 15@  // ~1~
    end
end

for 29@ = 0 to 8
    call @GetIDbyIndex 1 29@ _ret 14@
    if or
    003B: 15@ == 14@
    0039: 15@ == 1240
    then
    0342: set_text_draw_centered 1
    081C: draw_text_outline 1 RGBA 0 0 0 255
    033F: set_text_draw_letter_size 0.3 1.0
    0340: set_text_draw_RGBA 0 255 0 255
    045A: draw_text_1number 4@ 5@ GXT 'NUMBER' number 15@  // ~1~
    end
end

:GetIDbyIndex  //3013 && 3016 && 1252 && 1310 && 1252 && 1550 && 1575 && 1650 && 1279 && 2058
    if 0@ == 0
    then
    31@ = 3013
    end
    
    if 0@ == 1
    then
    31@ = 3016
    end
    
    if 0@ == 2
    then
    31@ = 1252
    end
    
    if 0@ ==  3
    then
    31@ = 1310
    end
    
    if 0@ ==  4
    then
    31@ = 1550
    end
    
    if 0@ ==  5
    then
    31@ = 1575
    end
    
    
    if 0@ ==  6
    then
    31@ = 1650
    end
    
    if 0@ ==  7
    then
    31@ = 1279
    end
    
    if 0@ ==  8
    then
    31@ = 2058
    end
ret 1 31@


:Noname_232
30@ += 256
  30@ > 89344
else_jump @Noname_71

:Noname_257
jump @Noname_11

:Noname_264
0AA7: call_function 7392816 num_params 6 pop 6 1 1 7@s 6@s 2@s 0@s 29@ 
0073: 2@ /= 6@ // (float)
0073: 2@ /= 4@ // (float)
0073: 3@ /= 7@ // (float)
0073: 3@ /= 4@ // (float)
2@ *= 640.0
3@ *= 448.0
ret 2 2@ 3@
 
Top