mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-11-14 18:33:56 +00:00
tweak(server/vehicle): don't lock veh with player driver
This commit is contained in:
1 parent
0ded085a28
commit
dff0be4702
1 file changed
+9
-2
+9
-2
@@ -387,8 +387,15 @@ end)
|
||||
RegisterNetEvent("entityCreated", function(entity)
|
||||
if not DoesEntityExist(entity) or 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
|
||||
if state.owner or state.locked ~= nil then return end
|
||||
|
||||
local driver = GetPedInVehicleSeat(entity, -1)
|
||||
if DoesEntityExist(driver) and IsPedAPlayer(driver) then
|
||||
state.locked = false
|
||||
state.hotwired = true
|
||||
end
|
||||
|
||||
if math.random(1, 100) <= Config.randomUnlockedVehicleChance then return end
|
||||
state.locked = true
|
||||
end)
|
||||
|
||||
|
||||
Reference in new issue
Block a user