VehicleRestrictor - A mod to block vehicles and prevent stealing

VehicleRestrictor

A VeniceUnleashed mod to restrict usage of vehicles

This is a simple mod to restrict vehicle usage or prevent stealing of enemy vehicles.
In case you find any issues, please open an Issue here or submit a pull request.

Configuration

Configuration happens by editing Settings.lua for general settings and Vehicles.lua to configure which team can use a vehicle.

Settings.lua

Settings = {
	-- ### Print debug messages to server console ###
	-- 0 = Only print actions taken (default)
	-- 1 = Info
	-- 2 = Debug
	DEBUG_LEVEL = 0,

	-- ### Punishment type ###
	-- 0 = Disabled
	-- 1 = Kill player (default)
	-- 2 = Kill player & destroy vehicle
	-- 3 = Damage player over time
	-- 4 = Damage vehicle over time
	-- 5 = Kick player out of vehicle
	PUNISHMENT_TYPE = 1,
	
	-- ### Punishment trigger ###
	-- 1 = Entering vehicle (default)
	-- 2 = Damaging enemy vehicle or player with a stolen vehicle
	TRIGGER  = 1,
	
	-- ### Punishment delay after trigger (in seconds) ###
	-- If player leaves the vehicle before the delay is over, no action will be taken
	DELAY = 5.0,
	
	-- ### Punishment interval (in seconds) ###
	-- Applies damage every X seconds. Only used with PUNISHMENT_TYPE = 3/4
	INTERVAL = 1.0,
	
	-- ### Amount of damage applied each interval (in %) ###
	-- 50 = half HP per tick 
	DAMAGE = 15,
	
	-- ### Show warning to player? ###
	-- only used if DELAY > 0
	SHOW_WARNING = true,

	-- ### Show in chat that a player was killed/Punished
	ANNOUNCE_IN_CHAT = true,
}

Vehicles.lua

-- ### Vehicle configuration
-- # Team value describes who is allowed to use a vehicle
--   -1 = Noone is allowed to use it
--   0 = Vehicle is neutral, everyone can use it
--   1 to 16 (1 is US; 2 is RU, other nubers are squads for SQDM)
-- Default configuration is to prevent players using ANY enemy vehicles, except transport jeeps
-- Depending on map and gamemode, you might want to allow Tanks or other vehicles to be used by both teams

Vehicles = { 
	-- US Vehicles
	["AH1Z"] = {Team=1}, -- US attack heli
	["Venom"] = {Team=1}, -- US transport heli
	["Centurion_C-RAM"] = {Team=1}, -- US Stationary AA
	["F16"] = {Team=1}, -- US default jet
	["LAV_AD"] = {Team=1}, -- US Mobile AA 
	["M1Abrams"] = {Team=1},  -- US Tank
	["AAV-7A1"] = {Team=1}, -- AAV-7A1 AMTRAC transport tank
	["M1126-Stryker"] = {Team=1}, -- US Tank destroyer
	["MIMARS"] = {Team=1}, -- US Mobile artillery
	["F35B"] = {Team=1}, -- US F35 hover jet
	["A10_THUNDERBOLT"] = {Team=1}, -- US CAS jet
	["AH6_Littlebird"] = {Team=1}, -- US Scout heli
	["LAV25"] = {Team=1}, -- US IFV
	["LAV25_Paradrop"] = {Team=1}, -- US IFV (Dropped from Dropship)
	["Humvee_ASRAD"] = {Team=1}, -- US AA humvee
	["HumveeArmored"] = {Team=1}, -- US humvee with .50cal MG
	["HumveeModified"] = {Team=1}, -- 'PHOENIX' modified HUMVEE
	["GrowlerITV"] = {Team=0}, -- US jeep, set as neutral because spawns outside of base
	["DPV"] = {Team=0}, -- DPV Buggy, set as neutral because spawns outside of base

	-- RU Vehicles
	["Su-35BM Flanker-E"] = {Team=2}, -- RU default jet
	["T90"] = {Team=2}, -- RU Tank
	["Mi28"] = {Team=2},  -- RU attack heli
	["Ka-60"] = {Team=2}, -- RU Transport heli
	["Pantsir-S1"] = {Team=2}, -- RU Stationary AA
	["9K22_Tunguska_M"] = {Team=2}, -- RU Mobile AA
	["BMP2"] = {Team=2}, -- RU transport tank
	["2S25_SPRUT-SD"] = {Team=2}, -- RU Tank Destroyer
	["STAR_1466"] = {Team=2}, -- RU Mobile artillery
	["Su-25TM"] = {Team=2}, -- RU CAS jet
	["Z-11w"] = {Team=2}, -- RU Scout heli
	["BTR90"] = {Team=2}, -- RU IFV
	["VodnikPhoenix"] = {Team=2}, -- RU AA vehicle
	["GAZ-3937_Vodnik"] = {Team=2}, -- RU jeep with .50cal MG
	["VodnikModified_V2"] = {Team=2}, -- 'BRASUK' modified van
	["VDV Buggy"] = {Team=0}, -- RU jeep, set as neutral because spawns outside of base
	
	-- Stationary Map
	["Kornet"] = {Team=0}, -- US variant of stationary rocket launcher
	["TOW2"] = {Team=0}, -- RU variant of stationary rocket launcher
	["RHIB"] = {Team=0}, -- Boat
	["QuadBike"] = {Team=0}, -- Quad bike
	["AC130"] = {Team=0}, -- AC130 Gunship
	["C130"] = {Team=0}, -- Dropship
	["VanModified"] = {Team=0}, -- 'Rhino' modified van
	["KLR650"] = {Team=0}, -- Dirt bike
	["SkidLoader"] = {Team=0}, -- Skid loader
	
	-- Equipment
	["AGM-144_Hellfire_TV"] = {Team=0}, -- TV rocket of Attack heli
	["EODBot"] = {Team=0}, -- EodBot
	["M224"] = {Team=0}, -- Mortar
	["SOFLAM_Projectile"] = {Team=0}, -- Soflam
	["MAV"] = {Team=0}, -- Mav
	
	
}

Latest version can be found Here
SourceCode: https://github.com/XuluniX/VehicleRestrictor

2 Likes

Is this intended to fight base stealing? Because I see an issue if I’m in a hot situation and and an enemy hopped out of their tank; I just died because the mod didn’t allow me to take their vehicle and make a play.

Yes, part of the Intention behind it is, to prevent vehicle stealing.
That’s up to the admin. You could for example only enforce it for air vehicles or add an appropriate delay allowing you to use it for a few seconds

Released version 0.0.2
See first post for download

Changes:

  • Fixed rare error on exiting vehicles
  • Added missing vehicle (Tank Destroyer)
  • Changed Loglevels

Best mod for NO JET servers !!