require "DAMN_Parts";
require "DAMN_Spawns";

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

DAMN.Parts:processConfigV2("JP82", {
	["FrontBumper"] = {
		partId = "JP82FrontBumper",
		itemToModel = {
			["Base.82JeepJ10BumperFront"] = "FrontBumper",
			["Base.80sPickupBullbarFront"] = "FrontBullbar1",
			["Base.82JeepJ10BullbarFront"] = "FrontBullbar2",
		},
		default = "first",
	},
	["FrontBumperD"] = {
		partId = "JP82FrontBumper",
		itemToModel = {
			["Base.82JeepJ10BullbarFront"] = "FrontBullbar2",
			["Base.82JeepJ10BumperFront"] = "FrontBumper",
			["Base.80sPickupBullbarFront"] = "FrontBullbar1",
		},
		default = "first",
	},
	["RearBumper"] = {
		partId = "JP82RearBumper",
		itemToModel = {
			["Base.82JeepJ10BumperRear"] = "RearBumper",
			["Base.80sPickupBullbarRear"] = "RearBullbar",
		},
		default = "first",
	},
	["RearBumperD"] = {
		partId = "JP82RearBumper",
		itemToModel = {
			["Base.80sPickupBullbarRear"] = "RearBullbar",
			["Base.82JeepJ10BumperRear"] = "RearBumper",
		},
		default = "first",
	},
	["WindowFrontLeftArmor"] = {
		partId = "JP82WindowFrontLeftArmor",
		itemToModel = {
			["Base.80sPickupWindowFrontArmor"] = "JP82leftwina",
		},
	},
	["WindowFrontRightArmor"] = {
		partId = "JP82WindowFrontRightArmor",
		itemToModel = {
			["Base.80sPickupWindowFrontArmor"] = "JP82rightwina",
		},
	},
	["WindshieldArmor"] = {
		partId = "JP82WindshieldArmor",
		itemToModel = {
			["Base.80sPickupWindshieldArmor"] = "JP82winda",
		},
	},
	["SpareTire"] = {
		partId = "JP82SpareTireRoof",
		itemToModel = {
			["Base.80sOffroadTireA"] = "JP82Tire0",
            ["Base.76chevyKseriesTire2"] = "JP82Tire1",
            ["Base.80chevyCKseriesTire2"] = "JP82Tire2",
            ["Base.80chevyCKseriesTire1"] = "JP82Tire3",
            ["Base.90chevyCKseriesTire2"] = "JP82Tire4",
            ["Base.90chevyCKseriesTire1"] = "JP82Tire5",
		},
	},
    ["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.80sOffroadTireA"] = "JP82Tire0",
            ["Base.76chevyKseriesTire2"] = "JP82Tire1",
            ["Base.80chevyCKseriesTire2"] = "JP82Tire2",
            ["Base.80chevyCKseriesTire1"] = "JP82Tire3",
            ["Base.90chevyCKseriesTire2"] = "JP82Tire4",
            ["Base.90chevyCKseriesTire1"] = "JP82Tire5",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.80sOffroadTireA"] = "JP82Tire0",
            ["Base.76chevyKseriesTire2"] = "JP82Tire1",
            ["Base.80chevyCKseriesTire2"] = "JP82Tire2",
            ["Base.80chevyCKseriesTire1"] = "JP82Tire3",
            ["Base.90chevyCKseriesTire2"] = "JP82Tire4",
            ["Base.90chevyCKseriesTire1"] = "JP82Tire5",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.80sOffroadTireA"] = "JP82Tire0",
            ["Base.76chevyKseriesTire2"] = "JP82Tire1",
            ["Base.80chevyCKseriesTire2"] = "JP82Tire2",
            ["Base.80chevyCKseriesTire1"] = "JP82Tire3",
            ["Base.90chevyCKseriesTire2"] = "JP82Tire4",
            ["Base.90chevyCKseriesTire1"] = "JP82Tire5",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.80sOffroadTireA"] = "JP82Tire0",
            ["Base.76chevyKseriesTire2"] = "JP82Tire1",
            ["Base.80chevyCKseriesTire2"] = "JP82Tire2",
            ["Base.80chevyCKseriesTire1"] = "JP82Tire3",
            ["Base.90chevyCKseriesTire2"] = "JP82Tire4",
            ["Base.90chevyCKseriesTire1"] = "JP82Tire5",
		},
	},
});

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