-----------------------------------------
-- MEDKIT_BACKPACK (MILITARY RP)
-- Собственность Олега Закона и Scripty
-----------------------------------------
AddCSLuaFile()

concommand.Add("VNT_Support_Torch_Toggle", function(ply,cmd,args)
	bTorch = !bTorch
	if bTorch then

		GetConVar("VNT_Support_Torch_Vanilla"):SetBool( 0 )
		ply:AllowFlashlight( true )
		print( "flashlight enabled" )

	else

		GetConVar("VNT_Support_Torch_Vanilla"):SetBool( 1 )
		if SERVER then ply:Flashlight( false ) end
		ply:AllowFlashlight( false )
		print( "flashlight disabled" )

	end end , nil , "(TOGGLE) Toggle the requirement to use the flashlight weapon." , { FCVAR_REPLICATED, FCVAR_ARCHIVE } )
if !ConVarExists("VNT_Support_Torch_Vanilla") then CreateConVar("VNT_Support_Torch_Vanilla" , 1 , { FCVAR_REPLICATED, FCVAR_ARCHIVE } , "INTERNAL VALUE, DO NOT USE DIRECTLY" , 0 , 1 ) end

if !ConVarExists("VNT_Support_MineVehicle_PlaceDelay") then CreateConVar("VNT_Support_MineVehicle_PlaceDelay", 5 , { FCVAR_REPLICATED, FCVAR_ARCHIVE } , "(INT) Delay between uses of the Anti-Vehicle Mine" , 1 , 30 ) end
if !ConVarExists("VNT_Support_MineVehicle_Radius") then CreateConVar("VNT_Support_MineVehicle_Radius", 128 , { FCVAR_REPLICATED, FCVAR_ARCHIVE } , "(INT) Radius of the Anti-Vehicle Mine" , 5 , 128 ) end

if !ConVarExists("VNT_Support_MinePersonnel_PlaceDelay") then CreateConVar("VNT_Support_MinePersonnel_PlaceDelay", 5 , { FCVAR_REPLICATED, FCVAR_ARCHIVE } , "(INT) Delay between uses of the Anti-Personnel Mine" , 1 , 30 ) end
if !ConVarExists("VNT_Support_MinePersonnel_Radius") then CreateConVar("VNT_Support_MinePersonnel_Radius", 128 , { FCVAR_REPLICATED, FCVAR_ARCHIVE } , "(INT) Radius of the Anti-Personnel Mine" , 5 , 128 ) end

local function vntSupportSWepsOptions( Panel )

	Panel:ClearControls()

	Panel:AddControl( "Header", { 
		Text = "Support Weapons" ,
		Description	=[[Добро пожаловать на фт тим!
		]],
	} )

	-----------------------------------------------------
	-----------------------------------------------------
	--	Torch
	-----------------------------------------------------
	-----------------------------------------------------
	
	Panel:AddControl( "Checkbox", 	{ 
		["label"] = "Toggle Vanilla Flashlight",	
		["Command"] = "VNT_Support_Torch_Toggle",	
		["Type"] = "bool"
	} )

	Panel:AddControl( "Header", { 
		["text"] = "M15 Anti-Vehicle Mines" ,
		["Description"] =[[M15 Options
		These control the M15 Anti-Vehicle mines.
		]],
	} )

	Panel:AddControl( "Slider", {
		["label"] = "Mine Place Delay",
		["Command"] = "VNT_Support_MineVehicle_PlaceDelay",	
		["Type"] = "int",
		["min"] = "1", 	
		["max"] = "30"
	}	)
	
	Panel:AddControl( "Slider", {
		["label"] = "Find Radius",
		["Command"] = "VNT_Support_MineVehicle_Radius",	
		["Type"] = "int",
		["min"] = "5", 	
		["max"] = "128"
	}	)

	Panel:AddControl( "Header", { 
		["text"] = "M18 Anti-Personnel Mines" ,
		["Description"] =[[M18 Options
		These control the M18 Anti-Personnel mines.
		]],
	} )

	Panel:AddControl( "Slider", {
		["label"] = "Mine Place Delay",
		["Command"] = "VNT_Support_MinePersonnel_PlaceDelay",	
		["Type"] = "int",
		["min"] = "1", 	
		["max"] = "30"
	}	)
	
	Panel:AddControl( "Slider", {
		["label"] = "Find Radius",
		["Command"] = "VNT_Support_MinePersonnel_Radius",	
		["Type"] = "int",
		["min"] = "5", 	
		["max"] = "128"
	}	)
	
end

local function vntSupportSWepsIndex()	spawnmenu.AddToolMenuOption( "Options", "V92", "Support Equipment", "Support Equipment", "", "", vntSupportSWepsOptions )	end
hook.Add( "PopulateToolMenu", "vntSupportSWepsIndex", vntSupportSWepsIndex )

if SERVER then
	resource.AddWorkshop( "635210663" )	--	Support Equipment
end

-----------------------------------------
-- MEDKIT_BACKPACK (MILITARY RP)
-- Собственность Олега Закона и Scripty
-----------------------------------------
