Skip to content

Commit

Permalink
Check if player exists on use of /privs (#7554)
Browse files Browse the repository at this point in the history
* /privs: Check if player exists
  • Loading branch information
ClobberXD authored and nerzhul committed Jul 16, 2018
1 parent 1aaee5b commit a0635f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion builtin/game/chatcommands.lua
Expand Up @@ -84,7 +84,7 @@ core.register_chatcommand("admin", {
func = function(name)
local admin = core.settings:get("name")
if admin then
return true, "The administrator of this server is "..admin.."."
return true, "The administrator of this server is " .. admin .. "."
else
return false, "There's no administrator named in the config file."
end
Expand All @@ -97,6 +97,9 @@ core.register_chatcommand("privs", {
func = function(caller, param)
param = param:trim()
local name = (param ~= "" and param or caller)
if not core.player_exists(name) then
return false, "Player " .. name .. " does not exist."
end
return true, "Privileges of " .. name .. ": "
.. core.privs_to_string(
core.get_player_privs(name), ' ')
Expand Down

0 comments on commit a0635f6

Please sign in to comment.