diff --git a/lua/moderator/commands/sh_ban.lua b/lua/moderator/commands/sh_ban.lua index 19eb6d1..a361e74 100644 --- a/lua/moderator/commands/sh_ban.lua +++ b/lua/moderator/commands/sh_ban.lua @@ -9,8 +9,6 @@ local COMMAND = {} COMMAND.example = "!ban Troll 1w \"being a troll, banned for a week\" - Bans a troll for one week." function COMMAND:OnRun(client, arguments, target) - local target = moderator.FindPlayerByName(arguments[1], false, 1) - if (!target and !arguments[1]:match("STEAM_[0-5]:[0-9]:[0-9]+") and arguments[1]:lower() != "bot") then return false, "you need to provide a valid player or steamID." end diff --git a/lua/moderator/commands/sh_kick.lua b/lua/moderator/commands/sh_kick.lua index 5373ae0..2985eef 100644 --- a/lua/moderator/commands/sh_kick.lua +++ b/lua/moderator/commands/sh_kick.lua @@ -9,7 +9,11 @@ local COMMAND = {} local reason = "no reason" if (#arguments > 0) then - reason = table.concat(arguments, " ") + if (isstring(arguments[1])) then + reason = table.concat(arguments, " ") + else + reason = arguments[2] + end end local oldReason = reason @@ -69,4 +73,4 @@ local COMMAND = {} end) end end -moderator.commands.kick = COMMAND \ No newline at end of file +moderator.commands.kick = COMMAND diff --git a/lua/moderator/commands/sh_map.lua b/lua/moderator/commands/sh_map.lua index e2ebfd8..37a8800 100644 --- a/lua/moderator/commands/sh_map.lua +++ b/lua/moderator/commands/sh_map.lua @@ -1,3 +1,9 @@ +--[[ + Moderator Map Command + Last Updated: 10/31/2015 + Purpose: A command that allows the client to change the map to an existing one on the server. +]] + local COMMAND = {} COMMAND.name = "Map" COMMAND.icon = "map" @@ -8,18 +14,15 @@ local COMMAND = {} function COMMAND:OnRun(client, arguments) local map = arguments[1] - local currentmap = game.GetMap() - if map && file.Exists("maps/"..map..".bsp", "GAME") then + if map && file.Exists("maps/"..map..".bsp", "GAME") then -- Need to see if the file exists naturally. moderator.NotifyAction(client, nil, "has changed the map to "..map) - timer.Simple(0.5, function() + timer.Simple(0.5, function() -- We do a timer just to add a slight delay. RunConsoleCommand("changelevel", map) end) - elseif map == currentmap then - client:ChatPrint("You can't change the map to the map we're already on!") - else + else -- If all else fails, the map just doesn't exist. client:ChatPrint("That is not a valid map!") end end -moderator.commands.map = COMMAND \ No newline at end of file +moderator.commands.map = COMMAND diff --git a/lua/moderator/derma/menus/cl_groups.lua b/lua/moderator/derma/menus/cl_groups.lua index 333c12c..6dab819 100644 --- a/lua/moderator/derma/menus/cl_groups.lua +++ b/lua/moderator/derma/menus/cl_groups.lua @@ -90,6 +90,16 @@ local CATEGORY = {} name:SetTall(24) name:DockMargin(4, 0, 4, 4) panel.name = name + + panel:AddHeader("Colour", content) + + local colour = content:Add("DColorMixer") + colour:Dock(TOP) + colour:SetTall(186) + colour:DockMargin(4, 0, 4, 4) + colour:SetPalette(false) + colour:SetAlphaBar(false) + panel.colour = colour panel:AddHeader("Icon", content) @@ -167,6 +177,13 @@ local CATEGORY = {} choose:SetValue(value) lastName = value end + + print(groupTable.colour) + colour:SetColor(groupTable.colour or Color(255, 255, 255)) + + colour.ValueChanged = function(this) + moderator.UpdateGroup(data, "colour", colour:GetColor()) + end icons:SelectIcon("icon16/"..(groupTable.icon or "user")..".png") icons:ScrollToSelected() diff --git a/lua/moderator/derma/menus/cl_players.lua b/lua/moderator/derma/menus/cl_players.lua index 9e6363c..b5436a5 100644 --- a/lua/moderator/derma/menus/cl_players.lua +++ b/lua/moderator/derma/menus/cl_players.lua @@ -92,7 +92,7 @@ local CATEGORY = {} Send(...) end - v:OnClick() + v:OnClick(v.menu, LocalPlayer()) v.menu:Open() v.menu = nil else @@ -264,9 +264,9 @@ local CATEGORY = {} surface.DrawOutlinedRect(0, 0, w, h) if (self.playerSet) then - local teamColor = team.GetColor(self.player:Team()) + local rankcolour = moderator.GetGroupTable(moderator.GetGroup(self.player)).colour - surface.SetDrawColor(teamColor) + surface.SetDrawColor(rankcolour) surface.DrawRect(w - 7, 1, 6, h - 2) end end @@ -322,4 +322,4 @@ moderator.menus.players = CATEGORY concommand.Add("mod_clearselected", function() moderator.selected = {} -end) \ No newline at end of file +end) diff --git a/lua/moderator/libs/sh_groups.lua b/lua/moderator/libs/sh_groups.lua index b4c6cca..db7389e 100644 --- a/lua/moderator/libs/sh_groups.lua +++ b/lua/moderator/libs/sh_groups.lua @@ -4,16 +4,18 @@ if (!moderator.groups) then moderator.groups = {} moderator.groups.owner = { - immunity = 99, name = "Owner", + icon = "key", + colour = Color(41, 128, 185), access = true, - icon = "key" + immunity = 99 } moderator.groups.superadmin = { name = "Super Admin", inherit = "admin", icon = "shield", + colour = Color(115, 30, 171), immunity = 15 } @@ -21,6 +23,7 @@ if (!moderator.groups) then name = "Admin", inherit = "moderator", icon = "star", + colour = Color(149, 15, 15), access = { ["arm"] = true, ["armor"] = true, @@ -38,7 +41,9 @@ if (!moderator.groups) then moderator.groups.moderator = { name = "Moderator", + inherit = "user", icon = "wrench", + colour = Color(216, 128, 26), access = { ["goto"] = true, ["tp"] = true, @@ -47,13 +52,13 @@ if (!moderator.groups) then ["freeze"] = true, ["return"] = true }, - inherit = "user", immunity = 5 } moderator.groups.user = { name = "User", immunity = 0, + colour = Color(166, 166, 166), access = { ["report"] = true } @@ -70,7 +75,8 @@ moderator.defaultGroups["user"] = true moderator.templateGroup = { name = "New Group", immunity = 0, - icon = "user" + icon = "user", + colour = Color(255, 255, 255) } if (SERVER) then