Skip to content

Commit 6b102ce

Browse files
EzhhSmallJoker
authored andcommittedNov 13, 2018
Rename hasprivs command to haspriv (#7860)
1 parent 657a3d1 commit 6b102ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

Diff for: ‎builtin/game/chatcommands.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -106,28 +106,28 @@ core.register_chatcommand("privs", {
106106
end,
107107
})
108108

109-
core.register_chatcommand("hasprivs", {
109+
core.register_chatcommand("haspriv", {
110110
params = "<privilege>",
111111
description = "Return list of all online players with privilege.",
112112
privs = {basic_privs = true},
113113
func = function(caller, param)
114114
param = param:trim()
115115
if param == "" then
116-
return false, "Invalid parameters (see /help hasprivs)"
116+
return false, "Invalid parameters (see /help haspriv)"
117117
end
118118
if not core.registered_privileges[param] then
119119
return false, "Unknown privilege!"
120120
end
121121
local privs = core.string_to_privs(param)
122-
local players_with_privs = {}
122+
local players_with_priv = {}
123123
for _, player in pairs(core.get_connected_players()) do
124124
local player_name = player:get_player_name()
125125
if core.check_player_privs(player_name, privs) then
126-
table.insert(players_with_privs, player_name)
126+
table.insert(players_with_priv, player_name)
127127
end
128128
end
129-
return true, "Players online with the \"" .. param .. "\" priv: " ..
130-
table.concat(players_with_privs, ", ")
129+
return true, "Players online with the \"" .. param .. "\" privilege: " ..
130+
table.concat(players_with_priv, ", ")
131131
end
132132
})
133133

0 commit comments

Comments
 (0)