1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-06-30 23:50:21 +02:00

Added /list_players - Added /list_players extracted from mt_essentials by IndriAppolo, originally called /players. Solves #57

This commit is contained in:
LeMagnesium 2015-05-21 17:28:31 +02:00
parent 9a0547a54e
commit 4b7d5935fb
2 changed files with 21 additions and 0 deletions

View File

@ -24,3 +24,6 @@ dofile(minetest.get_modpath("_misc").."/craft_obsidian.lua")
-- UnCraft Woll
dofile(minetest.get_modpath("_misc").."/uncraft_woll.lua")
-- List players
dofile(minetest.get_modpath("_misc").."/list_players.lua")

View File

@ -0,0 +1,18 @@
-- list_players
-- Extracted from MT_essentials, by IndriAppolo
--
minetest.register_chatcommand("list_players", {
params = "",
description = "List currentky connected players",
func = function(name,param)
local list
for i,player in ipairs(minetest.get_connected_players()) do
local lname = player:get_player_name()
if not list then list = lname.." "
else list = list..lname.." " end
end
minetest.chat_send_player(name,"-- "..table.getn(minetest.get_connected_players()).." player(s) connected --\n"..list)
return true
end,
})