require "DAMN_Parts";
require "DAMN_Spawns";

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

DAMN.Parts:processConfigV2("CAM69", {
	["FrontBumperSS"] = {
		partId = "CAM69FrontBumper",
		itemToModel = {
			["Base.69camaroFrontBumper0"] = "FrontBumper0",
			["Base.69camaroFrontBumper1"] = "FrontBumper1",
			["Base.69camaroFrontBumperA"] = "FrontBumperA",
			["Base.69camaroFrontBumperB"] = "FrontBumperB",
		},
		default = "first",
	},
	["FrontBumperRS"] = {
		partId = "CAM69FrontBumper",
		itemToModel = {
			["Base.69camaroFrontBumper1"] = "FrontBumper1",
			["Base.69camaroFrontBumper0"] = "FrontBumper0",
			["Base.69camaroFrontBumperA"] = "FrontBumperA",
			["Base.69camaroFrontBumperB"] = "FrontBumperB",
		},
		default = "first",
	},
	["RearBumper"] = {
		partId = "CAM69RearBumper",
		itemToModel = {
			["Base.69camaroRearBumper0"] = "RearBumper0",
			["Base.69camaroRearBumperA"] = "RearBumperA",
			["Base.69camaroRearBumperB"] = "RearBumperB",
		},
		default = "first",
	},
	["WindshieldArmor"] = {
		partId = "CAM69WindshieldArmor",
		itemToModel = {
			["Base.69camaroWindshieldArmor"] = "CAM69winda",
		},
	},
	["WindshieldRearArmor"] = {
		partId = "CAM69WindshieldRearArmor",
		itemToModel = {
			["Base.69camaroWindshieldRearArmor"] = "CAM69windra",
		},
	},
	["WindowLeftArmor"] = {
		partId = "CAM69WindowLeftArmor",
		itemToModel = {
			["Base.69camaroWindowArmor"] = "CAM69leftwindowa",
		},
	},
	["WindowRightArmor"] = {
		partId = "CAM69WindowRightArmor",
		itemToModel = {
			["Base.69camaroWindowArmor"] = "CAM69rightwindowa",
		},
	},
	["SpareTire"] = {
		partId = "CAM69SpareTire",
		itemToModel = {
			["Base.CamaroSStire3"] = "CAM69SpareTire0",
			["Base.CUDAtire3"] = "CAM69SpareTire1",
			["Base.DodgeRTtire3"] = "CAM69SpareTire2",
		},
		default = "trve_random",
		noPartChance = 33,
	},
	["Spoiler"] = {
		partId = "CAM69Spoiler",
		itemToModel = {
			["Base.69camaroSpoiler0"] = "spoiler0",
		},
		default = "first",
	},
	["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.CamaroSStire3"] = "CAM69Tire0",
			["Base.CUDAtire3"] = "CAM69Tire1",
			["Base.DodgeRTtire3"] = "CAM69Tire2",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.CamaroSStire3"] = "CAM69Tire0",
			["Base.CUDAtire3"] = "CAM69Tire1",
			["Base.DodgeRTtire3"] = "CAM69Tire2",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.CamaroSStire3"] = "CAM69Tire0",
			["Base.CUDAtire3"] = "CAM69Tire1",
			["Base.DodgeRTtire3"] = "CAM69Tire2",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.CamaroSStire3"] = "CAM69Tire0",
			["Base.CUDAtire3"] = "CAM69Tire1",
			["Base.DodgeRTtire3"] = "CAM69Tire2",
		},
	},
});

function CAM69.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