aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorEzhh <owlecho@live.com>2018-11-13 19:24:20 +0000
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-11-13 20:24:20 +0100
commit6b102ce51f01a381ab6356931689d85528455a50 (patch)
tree5e00b2b5448d0da961f119c66577cedf20745a71 /builtin
parent657a3d1e0527a12a6e22e1f7eda0f5271cbeb917 (diff)
downloadminetest-6b102ce51f01a381ab6356931689d85528455a50.tar.gz
minetest-6b102ce51f01a381ab6356931689d85528455a50.tar.bz2
minetest-6b102ce51f01a381ab6356931689d85528455a50.zip
Rename hasprivs command to haspriv (#7860)
Diffstat (limited to 'builtin')
-rw-r--r--builtin/game/chatcommands.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index b7f228c1b..60d5d4788 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -106,28 +106,28 @@ core.register_chatcommand("privs", {
end,
})
-core.register_chatcommand("hasprivs", {
+core.register_chatcommand("haspriv", {
params = "<privilege>",
description = "Return list of all online players with privilege.",
privs = {basic_privs = true},
func = function(caller, param)
param = param:trim()
if param == "" then
- return false, "Invalid parameters (see /help hasprivs)"
+ return false, "Invalid parameters (see /help haspriv)"
end
if not core.registered_privileges[param] then
return false, "Unknown privilege!"
end
local privs = core.string_to_privs(param)
- local players_with_privs = {}
+ local players_with_priv = {}
for _, player in pairs(core.get_connected_players()) do
local player_name = player:get_player_name()
if core.check_player_privs(player_name, privs) then
- table.insert(players_with_privs, player_name)
+ table.insert(players_with_priv, player_name)
end
end
- return true, "Players online with the \"" .. param .. "\" priv: " ..
- table.concat(players_with_privs, ", ")
+ return true, "Players online with the \"" .. param .. "\" privilege: " ..
+ table.concat(players_with_priv, ", ")
end
})