CLEO Help A help with Car name!

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: NOP

:DEFINE
WAIT 0
IF 
  00DF:   actor $PLAYER_ACTOR driving
  JF @DEFINE
  0811: 1@ = actor $PLAYER_ACTOR used_car
  0227: 2@ = car 1@ health
  0ADB: 3@v = car_model 1@ name
  02E3: 4@ = car 1@ speed
  GOTO @CAR

:CAR
WAIT 0
IF
  00DF:   actor $PLAYER_ACTOR driving
  JF @CAR 
  0ACC: show_text_lowpriority "Car You're using is %s" 3@v time 3000

END_THREAD
The crashes when i enter in the car and also then name of the car do not appear.
 

WaTTi

Well-known member
Joined
Jan 4, 2015
Messages
260
Reaction score
8
i did something like this a while ago, check it.
Code:
{$CLEO .cs}
0000: asd
WHILE TRUE
WAIT 0
    if or
    0ADC:   test_cheat "CNAME"
    0ADC:   test_cheat "CARRONOMBRE"
    0ADC:   test_cheat "NOMBRECARRO"
    then 
        if 28@ == 0
        then 
        28@ = 1
        03F0: enable_text_draw 1
        else 
        28@ = 0
        03F0: enable_text_draw 0
        end
    printf "[WaTTi] NombreAuto estado %d" 600 28@         
    end
    0A8D: 29@ = read_memory 0xB74494 size 4 virtual_protect 0
    29@ += 0x4
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    for 30@ = 0 to 27904 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@ // <- auto 31@
            if 28@ == 1
            then
                if and
                02CA:   car 31@ bounding_sphere_visible
                0202:   actor $PLAYER_ACTOR near_car 31@ radius 17.0 17.0 sphere 0
                then
                    00AA: store_car 31@ position_to 1@ 2@ 3@ 
                    0441: 6@ = car 31@ model                                                            
                    0ADB: 6@s = car_model 6@ name 
                    0AB1: call_scm_func @3dto2d 3 1@ 2@ 3@ 4@ 5@  
                    0342: set_text_draw_centered 1 
                    081C: draw_text_outline 1 RGBA 0 0 0 175 
                    0340: set_text_draw_RGBA 255 255 255 175 
                    033F: set_text_draw_letter_size 0.3 1.1 
                    033E: set_draw_text_position 4@ 5@ GXT 6@s  
                end 
            end
        END            
    END
END 

:3dto2d
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) 
0013: 2@ *= 640.0 
0013: 3@ *= 448.0 
ret 2 2@ 3@
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
If you're going to use 3@v then you can't use 4@, 5@ and 6@ variables anywhere in the script, start with 7@
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Husnain said:
Nothing Working. Anyone else can??

PHP:
{$CLEO .cs}
0000:


WHILE TRUE
    WAIT 0
    IF
    00DF:   actor $PLAYER_ACTOR driving //check if we are in a car
    THEN
        0AC8: 4@ = allocate_memory_size 64 // Memory for the string, 64bytes

        03C0: 1@ = actor $PLAYER_ACTOR car  // Get the handle of our car
        0227: 2@ = car 1@ health        // Get the Health of our car
        0441: 3@ = car 1@ model // You forgot this -> gets the MODEL of our car
        0ADB: 4@ = car_model 3@ name // and this then gets the model name
        02E3: 5@ = car 1@ speed   // get speed
        
        0AD1: show_formatted_text_highpriority "~r~Name:~w~ %s~n~~r~Speed:~w~ %0.1f~n~~r~Health:~w~ %0.1f" time 100 4@ 5@ 2@
        0AC9: free_allocated_memory 4@ // release the memory 
    END
END
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
Strange! Your snippet do not crashes my game but the speed of car in float and health and name of car is not appearing. Can you fix this??
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
{$CLEO .cs}
0000:


WHILE TRUE
WAIT 0
IF
00DF: actor $PLAYER_ACTOR driving //check if we are in a car
THEN
0AC8: 4@ = allocate_memory_size 64 // Memory for the string, 64bytes

03C0: 1@ = actor $PLAYER_ACTOR car // Get the handle of our car
0227: 2@ = car 1@ health // Get the Health of our car
0441: 3@ = car 1@ model // You forgot this -> gets the MODEL of our car
0ADB: 4@ = car_model 3@ name // and this then gets the model name
02E3: 5@ = car 1@ speed // get speed

0AD1: show_formatted_text_highpriority "~r~Name:~w~ %s~n~~r~Speed:~w~ %0.1f" time 100 4@ 5@
0AC9: free_allocated_memory 4@ // release the memory
END
END
 

bladero

Active member
Joined
Jan 3, 2017
Messages
73
Reaction score
0
It works just get in sanny builder open tools then options then go to formats and find case converting and click on As is.
 

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
OMG! It's working! Thank you bladero and thank you Opcode.ExE for your assistance. I appreciate your all support.
 

bladero

Active member
Joined
Jan 3, 2017
Messages
73
Reaction score
0
Because u need to get it in the text and refer it to the variable

Code:
{$CLEO .cs}
0000:


WHILE TRUE
WAIT 0
IF
00DF: actor $PLAYER_ACTOR driving //check if we are in a car
THEN
0AC8: 4@ = allocate_memory_size 64 // Memory for the string, 64bytes

03C0: 1@ = actor $PLAYER_ACTOR car // Get the handle of our car
0227: 2@ = car 1@ health // Get the Health of our car
0441: 3@ = car 1@ model // You forgot this -> gets the MODEL of our car
0ADB: 4@ = car_model 3@ name // and this then gets the model name
02E3: 5@ = car 1@ speed // get speed

0AD1: show_formatted_text_highpriority "~r~Name:~w~ %s~n~~r~Speed:~w~ %0.1f~n~~r~Health:~w~ %d" time 100 4@ 5@ 2@
0AC9: free_allocated_memory 4@ // release the memory 
END
END

Here u go
 
Status
Not open for further replies.
Top