CLEO Help Trucks & Trailers

CLEO related
Status
Not open for further replies.

Mozz

Active member
Joined
Jan 9, 2014
Messages
35
Reaction score
0
Hey! Is there any way to force keep the truck's trailer attached? I want it to work with opcode's carrec. Thanks.
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
I found this on another site, but i don't know how to use and if it works like you want. Wait or tell this to a moderator.

Code:
:GetTrailerAttachedToCar
{
Parameters:
   Passed:
     0@ - Car handle
   Result:
     1@ - Attached trailer handle

Example:
   if 0AB1: call_scm_func @GetTrailerAttachedToCar 1 from car 0@ store_to 1@ // IF and SET
}
0A8D: 3@ = read_memory 0xB74494 size 4 virtual_protect 0 
000A: 3@ += 0x4 
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 0 
for 1@ = 0x0 to 0x6D00 step 0x100
    0A8D: 2@ = read_memory 3@ size 1 virtual_protect 0 
    000A: 3@ += 0x1
    if and
        0029:   2@ >= 0x0
        001B:   0x80 > 2@ 
    then
        005A: 2@ += 1@ // (int) 
        if 
            07AB:   car 0@ has_attached_trailer 2@ 
        then
            0485: return_true
            break
        end
    end 
end
0AB2: ret 1 2@

OR

Code:
:GetTrailerAttachedToCar
{
Parameters:
   Passed:
     0@ - Car handle
   Result:
     1@ - Attached trailer handle

Example:
   if 0AB1: call_scm_func @GetTrailerAttachedToCar 1 from car 0@ store_to 1@
}
0A97: 1@ = car 0@ struct
1@ += 1224
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
    if
    not 1@ == 0
    then
    0AEB: 1@ = car_struct 1@ handle
    0485: return_true
    end
0AB2: ret 1 1@

OR use s0beit with Keep trailer attached, i don't know if it's working or not, i don't use that but i know there is something like that.
 
  • Like
Reactions: Zin

Mozz

Active member
Joined
Jan 9, 2014
Messages
35
Reaction score
0
pepeelpubero link said:
I found this on another site, but i don't know how to use and if it works like you want. Wait or tell this to a moderator.

Code:
:GetTrailerAttachedToCar
{
Parameters:
   Passed:
     0@ - Car handle
   Result:
     1@ - Attached trailer handle

Example:
   if 0AB1: call_scm_func @GetTrailerAttachedToCar 1 from car 0@ store_to 1@ // IF and SET
}
0A8D: 3@ = read_memory 0xB74494 size 4 virtual_protect 0 
000A: 3@ += 0x4 
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 0 
for 1@ = 0x0 to 0x6D00 step 0x100
    0A8D: 2@ = read_memory 3@ size 1 virtual_protect 0 
    000A: 3@ += 0x1
    if and
        0029:   2@ >= 0x0
        001B:   0x80 > 2@ 
    then
        005A: 2@ += 1@ // (int) 
        if 
            07AB:   car 0@ has_attached_trailer 2@ 
        then
            0485: return_true
            break
        end
    end 
end
0AB2: ret 1 2@

OR

Code:
:GetTrailerAttachedToCar
{
Parameters:
   Passed:
     0@ - Car handle
   Result:
     1@ - Attached trailer handle

Example:
   if 0AB1: call_scm_func @GetTrailerAttachedToCar 1 from car 0@ store_to 1@
}
0A97: 1@ = car 0@ struct
1@ += 1224
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
    if
    not 1@ == 0
    then
    0AEB: 1@ = car_struct 1@ handle
    0485: return_true
    end
0AB2: ret 1 1@

OR use s0beit with Keep trailer attached, i don't know if it's working or not, i don't use that but i know there is something like that.

Thanks. Not sure how to try this. Do I have to put it all in a .cs file or just the example? e.e
 

re]b0ot_

Active member
Joined
Jul 10, 2014
Messages
25
Reaction score
0
pepeelpubero link said:
I found this on another site, but i don't know how to use and if it works like you want. Wait or tell this to a moderator.

Code:
:GetTrailerAttachedToCar
{
Parameters:
   Passed:
     0@ - Car handle
   Result:
     1@ - Attached trailer handle

Example:
   if 0AB1: call_scm_func @GetTrailerAttachedToCar 1 from car 0@ store_to 1@ // IF and SET
}
0A8D: 3@ = read_memory 0xB74494 size 4 virtual_protect 0 
000A: 3@ += 0x4 
0A8D: 3@ = read_memory 3@ size 4 virtual_protect 0 
for 1@ = 0x0 to 0x6D00 step 0x100
    0A8D: 2@ = read_memory 3@ size 1 virtual_protect 0 
    000A: 3@ += 0x1
    if and
        0029:   2@ >= 0x0
        001B:   0x80 > 2@ 
    then
        005A: 2@ += 1@ // (int) 
        if 
            07AB:   car 0@ has_attached_trailer 2@ 
        then
            0485: return_true
            break
        end
    end 
end
0AB2: ret 1 2@

OR

Code:
:GetTrailerAttachedToCar
{
Parameters:
   Passed:
     0@ - Car handle
   Result:
     1@ - Attached trailer handle

Example:
   if 0AB1: call_scm_func @GetTrailerAttachedToCar 1 from car 0@ store_to 1@
}
0A97: 1@ = car 0@ struct
1@ += 1224
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
    if
    not 1@ == 0
    then
    0AEB: 1@ = car_struct 1@ handle
    0485: return_true
    end
0AB2: ret 1 1@

OR use s0beit with Keep trailer attached, i don't know if it's working or not, i don't use that but i know there is something like that.
That function returns the attached trailer ID, lemme try find one.
 

Mozz

Active member
Joined
Jan 9, 2014
Messages
35
Reaction score
0
Well, on the server I want to use this, I'll always have the same trailer (which means same ID all the time). In fact, I don't think I can even use another one.
 
Status
Not open for further replies.
Top