mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +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),
|
||||
modLivery = modLivery,
|
||||
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
|
||||
@@ -121,6 +131,7 @@ function lib.setVehicleProperties(vehicle, props)
|
||||
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
|
||||
|
||||
SetVehicleModKit(vehicle, 0)
|
||||
SetVehicleAutoRepairDisabled(vehicle, true)
|
||||
|
||||
if props.plate then
|
||||
SetVehicleNumberPlateText(vehicle, props.plate)
|
||||
@@ -202,6 +213,14 @@ function lib.setVehicleProperties(vehicle, props)
|
||||
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
|
||||
SetVehicleNeonLightsColour(vehicle, props.neonColor[1], props.neonColor[2], props.neonColor[3])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user