mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
feat(vehicleProperties): extra settings
Includes some minor fixes.
This commit is contained in:
@@ -30,10 +30,14 @@ function lib.getVehicleProperties(vehicle)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if GetVehicleMod(vehicle, 48) == -1 and GetVehicleLivery(vehicle) ~= -1 then
|
local modLivery = GetVehicleMod(vehicle, 48)
|
||||||
modLivery = GetVehicleLivery(vehicle)
|
|
||||||
else
|
if modLivery == -1 then
|
||||||
modLivery = GetVehicleMod(vehicle, 48)
|
local modLivery2 = GetVehicleLivery(vehicle)
|
||||||
|
|
||||||
|
if modLivery2 ~= 0 then
|
||||||
|
modLivery = modLivery2
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local damage = {
|
local damage = {
|
||||||
@@ -91,6 +95,8 @@ function lib.getVehicleProperties(vehicle)
|
|||||||
interiorColor = GetVehicleInteriorColor(vehicle),
|
interiorColor = GetVehicleInteriorColor(vehicle),
|
||||||
dashboardColor = GetVehicleDashboardColour(vehicle),
|
dashboardColor = GetVehicleDashboardColour(vehicle),
|
||||||
wheelColor = wheelColor,
|
wheelColor = wheelColor,
|
||||||
|
wheelWidth = GetVehicleWheelWidth(vehicle),
|
||||||
|
wheelSize = GetVehicleWheelSize(vehicle),
|
||||||
wheels = GetVehicleWheelType(vehicle),
|
wheels = GetVehicleWheelType(vehicle),
|
||||||
windowTint = GetVehicleWindowTint(vehicle),
|
windowTint = GetVehicleWindowTint(vehicle),
|
||||||
xenonColor = GetVehicleXenonLightsColor(vehicle),
|
xenonColor = GetVehicleXenonLightsColor(vehicle),
|
||||||
@@ -149,6 +155,7 @@ function lib.getVehicleProperties(vehicle)
|
|||||||
modWindows = GetVehicleMod(vehicle, 46),
|
modWindows = GetVehicleMod(vehicle, 46),
|
||||||
modDoorR = GetVehicleMod(vehicle, 47),
|
modDoorR = GetVehicleMod(vehicle, 47),
|
||||||
modLivery = modLivery,
|
modLivery = modLivery,
|
||||||
|
modRoofLivery = GetVehicleRoofLivery(vehicle),
|
||||||
modLightbar = GetVehicleMod(vehicle, 49),
|
modLightbar = GetVehicleMod(vehicle, 49),
|
||||||
windows = damage.windows,
|
windows = damage.windows,
|
||||||
doors = damage.doors,
|
doors = damage.doors,
|
||||||
@@ -190,13 +197,17 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if props.tankHealth then
|
if props.tankHealth then
|
||||||
SetVehiclePetrolTankHealth(vehicle, props.engineHealth + 0.0)
|
SetVehiclePetrolTankHealth(vehicle, props.tankHealth + 0.0)
|
||||||
end
|
end
|
||||||
|
|
||||||
if props.fuelLevel then
|
if props.fuelLevel then
|
||||||
SetVehicleFuelLevel(vehicle, props.fuelLevel + 0.0)
|
SetVehicleFuelLevel(vehicle, props.fuelLevel + 0.0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if props.oilLevel then
|
||||||
|
SetVehicleOilLevel(vehicle, props.oilLevel + 0.0)
|
||||||
|
end
|
||||||
|
|
||||||
if props.dirtLevel then
|
if props.dirtLevel then
|
||||||
SetVehicleDirtLevel(vehicle, props.dirtLevel + 0.0)
|
SetVehicleDirtLevel(vehicle, props.dirtLevel + 0.0)
|
||||||
end
|
end
|
||||||
@@ -217,8 +228,8 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if props.pearlescentColor then
|
if props.pearlescentColor or props.wheelColor then
|
||||||
SetVehicleExtraColours(vehicle, props.pearlescentColor, wheelColor)
|
SetVehicleExtraColours(vehicle, props.pearlescentColor or pearlescentColor, props.wheelColor or wheelColor)
|
||||||
end
|
end
|
||||||
|
|
||||||
if props.interiorColor then
|
if props.interiorColor then
|
||||||
@@ -226,17 +237,21 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if props.dashboardColor then
|
if props.dashboardColor then
|
||||||
SetVehicleDashboardColour(vehicle, props.dashboardColor)
|
SetVehicleDashboardColor(vehicle, props.dashboardColor)
|
||||||
end
|
|
||||||
|
|
||||||
if props.wheelColor then
|
|
||||||
SetVehicleExtraColours(vehicle, props.pearlescentColor or pearlescentColor, props.wheelColor)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if props.wheels then
|
if props.wheels then
|
||||||
SetVehicleWheelType(vehicle, props.wheels)
|
SetVehicleWheelType(vehicle, props.wheels)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if props.wheelSize then
|
||||||
|
SetVehicleWheelSize(vehicle, props.wheelSize)
|
||||||
|
end
|
||||||
|
|
||||||
|
if props.wheelWidth then
|
||||||
|
SetVehicleWheelWidth(vehicle, props.wheelWidth)
|
||||||
|
end
|
||||||
|
|
||||||
if props.windowTint then
|
if props.windowTint then
|
||||||
SetVehicleWindowTint(vehicle, props.windowTint)
|
SetVehicleWindowTint(vehicle, props.windowTint)
|
||||||
end
|
end
|
||||||
@@ -261,7 +276,7 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
|
|
||||||
if props.doors then
|
if props.doors then
|
||||||
for i = 1, #props.doors do
|
for i = 1, #props.doors do
|
||||||
SetVehicleDoorBroken(vehicle, props.windows[i], false)
|
SetVehicleDoorBroken(vehicle, props.doors[i], true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user