Add Support for Drift Tyres

Integrate them into the VehicleProperties Functions, and make sure that they return true on the check so there should be no problems with older builds.

Thx to mycroft for the idea with the type <3

Co-Authored-By: Mycroft <22378232+Mycroft-Studios@users.noreply.github.com>
This commit is contained in:
Kuuzoo
2023-04-19 17:19:20 +02:00
parent 9a11a9ef53
commit 92f5d3c0bc
+10
View File
@@ -627,6 +627,11 @@ function ESX.Game.GetVehicleProperties(vehicle)
end
end
local driftTyresEnabled = false
if type(GetDriftTyresEnabled(vehicle) == boolean) and GetDriftTyresEnabled(vehicle) then
driftTyresEnabled = true
end
local doorsBroken, windowsBroken, tyreBurst = {}, {}, {}
local numWheels = tostring(GetVehicleNumberOfWheels(vehicle))
@@ -689,6 +694,7 @@ function ESX.Game.GetVehicleProperties(vehicle)
neonColor = table.pack(GetVehicleNeonLightsColour(vehicle)),
extras = extras,
dirftTyresEnabled = driftTyresEnabled,
tyreSmokeColor = table.pack(GetVehicleTyreSmokeColor(vehicle)),
modSpoilers = GetVehicleMod(vehicle, 0),
@@ -822,6 +828,10 @@ function ESX.Game.SetVehicleProperties(vehicle, props)
end
end
if props.driftTyresEnabled then
SetDriftTyresEnabled(vehicle, true)
end
if props.neonColor ~= nil then
SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3])
end