function F4Menu_AddRefreshedCommandsList()
	local scrollbar = false
	local cp_closed = true
	local mayor_closed = true
	if IsValid(F4Menu_CommandsMain) then
		scrollbar = F4Menu_CommandsMain.VBar:GetScroll()
		if IsValid(F4Menu_PoliceCommands) then
			F4Menu_PoliceCommands:Remove()
			cp_closed = F4Menu_PoliceCommands:GetExpanded()
		end
		if IsValid(F4Menu_MayorCommands) then
			F4Menu_MayorCommands:Remove()
			mayor_closed = F4Menu_MayorCommands:GetExpanded()
		end
	end
	local tm = LocalPlayer():Team()
	if (F4Menu_Reskin.AccessToCPCmds[tm] == true) then
		F4Menu_PoliceCommands = vgui.Create("DCollapsibleCategory", F4Menu_CommandsMain)
		F4Menu_PoliceCommands:SetSize(F4Menu_CommandsMain:GetWide(), 100)
		if cp_closed then
			F4Menu_PoliceCommands:SetExpanded(true)
		else
			F4Menu_PoliceCommands:SetExpanded(false)
		end
		F4Menu_PoliceCommands:SetLabel("")
		F4Menu_PoliceCommands.PaintOver = function(self, w, h)
			surface.SetDrawColor(F4Menu_Reskin.Colors[1])
			surface.DrawLine(0, 20, w, 20)
			draw.RoundedBox(0, 0, 0, w, 20, F4Menu_Reskin.Colors[13])
			draw.RoundedBox(0, 1, 1, w - 2, 18, F4Menu_Reskin.Colors[14])
			surface.SetDrawColor(F4Menu_Reskin.Colors[16])
			surface.DrawLine(1, 1, w - 2, 1)
			surface.DrawLine(1, 1, 1, 18)
			surface.DrawLine(1, 18, w - 2, 18)
			surface.DrawLine(w - 2, 1, w - 2, 18)
			draw.SimpleText(F4Menu_Reskin.CPCommandsTitle, "F4Menu_CategoryTitle", 10, 3, color_white, TEXT_ALIGN_LEFT)
		end
		F4Menu_PoliceCommandsList = vgui.Create("DPanelList", F4Menu_PoliceCommands)
		F4Menu_PoliceCommandsList:SetWide(F4Menu_CommandsMain:GetWide())
		F4Menu_PoliceCommandsList:SetAutoSize(true)
		F4Menu_PoliceCommandsList:SetPadding(2)
		F4Menu_PoliceCommandsList:SetSpacing(2)
		F4Menu_PoliceCommandsList:SetPos(0, 20)
		F4Menu_PoliceCommandsList:EnableVerticalScrollbar(false)
		F4Menu_PoliceCommandsList.Paint = function(s, w, h)
			draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
			draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[12])
		end
		F4Menu_CommandsMain:AddItem(F4Menu_PoliceCommands)
		for _,v in ipairs(F4Menu_Reskin.CP_BUTTONS) do
			local CPButtons = vgui.Create("DButton", F4Menu_CommandsMain)
			CPButtons:SetSize(F4Menu_Commands:GetWide() - 40, 30)
			CPButtons:SetText("")
			local name = v.Name
			CPButtons.Paint = function(self, w, h)
				local col
				if self:IsHovered() then
					col = F4Menu_Reskin.Colors[5]
				else
					col = F4Menu_Reskin.Colors[6]
				end
				draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[3])
				draw.RoundedBox(0, 1, 1, w - 2, h - 2, col)
				surface.SetDrawColor(F4Menu_Reskin.Colors[17])
				surface.DrawLine(1, 1, w - 2, 1)
				surface.DrawLine(1, 1, 1, 28)
				surface.DrawLine(1, 28, w - 2, 28)
				surface.DrawLine(w - 2, 1, w - 2, 28)
				draw.SimpleText(name, "F4Menu_ButtonFont", w / 2, 7, color_white, TEXT_ALIGN_CENTER)
			end
			local comm = v.Command
			if comm then
				CPButtons:SetTooltip(comm)
			end
			CPButtons.DoClick = function()
				v.Function(1)
			end
			F4Menu_PoliceCommandsList:AddItem(CPButtons)
		end
	end
	if (F4Menu_Reskin.AccessToMayorCmds[tm] == true) then
		F4Menu_MayorCommands = vgui.Create("DCollapsibleCategory", F4Menu_CommandsMain)
		F4Menu_MayorCommands:SetSize(F4Menu_CommandsMain:GetWide(), 314)
		if mayor_closed then
			F4Menu_MayorCommands:SetExpanded(true)
		else
			F4Menu_MayorCommands:SetExpanded(false)
		end
		F4Menu_MayorCommands:SetLabel("")
		F4Menu_MayorCommands:SetPos(0, 466)
		F4Menu_MayorCommands.Paint = function(self, w, h)
			surface.SetDrawColor(F4Menu_Reskin.Colors[1])
			surface.DrawLine(0, 20, w, 20)
			draw.RoundedBox(0, 0, 0, w, 20, F4Menu_Reskin.Colors[13])
			draw.RoundedBox(0, 1, 1, w - 2, 18, F4Menu_Reskin.Colors[14])
			surface.SetDrawColor(F4Menu_Reskin.Colors[16])
			surface.DrawLine(1, 1, w - 2, 1)
			surface.DrawLine(1, 1, 1, 18)
			surface.DrawLine(1, 18, w - 2, 18)
			surface.DrawLine(w - 2, 1, w - 2, 18)
			draw.SimpleText(F4Menu_Reskin.MayorCommandsTitle, "F4Menu_CategoryTitle", 10, 3, color_white, TEXT_ALIGN_LEFT)
		end
		F4Menu_MayorCommandsList = vgui.Create("DPanelList", F4Menu_MayorCommands)
		F4Menu_MayorCommandsList:SetWide(F4Menu_CommandsMain:GetWide())
		F4Menu_MayorCommandsList:SetAutoSize(true)
		F4Menu_MayorCommandsList:SetPadding(2)
		F4Menu_MayorCommandsList:SetSpacing(2)
		F4Menu_MayorCommandsList:SetPos(0, 20)
		F4Menu_MayorCommandsList:EnableVerticalScrollbar(false)
		F4Menu_MayorCommandsList.Paint = function(s, w, h)
			draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
			draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[12])
		end
		F4Menu_CommandsMain:AddItem(F4Menu_MayorCommands)
		for _,v in ipairs(F4Menu_Reskin.MAYOR_BUTTONS) do
			local MayorButtons = vgui.Create("DButton", kfdjdk)
			MayorButtons:SetSize(F4Menu_CommandsMain:GetWide() - 40, 30)
			MayorButtons:SetText("")
			local name = v.Name
			MayorButtons.Paint = function(self, w, h)
				local col
				if self:IsHovered() then
					col = F4Menu_Reskin.Colors[5]
				else
					col = F4Menu_Reskin.Colors[6]
				end
				draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[3])
				draw.RoundedBox(0, 1, 1, w - 2, h - 2, col)
				surface.SetDrawColor(F4Menu_Reskin.Colors[17])
				surface.DrawLine(1, 1, w - 2, 1)
				surface.DrawLine(1, 1, 1, 28)
				surface.DrawLine(1, 28, w - 2, 28)
				surface.DrawLine(w - 2, 1, w - 2, 28)
				draw.SimpleText(name, "F4Menu_ButtonFont", w / 2, 7, color_white, TEXT_ALIGN_CENTER)
			end
			local comm = v.Command
			if comm then
				MayorButtons:SetTooltip(comm)
			end
			MayorButtons.DoClick = function()
				v.Function(1)
			end
			F4Menu_MayorCommandsList:AddItem(MayorButtons)
		end
	end
	if scrollbar then
		F4Menu_CommandsMain.VBar:AnimateTo(scrollbar, 0, 0, 1)
	end
end

function F4Menu_OpenCmds()
	F4Menu_Commands = vgui.Create("DFrame", F4Menu_Main)
	F4Menu_Commands:SetSize(F4Menu:GetWide() - 260, F4Menu:GetTall() - 50)
	F4Menu_Commands:SetPos(30, 30)
	F4Menu_Commands:ShowCloseButton(false)
	F4Menu_Commands:SetTitle("")
	F4Menu_Commands.Paint = function(self, w, h)
		draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[12])
	end
	F4Menu_CommandsMain = vgui.Create("DPanelList", F4Menu_Commands)
	F4Menu_CommandsMain:SetSize(F4Menu_Commands:GetWide(), F4Menu_Commands:GetTall())
	F4Menu_CommandsMain:SetPos(0, 0)
	F4Menu_CommandsMain:EnableVerticalScrollbar(true)
	F4Menu_CommandsMain.Paint = function(s, w, h)
		draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
		draw.RoundedBox(4, 0, 0, w, h, F4Menu_Reskin.Colors[12])
	end
	F4Menu_CommandsMain.VBar.Paint = function(s, w, h)
		draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
	end
	F4Menu_CommandsMain.VBar.btnUp.Paint = function(s, w, h)
	end
	F4Menu_CommandsMain.VBar.btnDown.Paint = function(s, w, h)
	end
	F4Menu_CommandsMain.VBar.btnGrip.Paint = function(s, w, h)
		draw.RoundedBox(4, 5, 0, 4, h + 22, F4Menu_Reskin.Colors[11])
	end
	F4Menu_MoneyCommands = vgui.Create("DCollapsibleCategory", F4Menu_CommandsMain)
	F4Menu_MoneyCommands:SetSize(F4Menu_CommandsMain:GetWide(), 100)
	F4Menu_MoneyCommands:SetExpanded(true)
	F4Menu_MoneyCommands:SetLabel("")
	F4Menu_MoneyCommands.PaintOver = function(self, w, h)
		surface.SetDrawColor(F4Menu_Reskin.Colors[1])
		surface.DrawLine(0, 20, w, 20)
		draw.RoundedBox(0, 0, 0, w, 20, F4Menu_Reskin.Colors[13])
		draw.RoundedBox(0, 1, 1, w - 2, 18, F4Menu_Reskin.Colors[14])
		surface.SetDrawColor(F4Menu_Reskin.Colors[16])
		surface.DrawLine(1, 1, w - 2, 1)
		surface.DrawLine(1, 1, 1, 18)
		surface.DrawLine(1, 18, w - 2, 18)
		surface.DrawLine(w - 2, 1, w - 2, 18)
		draw.SimpleText(F4Menu_Reskin.FirstCommandsTitle, "F4Menu_CategoryTitle", 10, 3, color_white, TEXT_ALIGN_LEFT)
	end
	F4Menu_MoneyCommandsList = vgui.Create("DPanelList", F4Menu_MoneyCommands)
	F4Menu_MoneyCommandsList:SetWide(F4Menu_CommandsMain:GetWide())
	F4Menu_MoneyCommandsList:SetAutoSize(true)
	F4Menu_MoneyCommandsList:SetPadding(2)
	F4Menu_MoneyCommandsList:SetSpacing(2)
	F4Menu_MoneyCommandsList:SetPos(0, 20)
	F4Menu_MoneyCommandsList:EnableVerticalScrollbar(false)
	F4Menu_MoneyCommandsList.Paint = function(s, w, h)
		draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
		draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[12])
	end
	F4Menu_RoleplayCommands = vgui.Create("DCollapsibleCategory", F4Menu_CommandsMain)
	F4Menu_RoleplayCommands:SetSize(F4Menu_CommandsMain:GetWide(), 100)
	F4Menu_RoleplayCommands:SetExpanded(true)
	F4Menu_RoleplayCommands:SetLabel("")
	F4Menu_RoleplayCommands.PaintOver = function(self, w, h)
		surface.SetDrawColor(F4Menu_Reskin.Colors[1])
		surface.DrawLine(0, 20, w, 20)
		draw.RoundedBox(0, 0, 0, w, 20, F4Menu_Reskin.Colors[13])
		draw.RoundedBox(0, 1, 1, w - 2, 18, F4Menu_Reskin.Colors[14])
		surface.SetDrawColor(F4Menu_Reskin.Colors[16])
		surface.DrawLine(1, 1, w - 2, 1)
		surface.DrawLine(1, 1, 1, 18)
		surface.DrawLine(1, 18, w - 2, 18)
		surface.DrawLine(w - 2, 1, w - 2, 18)
		draw.SimpleText(F4Menu_Reskin.SecondCommandsTitle, "F4Menu_CategoryTitle", 10, 3, color_white, TEXT_ALIGN_LEFT)
	end
	F4Menu_RoleplayCommandsList = vgui.Create("DPanelList", F4Menu_RoleplayCommands)
	F4Menu_RoleplayCommandsList:SetWide(F4Menu_CommandsMain:GetWide())
	F4Menu_RoleplayCommandsList:SetAutoSize(true)
	F4Menu_RoleplayCommandsList:SetPadding(2)
	F4Menu_RoleplayCommandsList:SetSpacing(2)
	F4Menu_RoleplayCommandsList:SetPos(0, 20)
	F4Menu_RoleplayCommandsList:EnableVerticalScrollbar(false)
	F4Menu_RoleplayCommandsList.Paint = function(s, w, h)
		draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
		draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[12])
	end
	F4Menu_OtherCommands = vgui.Create("DCollapsibleCategory", F4Menu_CommandsMain)
	F4Menu_OtherCommands:SetSize(F4Menu_CommandsMain:GetWide(), 100)
	F4Menu_OtherCommands:SetExpanded(true)
	F4Menu_OtherCommands:SetLabel("")
	F4Menu_OtherCommands.PaintOver = function(self, w, h)
		surface.SetDrawColor(F4Menu_Reskin.Colors[1])
		surface.DrawLine(0, 20, w, 20)
		draw.RoundedBox(0, 0, 0, w, 20, F4Menu_Reskin.Colors[13])
		draw.RoundedBox(0, 1, 1, w - 2, 18, F4Menu_Reskin.Colors[14])
		surface.SetDrawColor(F4Menu_Reskin.Colors[16])
		surface.DrawLine(1, 1, w - 2, 1)
		surface.DrawLine(1, 1, 1, 18)
		surface.DrawLine(1, 18, w - 2, 18)
		surface.DrawLine(w - 2, 1, w - 2, 18)
		draw.SimpleText(F4Menu_Reskin.ThirdCommandsTitle, "F4Menu_CategoryTitle", 10, 3, color_white, TEXT_ALIGN_LEFT)
	end
	F4Menu_OtherCommandsList = vgui.Create("DPanelList", F4Menu_OtherCommands)
	F4Menu_OtherCommandsList:SetWide(F4Menu_CommandsMain:GetWide())
	F4Menu_OtherCommandsList:SetAutoSize(true)
	F4Menu_OtherCommandsList:SetPadding(2)
	F4Menu_OtherCommandsList:SetSpacing(2)
	F4Menu_OtherCommandsList:SetPos(0, 20)
	F4Menu_OtherCommandsList:EnableVerticalScrollbar(false)
	F4Menu_OtherCommandsList.Paint = function(s, w, h)
		draw.RoundedBox(4, 3, 13, 8, h - 24, F4Menu_Reskin.Colors[11])
		draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[12])
	end
	F4Menu_CommandsMain:AddItem(F4Menu_MoneyCommands)
	F4Menu_CommandsMain:AddItem(F4Menu_RoleplayCommands)
	F4Menu_CommandsMain:AddItem(F4Menu_OtherCommands)
	for _,v in ipairs(F4Menu_Reskin.MONEY_BUTTONS) do
		local EconomyButtons = vgui.Create("DButton", F4Menu_CommandsMain)
		EconomyButtons:SetSize(F4Menu_Commands:GetWide() - 40, 30)
		EconomyButtons:SetText("")
		local name = v.Name
		EconomyButtons.Paint = function(self, w, h)
			local col
			if self:IsHovered() then
				col = F4Menu_Reskin.Colors[5]
			else
				col = F4Menu_Reskin.Colors[6]
			end
			draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[3])
			draw.RoundedBox(0, 1, 1, w - 2, h - 2, col)
			surface.SetDrawColor(F4Menu_Reskin.Colors[17])
			surface.DrawLine(1, 1, w - 2, 1)
			surface.DrawLine(1, 1, 1, 28)
			surface.DrawLine(1, 28, w - 2, 28)
			surface.DrawLine(w - 2, 1, w - 2, 28)
			draw.SimpleText(name, "F4Menu_ButtonFont", w / 2, 7, color_white, TEXT_ALIGN_CENTER)
		end
		local comm = v.Command
		if comm then
			EconomyButtons:SetTooltip(comm)
		end
		EconomyButtons.DoClick = function()
			v.Function(1)
		end
		F4Menu_MoneyCommandsList:AddItem(EconomyButtons)
	end
	for _,v in ipairs(F4Menu_Reskin.RP_BUTTONS) do
		local RoleplayButtons = vgui.Create("DButton", F4Menu_CommandsMain)
		RoleplayButtons:SetSize(F4Menu_Commands:GetWide() - 40, 30)
		RoleplayButtons:SetText("")
		local name = v.Name
		RoleplayButtons.Paint = function(self, w, h)
			local col
			if self:IsHovered() then
				col = F4Menu_Reskin.Colors[5]
			else
				col = F4Menu_Reskin.Colors[6]
			end
			draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[3])
			draw.RoundedBox(0, 1, 1, w - 2, h - 2, col)
			surface.SetDrawColor(F4Menu_Reskin.Colors[17])
			surface.DrawLine(1, 1, w - 2, 1)
			surface.DrawLine(1, 1, 1, 28)
			surface.DrawLine(1, 28, w - 2, 28)
			surface.DrawLine(w - 2, 1, w - 2, 28)
			draw.SimpleText(name, "F4Menu_ButtonFont", w / 2, 7, color_white, TEXT_ALIGN_CENTER)
		end
		local comm = v.Command
		if comm then
			RoleplayButtons:SetTooltip(comm)
		end
		RoleplayButtons.DoClick = function()
			v.Function(1)
		end
		F4Menu_RoleplayCommandsList:AddItem(RoleplayButtons)
	end
	for _,v in ipairs(F4Menu_Reskin.OTHER_BUTTONS) do
		local OtherButtons = vgui.Create("DButton", F4Menu_CommandsMain)
		OtherButtons:SetSize(F4Menu_Commands:GetWide() - 40, 30)
		OtherButtons:SetText("")
		local name = v.Name
		OtherButtons.Paint = function(self, w, h)
			local col
			if self:IsHovered() then
				col = F4Menu_Reskin.Colors[5]
			else
				col = F4Menu_Reskin.Colors[6]
			end
			draw.RoundedBox(0, 0, 0, w, h, F4Menu_Reskin.Colors[3])
			draw.RoundedBox(0, 1, 1, w - 2, h - 2, col)
			surface.SetDrawColor(F4Menu_Reskin.Colors[17])
			surface.DrawLine(1, 1, w - 2, 1)
			surface.DrawLine(1, 1, 1, 28)
			surface.DrawLine(1, 28, w - 2, 28)
			surface.DrawLine(w - 2, 1, w - 2, 28)
			draw.SimpleText(name, "F4Menu_ButtonFont", w / 2, 7, color_white, TEXT_ALIGN_CENTER)
		end
		local comm = v.Command
		if comm then
			OtherButtons:SetTooltip(comm)
		end
		OtherButtons.DoClick = function()
			v.Function(1)
		end
		F4Menu_OtherCommandsList:AddItem(OtherButtons)
	end
	F4Menu_AddRefreshedCommandsList()
	F4Menu_Commands:SetVisible(false)
end