mirror of
https://github.com/ND-Framework/ND_Core.git
synced 2026-08-17 05:56:01 +01:00
tweak(server/vehicle): don't lock veh with player driver
This commit is contained in:
@@ -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