summaryrefslogtreecommitdiff
path: root/builtin/client/chatcommands.lua
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/client/chatcommands.lua')
-rw-r--r--builtin/client/chatcommands.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/client/chatcommands.lua b/builtin/client/chatcommands.lua
index ed43a6140..201ca4a9b 100644
--- a/builtin/client/chatcommands.lua
+++ b/builtin/client/chatcommands.lua
@@ -40,8 +40,13 @@ end)
core.register_chatcommand("list_players", {
description = core.gettext("List online players"),
func = function(param)
- local players = table.concat(core.get_player_names(), ", ")
- core.display_chat_message(core.gettext("Online players: ") .. players)
+ local player_names = core.get_player_names()
+ if not player_names then
+ return false, core.gettext("This command is disabled by server.")
+ end
+
+ local players = table.concat(player_names, ", ")
+ return true, core.gettext("Online players: ") .. players
end
})