mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Check if player exists on use of /privs (#7554)
* /privs: Check if player exists
This commit is contained in:
@@ -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), ' ')
|
||||
|
Reference in New Issue
Block a user