altv-issues icon indicating copy to clipboard operation
altv-issues copied to clipboard

Add getter & setter for various vehicle properties (huge list..)

Open DurtyFree opened this issue 5 years ago • 9 comments

Is your feature request related to a problem? Please describe. Currently it is not possible to get those vehicle properties / values. Those are needed to get complete control of a vehicles engine for example, so you could "script engine sounds" or set other properties that are used in vehicles dashboard etc.

Describe the solution you'd like I want getter & setter for following vehicle properties:

  • OilLevel (See FiveM)
  • FuelLevel (See FiveM)
  • Turbo (See ScriptHookVDotNet)
  • Clutch (See ScriptHookVDotNet)
  • Throttle (See FiveM)
  • BrakePower (See FiveM)
  • ThrottlePower (See FiveM)
  • CurrentRPM (getter already exist-> alt.Player.local.vehicle.rpm, see FiveM)
  • SteeringAngle (See FiveM)
  • SteeringScale (See FiveM)
  • Gears (See ScriptHookVDotNet)
  • HighGear (See FiveM)
  • NextGear (See FiveM)
  • GravityAmount (See FiveM)
  • CurrentGear (getter already exist-> alt.Player.local.vehicle.gear, see FiveM)
  • IsLeftHeadLightBroken (native getter exists, see ScriptHookVDotNet)
  • IsRightHeadLightBroken (native getter exists, see ScriptHookVDotNet)
  • CanWheelsBreak (native getter exists, see ScriptHookVDotNet)
  • HeliEngineHealth (native getter exists, see ScriptHookVDotNet)
  • HeliMainRotorHealth (native getter exists, see ScriptHookVDotNet)
  • HeliTailRotorHealth (native getter exists, see ScriptHookVDotNet)
  • OppressorTransformationState (number between 0 -1 that indicates its current transformation state)
  • DeluxoTransformationState (number between 0 -1 that indicates its current transformation state)
  • EngineTemperature (See FiveM)

I want getter for following vehicle properties (those are mainly get only):

  • IndicatorLights (See FiveM)
  • OilVolume (See FiveM)
  • PetrolTankVolume (See FiveM)
  • IsEngineStarting (See FiveM)
  • WheelSpeed (See FiveM)
  • Acceleration (See FiveM)
  • HeliBladesSpeed (native setter exists) (See ScriptHookVDotNet)
  • IsInteriorLightOn (native setter exists) (See FiveM)
  • LightsMultiplier (native setter exists) (See ScriptHookVDotNet)
  • ProvidesCover (native setter exists) (See ScriptHookVDotNet)
  • EnginePowerMultiplier (native setter exists) (See FiveM)
  • ForkliftForkHeight (value between 0 & 1) (native setter exists http://natives.altv.mp/#/0x37EBBF3117BD6A25)
  • TowTruckArmPosition (value between 0 & 1) (native setter exists http://natives.altv.mp/#/0xFE54B92A344583CA)
  • BulldozerArmPosition (value between 0 & 1) (native setter exists http://natives.altv.mp/#/0xF8EBCCC96ADB9FB7)

Describe alternatives you've considered There is no alternative as you are not able to retrieve those values any other way.

Additional context These are the sources I used to retrieve the data: SHVDN has some memory offsets & patterns https://github.com/crosire/scripthookvdotnet/blob/7404127c162e7956b8b86b86fdc72a9aa9e44670/source/scripting_v3/GTA/Entities/Vehicles/Vehicle.cs Patterns for some values https://github.com/crosire/scripthookvdotnet/blob/7404127c162e7956b8b86b86fdc72a9aa9e44670/source/core/NativeMemory.cs#L148 Manual Transmissions mod has a lot of offsets & patterns: https://github.com/E66666666/GTAVManualTransmission/blob/c8e67ef29d36b949b34d9905e2ea00197e692cd8/Gears/Memory/VehicleExtensions.cpp https://github.com/E66666666/GTAVManualTransmission/blob/c93cd2bc0e16ad69ae86139391125fcdc34c1b5c/Gears/Memory/MemoryPatcher.cpp FiveM has also a lot of offsets & patterns: https://github.com/citizenfx/fivem/blob/master/code/components/extra-natives-five/src/VehicleExtraNatives.cpp

DurtyFree avatar Dec 26 '19 12:12 DurtyFree

Yes my friend, a very nice idea.

LameuleFR avatar Dec 26 '19 13:12 LameuleFR

I have updated the list & added getter / setter for deluxo & Oppressor transformation state, its also retrievable via memory -> a float value between 0 and 1 indicating current transformation state.

DurtyFree avatar Dec 26 '19 15:12 DurtyFree

Could we also add a getter for vehicle class to this @DurtyFree ?

lsvMoretti avatar Dec 29 '19 09:12 lsvMoretti

@lsvMoretti I think you can already get vehicle class with native getVehicleClassFromName http://natives.altv.mp/#/0xDEDF1C8BD47C2200

DurtyFree avatar Dec 29 '19 14:12 DurtyFree

Just enhancing this with this great source for some patterns and memory offsets: https://github.com/citizenfx/fivem/blob/master/code/components/extra-natives-five/src/VehicleExtraNatives.cpp

DurtyFree avatar Feb 22 '20 15:02 DurtyFree

Would make a great addition to vehicles. +1

jovanivanovic avatar Jul 28 '20 09:07 jovanivanovic

@ZackaryH8 Please explain in words what exact getters / setters

DurtyFree avatar Jan 31 '21 17:01 DurtyFree

These features should definitely come in 7.0.

Refikk avatar Nov 22 '21 20:11 Refikk

7.0 is already finished and 8.0 already have a huge list

C0kkie avatar Nov 22 '21 20:11 C0kkie