update: lock traffic vehicles

This commit is contained in:
Andyyy7666
2023-07-22 21:43:36 +02:00
parent d29d73c075
commit bc7e2ddd2a

View File

@@ -340,3 +340,10 @@ else
NDCore.giveVehicleKeys(veh, src, target) NDCore.giveVehicleKeys(veh, src, target)
end, false) end, false)
end end
RegisterNetEvent("entityCreated", function(entity)
if GetEntityType(entity) ~= 2 then return end
local state = Entity(entity).state
if state.owner or math.random(1, 100) <= Config.randomUnlockedVehicleChance then return end
if state.locked ~= nil then return end
state.locked = true
end)