Open KnowWolf opened 1 year ago
So, there is a way already. All performance mods use modification numbers. So that portion of the script is in there.
It starts at about line 154 in the client lua. You'll need to find the right mod number by going here https://docs.fivem.net/natives/?_0x6AF0636DDEDCB6DD
however it shoudl look a little like this
if data.list.performance then
if type(data.list.performance) ~= "table" then
SetVehicleMod(veh, 11, GetNumVehicleMods(veh, 11)-1) -- Engine
SetVehicleMod(veh, 12, GetNumVehicleMods(veh, 12)-1) -- Brakes
SetVehicleMod(veh, 15, GetNumVehicleMods(veh, 15)-1) -- Suspension
SetVehicleMod(veh, 13, GetNumVehicleMods(veh, 13)-1) -- Transmission
SetVehicleMod(veh, 16, GetNumVehicleMods(veh, 16)-1) -- Armour
ToggleVehicleMod(veh, 18, true) -- Turbo
SetVehicleMod(veh, 30, GetNumVehicleMods(veh, 30)-1) -- Dials
SetVehicleMod(veh, 29, GetNumVehicleMods(veh, 29)-1) -- Dashboard
SetVehicleMod(veh, 43, GetNumVehicleMods(veh, 43)-1) -- Aerials
SetVehicleMod(veh, 37, GetNumVehicleMods(veh, 37)-1) -- Trunk
SetVehicleMod(veh, 27, GetNumVehicleMods(veh, 27)-1) -- Trim A
SetVehicleMod(veh, 44, GetNumVehicleMods(veh, 44)-1) -- Trim B
else
SetVehicleMod(veh, 11, data.list.performance[1]-1) -- Engine
SetVehicleMod(veh, 12, data.list.performance[2]-1) -- Brakes
SetVehicleMod(veh, 15, data.list.performance[3]-1) -- Suspension
SetVehicleMod(veh, 13, data.list.performance[4]-1) -- Transmission
SetVehicleMod(veh, 16, data.list.performance[5]-1) -- Armour
ToggleVehicleMod(veh, 18, data.list.performance[6]) -- Turbo
SetVehicleMod(veh, 30, data.list.performance[7]-1) -- Dials
SetVehicleMod(veh, 29, data.list.performance[8]-1) -- Dashboard
SetVehicleMod(veh, 43, data.list.performance[9]-1) -- Aerials
SetVehicleMod(veh, 37, data.list.performance[10]-1) -- Trunk
SetVehicleMod(veh, 27, data.list.performance[11]-1) -- Trim A
SetVehicleMod(veh, 44, data.list.performance[12]-1) -- Trim B
end
There is your example :D
Some vehicle require a roof mod to stop floating lightbars, so my suggestion would be add a way to config the vehicle mod within the script