mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
feat(exports/entities): persistent window state (smashed/intact)
This commit is contained in:
@@ -109,6 +109,16 @@ function lib.getVehicleProperties(vehicle)
|
|||||||
modDoorR = GetVehicleMod(vehicle, 47),
|
modDoorR = GetVehicleMod(vehicle, 47),
|
||||||
modLivery = modLivery,
|
modLivery = modLivery,
|
||||||
modLightbar = GetVehicleMod(vehicle, 49),
|
modLightbar = GetVehicleMod(vehicle, 49),
|
||||||
|
windows = {
|
||||||
|
IsVehicleWindowIntact(vehicle, 0),
|
||||||
|
IsVehicleWindowIntact(vehicle, 1),
|
||||||
|
IsVehicleWindowIntact(vehicle, 2),
|
||||||
|
IsVehicleWindowIntact(vehicle, 3),
|
||||||
|
IsVehicleWindowIntact(vehicle, 4),
|
||||||
|
IsVehicleWindowIntact(vehicle, 5),
|
||||||
|
IsVehicleWindowIntact(vehicle, 6),
|
||||||
|
IsVehicleWindowIntact(vehicle, 7),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -121,6 +131,7 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
|
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
|
||||||
|
|
||||||
SetVehicleModKit(vehicle, 0)
|
SetVehicleModKit(vehicle, 0)
|
||||||
|
SetVehicleAutoRepairDisabled(vehicle, true)
|
||||||
|
|
||||||
if props.plate then
|
if props.plate then
|
||||||
SetVehicleNumberPlateText(vehicle, props.plate)
|
SetVehicleNumberPlateText(vehicle, props.plate)
|
||||||
@@ -202,6 +213,14 @@ function lib.setVehicleProperties(vehicle, props)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if props.windows then
|
||||||
|
for i = 1, #props.windows do
|
||||||
|
if props.windows[i] then
|
||||||
|
SmashVehicleWindow(vehicle, i - 1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if props.neonColor then
|
if props.neonColor then
|
||||||
SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3])
|
SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3])
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user