Skip to content

Commit

Permalink
feat(server): lock only random population cars
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturMichalak committed Jun 22, 2024
1 parent 77aec3f commit 8e9f727
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if config.lockNPCDrivenCars or config.lockNPCParkedCars then
---Lock every spawned vehicle
---@param vehicle number The entity number of the vehicle.
AddEventHandler('entityCreated', function (vehicle)
if not vehicle or GetEntityType(vehicle) ~= 2 then return end
if not vehicle or GetEntityType(vehicle) ~= 2 or GetEntityPopulationType(vehicle) > 5 then return end
local isDriver = GetPedInVehicleSeat(vehicle, -1) ~= 0
local isLocked = (config.lockNPCDrivenCars and isDriver) or (config.lockNPCParkedCars and not isDriver)
and GetVehicleType(vehicle) ~= 'bike' and not getIsVehicleBlacklisted(vehicle)
Expand Down

0 comments on commit 8e9f727

Please sign in to comment.