mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Chat commands: Trim whitespaces from input of /privs
command
This commit is contained in:
parent
91250c1078
commit
c7d569b863
@ -147,11 +147,12 @@ core.register_chatcommand("help", {
|
|||||||
core.register_chatcommand("privs", {
|
core.register_chatcommand("privs", {
|
||||||
params = "<name>",
|
params = "<name>",
|
||||||
description = "print out privileges of player",
|
description = "print out privileges of player",
|
||||||
func = function(name, param)
|
func = function(caller, param)
|
||||||
param = (param ~= "" and param or name)
|
param = param:trim()
|
||||||
return true, "Privileges of " .. param .. ": "
|
local name = (param ~= "" and param or caller)
|
||||||
|
return true, "Privileges of " .. name .. ": "
|
||||||
.. core.privs_to_string(
|
.. core.privs_to_string(
|
||||||
core.get_player_privs(param), ' ')
|
core.get_player_privs(name), ' ')
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user