mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-11-27 21:34:45 +00:00
fix: setting vehicle props
This commit is contained in:
1 parent
7cc3bbe42a
commit
700d422477
1 file changed
+5
-1
@@ -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)
|
||||||
|
|||||||
Reference in new issue
Block a user