diff --git a/config/cvars.cfg b/config/cvars.cfg index 4cc3c4d..43e331b 100644 --- a/config/cvars.cfg +++ b/config/cvars.cfg @@ -20,9 +20,9 @@ set g_restrictedVotes "" set g_renameLimit 3 set g_renameInterval 60 +set g_playerHistory 1 + set g_spreeRecords 1 set g_botRecords 1 -set g_warnHistory 1 - -set g_announceRevives 1 \ No newline at end of file +set g_announceRevives 1 diff --git a/luamods/wolfadmin/commands/admin/ban.lua b/luamods/wolfadmin/commands/admin/ban.lua index a42db24..088ae5a 100644 --- a/luamods/wolfadmin/commands/admin/ban.lua +++ b/luamods/wolfadmin/commands/admin/ban.lua @@ -73,7 +73,10 @@ function commandBan(clientId, command, victim, ...) end bans.add(cmdClient, clientId, duration, reason) - history.add(cmdClient, clientId, "ban", reason) + + if settings.get("g_playerHistory") ~= 0 then + history.add(cmdClient, clientId, "ban", reason) + end et.trap_SendConsoleCommand(et.EXEC_APPEND, "cchat -1 \"^dban: ^7"..et.gentity_get(cmdClient, "pers.netname").." ^9has been banned for "..duration.." seconds\";") diff --git a/luamods/wolfadmin/commands/admin/kick.lua b/luamods/wolfadmin/commands/admin/kick.lua index f9318c6..870930a 100644 --- a/luamods/wolfadmin/commands/admin/kick.lua +++ b/luamods/wolfadmin/commands/admin/kick.lua @@ -58,7 +58,10 @@ function commandKick(clientId, command, victim, ...) local reason = table.concat({...}, " ") admin.kickPlayer(cmdClient, clientId, reason) - history.add(cmdClient, clientId, "kick", reason) + + if settings.get("g_playerHistory") ~= 0 then + history.add(cmdClient, clientId, "kick", reason) + end return true end diff --git a/luamods/wolfadmin/commands/admin/showhistory.lua b/luamods/wolfadmin/commands/admin/showhistory.lua index 7e2c146..ca7ccf1 100644 --- a/luamods/wolfadmin/commands/admin/showhistory.lua +++ b/luamods/wolfadmin/commands/admin/showhistory.lua @@ -28,8 +28,8 @@ local pagination = require (wolfa_getLuaPath()..".util.pagination") local settings = require (wolfa_getLuaPath()..".util.settings") function commandListHistory(clientId, command, victim, offset) - if settings.get("g_standalone") == 0 or not db.isconnected() then - et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshowhistory: ^9warn history is disabled.\";") + if not db.isconnected() or settings.get("g_playerHistory") == 0 then + et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay "..clientId.." \"^dshowhistory: ^9player history is disabled.\";") return true elseif victim == nil then @@ -70,4 +70,4 @@ function commandListHistory(clientId, command, victim, offset) return true end -commands.addadmin("showhistory", commandListHistory, auth.PERM_LISTHISTORY, "display history for a specific player", "^9[^3name|slot#^9] ^9(^hoffset^9)", nil, (settings.get("g_standalone") == 0)) +commands.addadmin("showhistory", commandListHistory, auth.PERM_LISTHISTORY, "display history for a specific player", "^9[^3name|slot#^9] ^9(^hoffset^9)", (settings.get("g_playerHistory") == 0)) diff --git a/luamods/wolfadmin/commands/admin/warn.lua b/luamods/wolfadmin/commands/admin/warn.lua index a93d269..327208d 100644 --- a/luamods/wolfadmin/commands/admin/warn.lua +++ b/luamods/wolfadmin/commands/admin/warn.lua @@ -17,7 +17,6 @@ local auth = require (wolfa_getLuaPath()..".auth.auth") -local admin = require (wolfa_getLuaPath()..".admin.admin") local history = require (wolfa_getLuaPath()..".admin.history") local db = require (wolfa_getLuaPath()..".db.db") @@ -29,7 +28,7 @@ local players = require (wolfa_getLuaPath()..".players.players") local settings = require (wolfa_getLuaPath()..".util.settings") function commandWarn(clientId, command, victim, ...) - if settings.get("g_warnHistory") == 0 or not db.isconnected() then + if not db.isconnected() or settings.get("g_playerHistory") == 0 then return false elseif not victim or not ... then return false @@ -49,7 +48,7 @@ function commandWarn(clientId, command, victim, ...) return false end -commands.addadmin("warn", commandWarn, auth.PERM_WARN, "warns a player by displaying the reason", "^9[^3name|slot#^9] ^9[^3reason^9]", true, (settings.get("g_standalone") == 1)) +commands.addadmin("warn", commandWarn, auth.PERM_WARN, "warns a player by displaying the reason", "^9[^3name|slot#^9] ^9[^3reason^9]", true, (settings.get("g_standalone") == 1 or settings.get("g_playerHistory") == 0)) function commandWarn(clientId, command, victim, ...) if not victim or not ... then @@ -80,7 +79,9 @@ function commandWarn(clientId, command, victim, ...) local reason = table.concat({...}, " ") - history.add(cmdClient, clientId, "warn", reason) + if settings.get("g_playerHistory") ~= 0 then + history.add(cmdClient, clientId, "warn", reason) + end et.trap_SendConsoleCommand(et.EXEC_APPEND, "ccp "..cmdClient.." \"^7You have been warned by "..players.getName(clientId)..": ^7"..reason..".\";") et.trap_SendConsoleCommand(et.EXEC_APPEND, "csay -1 \"^dwarn: ^7"..players.getName(cmdClient).." ^9has been warned.\";") diff --git a/luamods/wolfadmin/util/settings.lua b/luamods/wolfadmin/util/settings.lua index 28f6fca..2c4598f 100644 --- a/luamods/wolfadmin/util/settings.lua +++ b/luamods/wolfadmin/util/settings.lua @@ -15,7 +15,6 @@ -- You should have received a copy of the GNU General Public License -- along with this program. If not, see . -local util = require (wolfa_getLuaPath()..".util.util") local events = require (wolfa_getLuaPath()..".util.events") local settings = {} @@ -25,14 +24,12 @@ local data = { ["g_logAdmin"] = "admin.log", ["g_fileGreetings"] = "greetings.cfg", ["g_fileRules"] = "rules.cfg", - ["g_fileSprees"] = "sprees.cfg", - ["g_jukeboxEnabled"] = 0, + ["g_playerHistory"] = 1, ["g_spreeRecords"] = 1, - ["g_warnHistory"] = 1, + ["g_botRecords"] = 1, ["g_announceRevives"] = 1, ["g_greetingArea"] = 3, ["g_botGreetings"] = 1, - ["g_botRecords"] = 1, ["g_welcomeMessage"] = "^dwolfadmin: ^9This server is running WolfAdmin, type ^7/wolfadmin ^9for more information.", ["g_welcomeArea"] = 3, ["g_evenerMinDifference"] = 2,