require "DAMN_Parts";
require "DAMN_Spawns";

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

DAMN.Parts:processConfigV2("PRX75", {
	["BumperFront"] = {
		partId = "PRX75BumperFront",
		itemToModel = {
			["Base.75grandPrixBumperFront"] = "BumperFront0",
			["Base.75grandPrixBumperFrontA"] = "BumperFrontA",
			["Base.75grandPrixBullbar"] = "BullbarFrontA",
		},
		default = "first",
	},
	["BumperRear"] = {
		partId = "PRX75BumperRear",
		itemToModel = {
			["Base.75grandPrixBumperRear"] = "BumperRear0",
		},
		default = "first",
	},
	["WindshieldArmor"] = {
		partId = "PRX75WindshieldArmor",
		itemToModel = {
			["Base.75grandPrixWindshieldArmor"] = "PRX75winda0",
		},
	},
	["WindshieldRearArmor"] = {
		partId = "PRX75WindshieldRearArmor",
		itemToModel = {
			["Base.75grandPrixWindshieldRearArmor"] = "PRX75windra",
		},
	},
	["FrontLeftArmor"] = {
		partId = "PRX75FrontLeftArmor",
		itemToModel = {
			["Base.75grandPrixFrontWindowArmor"] = "PRX75leftdoora",
		},
	},
	["FrontRightArmor"] = {
		partId = "PRX75FrontRightArmor",
		itemToModel = {
			["Base.75grandPrixFrontWindowArmor"] = "PRX75rightdoora",
		},
	},
	["RearLeftArmor"] = {
		partId = "PRX75RearLeftArmor",
		itemToModel = {
			["Base.75grandPrixRearWindowArmor"] = "PRX75leftdoorra",
		},
	},
	["RearRightArmor"] = {
		partId = "PRX75RearRightArmor",
		itemToModel = {
			["Base.75grandPrixRearWindowArmor"] = "PRX75rightdoorra",
		},
	},
	["SpareTire"] = {
		partId = "PRX75SpareTire",
		itemToModel = {
			["Base.75grandPrixR215Tire1"] = "PRX75Spare1",
			["Base.75grandPrixR217Tire3"] = "PRX75Spare2",
			["Base.75grandPrixH17Tire3"] = "PRX75Spare3",
		},
		default = "trve_random",
		noPartChance = 33,
	},
	["SpareTireSJ"] = {
		partId = "PRX75SpareTire",
		itemToModel = {
			["Base.75grandPrixR215Tire1"] = "PRX75Spare1",
		},
		default = "trve_random",
		noPartChance = 33,
	},
	["Roofrack"] = {
		partId = "PRX75Roofrack",
		itemToModel = {
			["Base.75grandPrixRoofrack1"] = "PRX75Roofrack0",
		},
		default = "trve_random",
		noPartChance = 95,
	},
	["Cordova"] = {
		partId = "PRX75CordovaTop",
		itemToModel = {
			["Base.75grandPrixCordovaTypeA1"] = "PRX75Cordova0",
			["Base.75grandPrixCordovaTypeB1"] = "PRX75Cordova1",
		},
		default = "trve_random",
		noPartChance = 33,
	},
	["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.75grandPrixR215Tire1"] = "PRX75Tire1",
			["Base.75grandPrixR217Tire3"] = "PRX75Tire2",
			["Base.75grandPrixH17Tire3"] = "PRX75Tire3",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.75grandPrixR215Tire1"] = "PRX75Tire1",
			["Base.75grandPrixR217Tire3"] = "PRX75Tire2",
			["Base.75grandPrixH17Tire3"] = "PRX75Tire3",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.75grandPrixR215Tire1"] = "PRX75Tire1",
			["Base.75grandPrixR217Tire3"] = "PRX75Tire2",
			["Base.75grandPrixH17Tire3"] = "PRX75Tire3",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.75grandPrixR215Tire1"] = "PRX75Tire1",
			["Base.75grandPrixR217Tire3"] = "PRX75Tire2",
			["Base.75grandPrixH17Tire3"] = "PRX75Tire3",
		},
	},
});


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