Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions lua/moderator/commands/sh_ban.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions lua/moderator/commands/sh_kick.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -69,4 +73,4 @@ local COMMAND = {}
end)
end
end
moderator.commands.kick = COMMAND
moderator.commands.kick = COMMAND
17 changes: 10 additions & 7 deletions lua/moderator/commands/sh_map.lua
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
moderator.commands.map = COMMAND
17 changes: 17 additions & 0 deletions lua/moderator/derma/menus/cl_groups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions lua/moderator/derma/menus/cl_players.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ local CATEGORY = {}
Send(...)
end

v:OnClick()
v:OnClick(v.menu, LocalPlayer())
v.menu:Open()
v.menu = nil
else
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -322,4 +322,4 @@ moderator.menus.players = CATEGORY

concommand.Add("mod_clearselected", function()
moderator.selected = {}
end)
end)
14 changes: 10 additions & 4 deletions lua/moderator/libs/sh_groups.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,26 @@ 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
}

moderator.groups.admin = {
name = "Admin",
inherit = "moderator",
icon = "star",
colour = Color(149, 15, 15),
access = {
["arm"] = true,
["armor"] = true,
Expand All @@ -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,
Expand All @@ -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
}
Expand All @@ -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
Expand Down