CLEO Help Can this be converted so it can be used without samp funcs

CLEO related

gonog

Member
Joined
Nov 12, 2021
Messages
6
Reaction score
0
Location
Afghanistan
Title, this is the script which requires samp funcs, can this be converted so that it can be used without samp funcs.

C++:
// 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@


the script in the spoiler is the script that i tried to create myself, however as you can see i am bad at it. It crashes as soon as I activate it, any help would be rly 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@)
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@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
There's zero SAMPFUNS in this code...
If you getting any errors by trying compile it , make sure that you changed SHORTCUTS like:
CALL , RET etc..
 

gonog

Member
Joined
Nov 12, 2021
Messages
6
Reaction score
0
Location
Afghanistan
There's zero SAMPFUNS in this code...
If you getting any errors by trying compile it , make sure that you changed SHORTCUTS like:
CALL , RET etc..
i have 0 knowledge of cleo scripting, i tried changing the shortcuts, u can see that in spoiler box, when i activated it ig it crashed
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
{$CLEO .cs}

0000: NOP

WAIT 8500

WHILE TRUE
    WAIT 0
 
IF 0256:   player $PLAYER_CHAR defined
THEN
    IF AND
    0AB0: 75 // K
    0AB0: 51 // 3
    THEN
        IF 13@ == 1
        THEN 13@ = 0
        ELSE 13@ = 1
        END
        WAIT 500 // ANTI KEY SPAM
    END
  
    IF 13@ == 1
    THEN
        0A8D: 29@ = read_memory 0xB7449C size 4 virtual_protect 0
        000A: 29@ += 0x4
        0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
        FOR 30@ = 0 TO 89344 step 0x100
            0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
            000A: 29@ += 0x1
            IF and
                0029:  31@ >= 0x00
                001B:  0x80 > 31@
            THEN
                005A: 31@ += 30@  
                IF and
                03CA:   object 31@ exists
                02CC:   object 31@ bounding_sphere_visible
                THEN
                    0984: 15@ = object 31@ model
                    01BB: store_object 31@ position_to 1@ 2@ 3@
                    0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X 1@ Y 2@ Z 3@ store_screen_X_to 4@ Y_to 5@
                    FOR 14@ = 321 TO 397 STEP 1
                        IF or
                        003B: 15@ == 14@
                        0039: 15@ == 1240
                        THEN          
                            03F0: enable_text_draw 1
                            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: @GetIDbyIndex 1 29@ _ret 14@
                        IF OR
                        003B: 15@ == 14@
                        0039: 15@ == 1240
                        THEN
                            03F0: enable_text_draw 1
                            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
                END
            END
        END
    END
END
              
END

//0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
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@

: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@
 
Last edited:
Top