CLEO Help [Help] Trailer Attach Cleo

CLEO related
Status
Not open for further replies.

Blaconix_x

Member
Joined
Jul 1, 2015
Messages
8
Reaction score
0
I know 0 about cleo coding but I tried to make a script that attaches the nearest trailer. It doesn't really work, if I remove the check for the car model it just attaches my car to my car. Are trailers considered cars?

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

//-------------MAIN---------------
thread "TRAILER_ATTACH" 

:ATTACH_10
wait 0 
if 
00DF:   actor $PLAYER_ACTOR driving  
    Actor.Driving($PLAYER_ACTOR)

:ATTACH_28
wait 0 
if and 
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 8.0 0.0 
key_down 220 
else_jump @ATTACH_10 
if and
0AE2: $CAR = random_vehicle_near_point 1@ 2@ 3@ in_radius 10.0 find_next 0 pass_wrecked 0 //IF and SET
0137: car $CAR id == 435
else_jump @ATTACH_10
03C0: $2197 = actor $PLAYER_ACTOR car  
0683: attach_car $CAR to_car $2197 with_offset 0.0 -4.6 0.65 rotation 15.0 0.0 0.0
wait 500 
jump @ATTACH_28


Thanks!
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Get the car handle and the trailer handle, use opcode
Code:
0893: put_trailer 37@ on_cab 34@
you might need to sync with the trailer before using this opcode.
 

Blaconix_x

Member
Joined
Jul 1, 2015
Messages
8
Reaction score
0
What do you mean sync with the trailer?
I tried the cleo but it only works 1 time lol.

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

//-------------MAIN---------------
thread "TRAILER_ATTACH" 

:ATTACH_10
wait 0 
if 
00DF:   actor $PLAYER_ACTOR driving  
    Actor.Driving($PLAYER_ACTOR)

:ATTACH_28
wait 0 
if and 
04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 8.0 0.0 
key_down 220 
else_jump @ATTACH_10 
if and
0AE2: $CAR = random_vehicle_near_point 1@ 2@ 3@ in_radius 10.0 find_next 0 pass_wrecked 0 //IF and SET
0137: car $CAR id == 435
else_jump @ATTACH_10
03C0: $2197 = actor $PLAYER_ACTOR car
0893: put_trailer $CAR on_cab $2197  
//0683: attach_car $CAR to_car $2197 with_offset 0.0 -4.6 0.65 rotation 15.0 0.0 0.0
wait 500 
jump @ATTACH_28
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Code:
{$CLEO .cs}
thread "TRAILER_ATTACH" 

:ATTACH_10
wait 0 
if Actor.Driving($PLAYER_ACTOR)
jf @ATTACH_10

:ATTACH_28
wait 0 
if and 
    04C4: store_coords_to 1@ 2@ 3@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0 
    key_down 220 
jf @ATTACH_10 
0AE2: 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 50.0 find_next 0 pass_wrecked 1
if and
    0@ <> -1
    0137: car 0@ id == 435
jf @ATTACH_10
    03C0: 1@ = actor $PLAYER_ACTOR car
    0893: put_trailer 0@ on_cab 1@  
    wait 500 
jump @ATTACH_10
 
Status
Not open for further replies.
Top