AI Vehicle lock added (50% chance)
+ Added AI-Vehiclelock. + Set it to 50% chance.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
resource_manifest_version '05cfa83c-a124-4cfa-a768-c24a5811d8f9'
|
||||
|
||||
server_script 'server.lua'
|
||||
@@ -0,0 +1,19 @@
|
||||
AddEventHandler('entityCreated', function(entity)
|
||||
-- not valid anymore?
|
||||
if not DoesEntityExist(entity) then return end
|
||||
|
||||
-- rest of core remains the same
|
||||
local entityType = GetEntityType(entity)
|
||||
|
||||
-- not a vehicle? bail out
|
||||
if entityType ~= 2 then return end
|
||||
|
||||
-- only for 'random' population cars
|
||||
if GetEntityPopulationType(entity) > 5 then return end
|
||||
|
||||
-- if >0.5 (50% chance of locking), bail out
|
||||
if math.random() > 0.5 then return end
|
||||
|
||||
-- lock!
|
||||
SetVehicleDoorsLocked(entity, 2)
|
||||
end)
|
||||
@@ -170,6 +170,7 @@ start Seat-Switcher
|
||||
start Join-Transition
|
||||
start CarWipe
|
||||
start EGRP-Notifications
|
||||
start AI-Vehiclelock
|
||||
|
||||
#[-----Discord Perms-----]
|
||||
start discord_perms
|
||||
|
||||
Reference in New Issue
Block a user