[Client] Issue with " GetVehicleModModifierValue " Native

Native : GET_VEHICLE_MOD_MODIFIER_VALUE / GetVehicleModModifierValue

  1. Client (production/canary) and FXServer version :
  • Latest and tested on any branch (Release, beta…)
  1. Explanations :
GetVehicleModModifierValue(
	vehicle --[[ Vehicle ]], 
	modType --[[ integer ]], 
	modIndex --[[ integer ]]
)

This native is supposed to return a int value (modifier) that you can find in the carcols.meta of the defined model vehicle, but it doesn’t give the right value anymore (don’t know since when).

  1. An example :
    Let’s take the vehicle “Kamacho” available since mpchristmas2017, if i try the native with the vehicle like :
GetVehicleModModifierValue(
	myVehicle, 
	11, -- Being the VMT_ENGINE
	3, -- Being the max
)
It should return the modifier as in the files (carcols.meta from mpchristmas2017) : 400

Here is the file open on openIV for the Kamacho mpchristmas2017
image

But it does not return 400 anymore. i don’t know what’s the type returned but it would normally be a int from the modifier value.

This issue was happening since a while but using an old manifest version used to be enough, not anymore since a recent patch. So here is the right bug report.

Thanks for the help.

1 Like

A potential fix would be what i saw on another github (alloc8or) listing all gta5 natives : alloc8or

Here is the fix, it’s actually a int value and not a float one.

So here are some more test, using the code :

local veh = GetVehiclePedIsIn(GetPlayerPed(-1), false)

print("Type :")
print( type(GetVehicleModModifierValue(veh, 11, 0)) )

-- eVehicleModType - 11 = VMT_ENGINE
print("Engine :")
print( GetVehicleModModifierValue(veh, 11, 0) )
print( GetVehicleModModifierValue(veh, 11, 1) )
print( GetVehicleModModifierValue(veh, 11, 2) )
print( GetVehicleModModifierValue(veh, 11, 3) )

-- eVehicleModType - 12 = VMT_BRAKES
print("Brakes :")
print( GetVehicleModModifierValue(veh, 12, 0) )
print( GetVehicleModModifierValue(veh, 12, 1) )
print( GetVehicleModModifierValue(veh, 12, 2) )

It does return this numbers :

Type :
number
Engine :
7.0064923216241e-44
1.4012984643248e-43
2.8025969286496e-43
5.6051938572993e-43
Brakes :
3.503246160812e-44
7.0064923216241e-44
1.4012984643248e-43

So first of all, the type of the returned value is “number” when it should be an int.
But the main problem is the result, it’s not at all the right ones, not even close, looking at the files it should have return :

Type :
int
Engine :
50
100
200
400
Brakes :
25
50
100

Tested on cerulean version
Thanks for the help.

Lua will show number (same for js) if you want to get the actual type look at “RAW”

float GET_VEHICLE_MOD_MODIFIER_VALUE(Vehicle vehicle, int modType, int modIndex);

Is whats in the docs

Hello, it seems like today release update fixed it, “GetVehicleModModifierValue” now return the right value.