Access memory in LUA

Hello,

Is there a way to access memory in LUA like in C ?

Cheers

Can you explain what you would like to do?

I would like to set the current gear on a vehicle.
Unfortunately there’s no Native for it so the only way around would be to set it directly via the memory

What do you mean setting the gear? There is almost certainly a native to handle this.

I found these natives, look harder next time xD

SET_VEHICLE_HIGH_GEAR
https://runtime.fivem.net/doc/reference.html#_0x20b1b3e6

just test it out im guessing it would be like

SetVehicleHighGear(vehicle, float gear)

so you would do

vehicle = GetVehiclePedIsIn(PlayerId()) (dont think that is the correct native but hopefully u get what i mean)

SetVehicleHighGear(vehicle, 2)

There is no actual gear setting native.

This is not what he was looking for. So maybe you should read a little harder next time?

SetVehicleHighGear(vehicle, float gear)

smh

This could help. [Discussion/Research] Manual transmission resource

No, there is not. And even in c# this is not available for FiveM resources.

SetVehicleHighGear(véhicule, gear) 

Only sets the highest gear possible for the vehicle, not the current gear… I’ve done some testing before posting :sweat_smile:

Take a look at Syntasu’s topic. The link that @Ascaped posted.
The process to be able to shift is harder, it’s not just using a native.

I did testing with different scripts during 4h yesterday :sweat_smile:
The problem with current Manual Transmission mod is that they don’t actually use native gears.
They simulate it with a combination of torque, rpm etc… So I wanted to know if it was possible to use native gears. (like some mods on GTA5mods.net do)

Don’t think it’s possible, otherwiese they should go with the easy way.

Thank you for your answer

1 Like