require "DAMN_Parts";
require "DAMN_Spawns";

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

DAMN.Parts:processConfigV2("CH88", {
	["FrontBumper"] = {
		partId = "CH88FrontBumper",
		itemToModel = {
			["Base.88ChevyS10BumperFront"] = "FrontBumper",
			["Base.80sPickupBullbarFront"] = "FrontBullbar1",
			["Base.88ChevyS10BullbarFront"] = "FrontBullbar2",
		},
		default = "first",
	},
	["RearBumper"] = {
		partId = "CH88RearBumper",
		itemToModel = {
			["Base.88ChevyS10BumperRear"] = "RearBumper",
			["Base.80sPickupBullbarRear"] = "RearBullbar",
		},
		default = "first",
	},
	["WindowFrontLeftArmor"] = {
		partId = "CH88WindowFrontLeftArmor",
		itemToModel = {
			["Base.80sPickupWindowFrontArmor"] = "CH88leftwina",
		},
	},
	["WindowFrontRightArmor"] = {
		partId = "CH88WindowFrontRightArmor",
		itemToModel = {
			["Base.80sPickupWindowFrontArmor"] = "CH88rightwina",
		},
	},
	["WindshieldArmor"] = {
		partId = "CH88WindshieldArmor",
		itemToModel = {
			["Base.80sPickupWindshieldArmor"] = "CH88winda",
		},
	},
    ["SpareTire"] = {
		partId = "CH88SpareTireRoof",
		itemToModel = {
			["Base.80sOffroadTireA"] = "CH88Tire0",
            ["Base.76chevyKseriesTire2"] = "CH88Tire1",
            ["Base.80chevyCKseriesTire2"] = "CH88Tire2",
            ["Base.80chevyCKseriesTire1"] = "CH88Tire3",
            ["Base.90chevyCKseriesTire2"] = "CH88Tire4",
            ["Base.90chevyCKseriesTire1"] = "CH88Tire5",
		},
	},
    ["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.80sOffroadTireA"] = "CH88Tire0",
            ["Base.76chevyKseriesTire2"] = "CH88Tire1",
            ["Base.80chevyCKseriesTire2"] = "CH88Tire2",
            ["Base.80chevyCKseriesTire1"] = "CH88Tire3",
            ["Base.90chevyCKseriesTire2"] = "CH88Tire4",
            ["Base.90chevyCKseriesTire1"] = "CH88Tire5",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.80sOffroadTireA"] = "CH88Tire0",
            ["Base.76chevyKseriesTire2"] = "CH88Tire1",
            ["Base.80chevyCKseriesTire2"] = "CH88Tire2",
            ["Base.80chevyCKseriesTire1"] = "CH88Tire3",
            ["Base.90chevyCKseriesTire2"] = "CH88Tire4",
            ["Base.90chevyCKseriesTire1"] = "CH88Tire5",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.80sOffroadTireA"] = "CH88Tire0",
            ["Base.76chevyKseriesTire2"] = "CH88Tire1",
            ["Base.80chevyCKseriesTire2"] = "CH88Tire2",
            ["Base.80chevyCKseriesTire1"] = "CH88Tire3",
            ["Base.90chevyCKseriesTire2"] = "CH88Tire4",
            ["Base.90chevyCKseriesTire1"] = "CH88Tire5",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.80sOffroadTireA"] = "CH88Tire0",
            ["Base.76chevyKseriesTire2"] = "CH88Tire1",
            ["Base.80chevyCKseriesTire2"] = "CH88Tire2",
            ["Base.80chevyCKseriesTire1"] = "CH88Tire3",
            ["Base.90chevyCKseriesTire2"] = "CH88Tire4",
            ["Base.90chevyCKseriesTire1"] = "CH88Tire5",
		},
	},
});

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