forked from Mirrorlandia_minetest/minetest
Message for empty list output in /haspriv & /mods (#11149)
This commit is contained in:
parent
fbcf0fab8e
commit
dc165fe942
@ -212,10 +212,15 @@ core.register_chatcommand("haspriv", {
|
|||||||
table.insert(players_with_priv, player_name)
|
table.insert(players_with_priv, player_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if #players_with_priv == 0 then
|
||||||
|
return true, S("No online player has the \"@1\" privilege.",
|
||||||
|
param)
|
||||||
|
else
|
||||||
return true, S("Players online with the \"@1\" privilege: @2",
|
return true, S("Players online with the \"@1\" privilege: @2",
|
||||||
param,
|
param,
|
||||||
table.concat(players_with_priv, ", "))
|
table.concat(players_with_priv, ", "))
|
||||||
end
|
end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
local function handle_grant_command(caller, grantname, grantprivstr)
|
local function handle_grant_command(caller, grantname, grantprivstr)
|
||||||
@ -737,7 +742,12 @@ core.register_chatcommand("mods", {
|
|||||||
description = S("List mods installed on the server"),
|
description = S("List mods installed on the server"),
|
||||||
privs = {},
|
privs = {},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
|
local mods = core.get_modnames()
|
||||||
|
if #mods == 0 then
|
||||||
|
return true, S("No mods installed.")
|
||||||
|
else
|
||||||
return true, table.concat(core.get_modnames(), ", ")
|
return true, table.concat(core.get_modnames(), ", ")
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user