require "DAMN_Parts";
require "DAMN_Spawns";

--***********************************************************
--**                   KI5 / bikinihorst                   **
--***********************************************************

DAMN.Parts:processConfigV2("CUDA", {
	["FrontBumper0"] = {
		partId = "CUDAFrontBumper",
		itemToModel = {
			["Base.CUDAFrontBumper0"] = "FrontBumper0",
			["Base.CUDAFrontBumper1"] = "FrontBumper1",
			["Base.CUDAFrontBumper2"] = "FrontBumper2",
			["Base.CUDAFrontBumperA"] = "FrontBumperA",
		},
		default = "first",
	},
	["FrontBumper1"] = {
		partId = "CUDAFrontBumper",
		itemToModel = {
			["Base.CUDAFrontBumper1"] = "FrontBumper1",
			["Base.CUDAFrontBumper0"] = "FrontBumper0",
			["Base.CUDAFrontBumper2"] = "FrontBumper2",
			["Base.CUDAFrontBumperA"] = "FrontBumperA",
		},
		default = "first",
	},
	["FrontBumper2"] = {
		partId = "CUDAFrontBumper",
		itemToModel = {
			["Base.CUDAFrontBumper2"] = "FrontBumper2",
			["Base.CUDAFrontBumper0"] = "FrontBumper0",
			["Base.CUDAFrontBumper1"] = "FrontBumper1",
			["Base.CUDAFrontBumperA"] = "FrontBumperA",
		},
		default = "first",
	},
	["RearBumper"] = {
		partId = "CUDARearBumper",
		itemToModel = {
			["Base.CUDARearBumper0"] = "RearBumper0",
			["Base.CUDARearBumperA"] = "RearBumperA",
		},
		default = "first",
	},
	["WindshieldArmor"] = {
		partId = "CUDAWindshieldArmor",
		itemToModel = {
			["Base.CUDAWindshieldArmor"] = "CUDAwinda",
		},
	},
	["WindshieldRearArmor"] = {
		partId = "CUDAWindshieldRearArmor",
		itemToModel = {
			["Base.CUDAWindshieldRearArmor"] = "CUDAwindra",
		},
	},
	["DoorLeftArmor"] = {
		partId = "CUDADoorLeftArmor",
		itemToModel = {
			["Base.CUDADoorArmor"] = "CUDAleftdoora",
		},
	},
	["DoorRightArmor"] = {
		partId = "CUDADoorRightArmor",
		itemToModel = {
			["Base.CUDADoorArmor"] = "CUDArightdoora",
		},
	},
	["SpareTire"] = {
		partId = "CUDASpareTire",
		itemToModel = {
			["Base.CUDAtire3"] = "CUDASpareTire0",			
			["Base.DodgeRTtire3"] = "CUDASpareTire1",
			["Base.CamaroSStire3"] = "CUDASpareTire2",
		},
		default = "trve_random",
		noPartChance = 25,
	},
	["Spoiler"] = {
		partId = "CUDASpoiler",
		itemToModel = {
			["Base.CUDASpoiler0"] = "cudaspoiler0",
			["Base.CUDASpoiler1"] = "cudaspoiler1",
		},
		default = "trve_random",
		noPartChance = 50,
	},
	["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.CamaroSStire3"] = "CUDATire0",
			["Base.CUDAtire3"] = "CUDATire1",
			["Base.DodgeRTtire3"] = "CUDATire2",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.CamaroSStire3"] = "CUDATire0",
			["Base.CUDAtire3"] = "CUDATire1",
			["Base.DodgeRTtire3"] = "CUDATire2",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.CamaroSStire3"] = "CUDATire0",
			["Base.CUDAtire3"] = "CUDATire1",
			["Base.DodgeRTtire3"] = "CUDATire2",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.CamaroSStire3"] = "CUDATire0",
			["Base.CUDAtire3"] = "CUDATire1",
			["Base.DodgeRTtire3"] = "CUDATire2",
		},
	},
});

function CUDA.ContainerAccess.Roofrack(vehicle, part, chr)
	if chr:getVehicle() then return false end
	if not vehicle:isInArea(part:getArea(), chr) then return false end
	return true
end