Jump to content

How Can I Keep The Engine Running On Any Plane/Helicopter? [OG Version]


ArmanCan

Recommended Posts

Hello my lovely modders and experts πŸ˜ƒ

Β 

We all know that if we exit any plane or helicopter the engine shutdown itself and i'm just wondering..

Β 

How can i keep the engine running right after exiting any plane or helicopter? It must be some kind of value in handling.cfg or a memory adress πŸ˜‰

Β 

Have a nice holiday and maybe have some fun with your vacation.. 😎

Link to comment
Share on other sites

have you tried these codes?

0825: set_helicopter 40@ instant_rotor_start
0918: set_car 34@ engine_operation 1
0ABF: set_car 0@ engine_state_to 1

Link to comment
Share on other sites

16 minutes ago, ZAZ said:

have you tried these codes?

well it seems i forgot to add this explanation to my request... i'm asking this for my main.scm or some files which i can do this change at the first place.. not as a custom mission or CLEO Script πŸ™‚

Link to comment
Share on other sites

You can have custom cleo script working on vehicles spawned outside the script. Just check if player is driving, then get the vehicle, check if it is helicopter and try mentioned opcodes.

Β 

{$CLEO .cs}

0000: nop

while true
    wait 0
    
    /*if
        056E: car 0@ defined // previously found heli
    then
        0918: set_car 0@ engine_operation 1
        0ABF: set_car 0@ engine_state_to 1 
    end*/
        
    
    if
        856D: not actor $PLAYER_ACTOR defined
    then
        continue
    end
    
    if
        84A9: not actor $PLAYER_ACTOR driving_heli
    then
        continue    
    end

    0811: 0@ = actor $PLAYER_ACTOR used_car
    0825: set_helicopter 0@ instant_rotor_start
end

Β 

Ok, engine keeps turning down, but instant rotor works. This way you do not have to wait so long before takeoff.

If that doesn't satisfy you, then you might try to write thortle value into vehicle's structure in memory.

Edited by MiranDMC
Link to comment
Share on other sites

8 hours ago, MiranDMC said:

If that doesn't satisfy you, then you might try to write thortle value into vehicle's structure in memory.

how can i find these adresses? I think writing some values by creating a CLEO Script may help me πŸ™‚

Β 

Edit: Your script worked really good.. i just need to develop a little bit to achieve my goal πŸ˜‰

Edited by ArmanCan
Link to comment
Share on other sites

I saw somewhere offsets to memory, but do not remember where. You can use Cheat Engine to find addresses and then compare it with pointer to vehicle to calculate offset.

Link to comment
Share on other sites

On 6/6/2023 at 10:28 PM, MiranDMC said:

You can use Cheat Engine to find addresses and then compare it with pointer to vehicle to calculate offset.

yes i'm expert enough to do this πŸ˜ƒ

Β 

anyway.. i combined your opcodes with @Den_spb s "Green Light" script..He has never mentioned about permission so here is the modified script of your opcodesΒ πŸ˜‰

Β 

Spoiler
{$CLEO}
0A8C: write_memory 0x49D6D5 size 4 value 0xFFFFFC77 virtual_protect 1
0A8C: write_memory 0x49D6ED size 4 value 0xFFFFFCAF virtual_protect 1
0A8C: write_memory 0x49D84B size 4 value 0xFFFFFB01 virtual_protect 1
0A8C: write_memory 0x49D863 size 4 value 0xFFFFFB39 virtual_protect 1
0A8C: write_memory 0x49D9CE size 4 value 0xFFFFF97E virtual_protect 1
0A8C: write_memory 0x49D9E4 size 4 value 0xFFFFF9B8 virtual_protect 1
0AC7: 0@ = var 1@ offset
0A8C: write_memory 0x49D379 size 4 value 0@ virtual_protect 1
0AC7: 0@ = var 2@ offset
0A8C: write_memory 0x49D3C9 size 4 value 0@ virtual_protect 1
while true
    wait 0
    if
        Player.Defined($PLAYER_CHAR)
    then
        if and
            actor.Driving($PLAYER_ACTOR)
            84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle
            84A7:   not actor $PLAYER_ACTOR driving_boat 
            89AE:   not actor $PLAYER_ACTOR driving_train
            //$ONMISSION == 0
        then
            03C0: 0@ = actor $PLAYER_ACTOR car 
            if or
                0122:   player $PLAYER_CHAR pressing_horn
                0ABD:   vehicle 0@ siren_on                
            then
                0174: 0@ = car 0@ Z_angle
                0AA7: call 0x49D4D0 num_params 1 pop 1 0@ 0@ // CTrafficLights_Get_Type_by_Z_angle
                if
                    0@ == 1 // WE
                then
                    1@ = 15000
                    2@ = 15000
                else // 0@ == 2  // NS
                    1@ = 5000
                    2@ = 10000
                end 
                continue    
            end
        end
    end
    01BD: 1@ = current_time_in_ms 
    01BD: 2@ = current_time_in_ms
    wait 0
    
    /*if
        056E: car 0@ defined // previously found heli
    then
        0918: set_car 0@ engine_operation 1
        0ABF: set_car 0@ engine_state_to 1 
    end*/
        
    
    if
        856D: not actor $PLAYER_ACTOR defined
    then
        continue
    end
    
    if
        //04AB: not actor $PLAYER_ACTOR driving_plane
        84A9: not actor $PLAYER_ACTOR driving_heli
    then
        continue    
    end

    0811: 3@ = actor $PLAYER_ACTOR used_car
    0825: set_helicopter 3@ instant_rotor_start
end

- Instant rotor start

- Press horn or activate sirens to turn traffic lights to green.. useful for some chase missions πŸ˜‰

Edited by ArmanCan
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.