fix: setting vehicle props

This commit is contained in:
Andyyy7666
2023-11-19 01:41:20 +01:00
parent 7cc3bbe42a
commit 700d422477

View File

@@ -286,7 +286,11 @@ end)
AddStateBagChangeHandler("props", nil, function(bagName, key, value, reserved, replicated) AddStateBagChangeHandler("props", nil, function(bagName, key, value, reserved, replicated)
local entity = GetEntityFromStateBagName(bagName) local entity = GetEntityFromStateBagName(bagName)
if not value or not DoesEntityExist(entity) or NetworkGetEntityOwner(entity) ~= cache.playerId then return end if not value or not DoesEntityExist(entity) or NetworkGetEntityOwner(entity) ~= cache.playerId then return end
lib.setVehicleProperties(entity, json.decode(value)) local props = value
if type(value) == "string" then
props = json.decode(value)
end
lib.setVehicleProperties(entity, props)
end) end)
local function playKeyFob(veh) local function playKeyFob(veh)