require "DAMN_Parts";
require "DAMN_Spawns";

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

DAMN.Parts:processConfigV2("GT500", {
	["FrontBumperE"] = {
		partId = "GT500FrontBumper",
		itemToModel = {
			["Base.67gt500eFrontBumper0"] = "FrontBumper0e",
			["Base.67gt500eFrontBumperA"] = "FrontBumperAe",
			["Base.67gt500FrontBumper0"] = "FrontBumper0s",
			["Base.67gt500FrontBumperA"] = "FrontBumperAs",
			["Base.67gt500FrontBullbar"] = "FrontBullbarA",
		},
		default = "first",
	},
	["FrontBumperS"] = {
		partId = "GT500FrontBumper",
		itemToModel = {
			["Base.67gt500eFrontBumper0"] = "FrontBumper0e",
			["Base.67gt500eFrontBumperA"] = "FrontBumperAe",
			["Base.67gt500FrontBumper0"] = "FrontBumper0s",
			["Base.67gt500FrontBumperA"] = "FrontBumperAs",
			["Base.67gt500FrontBullbar"] = "FrontBullbarA",
		},
		default = "first",
	},
	["RearBumper"] = {
		partId = "GT500RearBumper",
		itemToModel = {
			["Base.67gt500RearBumper0"] = "RearBumper0",
			["Base.67gt500RearBumperA"] = "RearBumperA",
			["Base.67gt500RearBullbar"] = "RearBullbarA",
		},
		default = "first",
	},
	["WindshieldArmor"] = {
		partId = "GT500WindshieldArmor",
		itemToModel = {
			["Base.67gt500WindshieldArmor"] = "GT500winda",
		},
	},
	["WindshieldRearArmor"] = {
		partId = "GT500WindshieldRearArmor",
		itemToModel = {
			["Base.67gt500WindshieldRearArmor"] = "GT500windra",
		},
	},
	["WindowLeftArmor"] = {
		partId = "GT500WindowLeftArmor",
		itemToModel = {
			["Base.67gt500WindowArmor"] = "GT500leftwindowa",
		},
	},
	["WindowRightArmor"] = {
		partId = "GT500WindowRightArmor",
		itemToModel = {
			["Base.67gt500WindowArmor"] = "GT500rightwindowa",
		},
	},
	["SpareTire"] = {
		partId = "GT500SpareTire",
		itemToModel = {
			["Base.67gt500Tire3"] = "GT500sSpare",
			["Base.67gt500eTire3"] = "GT500eSpare",
		},
	},
	["TireFrontLeft"] = {
		partId = "TireFrontLeft",
		itemToModel = {
			["Base.67gt500Tire3"] = "GT500Tire",
			["Base.67gt500eTire3"] = "EleanorTire",
		},
	},
	["TireFrontRight"] = {
		partId = "TireFrontRight",
		itemToModel = {
			["Base.67gt500Tire3"] = "GT500Tire",
			["Base.67gt500eTire3"] = "EleanorTire",
		},
	},
	["TireRearLeft"] = {
		partId = "TireRearLeft",
		itemToModel = {
			["Base.67gt500Tire3"] = "GT500Tire",
			["Base.67gt500eTire3"] = "EleanorTire",
		},
	},
	["TireRearRight"] = {
		partId = "TireRearRight",
		itemToModel = {
			["Base.67gt500Tire3"] = "GT500Tire",
			["Base.67gt500eTire3"] = "EleanorTire",
		},
	},
});


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