Merge pull request #883 from ohscxr/main

feat(client/functions): Interior/Dashboard saving/application
This commit is contained in:
P Gergő
2023-02-09 13:36:29 +01:00
committed by GitHub
+14
View File
@@ -600,6 +600,8 @@ function ESX.Game.GetVehicleProperties(vehicle)
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
local hasCustomPrimaryColor = GetIsVehiclePrimaryColourCustom(vehicle)
local dashboardColor = GetVehicleDashboardColor(vehicle)
local interiorColor = GetVehicleInteriorColour(vehicle)
local customPrimaryColor = nil
if hasCustomPrimaryColor then
customPrimaryColor = {GetVehicleCustomPrimaryColour(vehicle)}
@@ -672,6 +674,9 @@ function ESX.Game.GetVehicleProperties(vehicle)
pearlescentColor = pearlescentColor,
wheelColor = wheelColor,
dashboardColor = dashboardColor,
interiorColor = interiorColor,
wheels = GetVehicleWheelType(vehicle),
windowTint = GetVehicleWindowTint(vehicle),
@@ -784,6 +789,15 @@ function ESX.Game.SetVehicleProperties(vehicle, props)
if props.pearlescentColor ~= nil then
SetVehicleExtraColours(vehicle, props.pearlescentColor, wheelColor)
end
if props.interiorColor ~= nil then
SetVehicleInteriorColor(vehicle, props.interiorColor)
end
if props.dashboardColor ~= nil then
SetVehicleDashboardColor(vehicle, props.dashboardColor)
end
if props.wheelColor ~= nil then
SetVehicleExtraColours(vehicle, props.pearlescentColor or pearlescentColor, props.wheelColor)
end