mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 17:50:37 +01:00
Added /list_players
- Added /list_players extracted from `mt_essentials` by IndriAppolo, originally called /players. Solves #57
This commit is contained in:
parent
d9e50da65d
commit
34b36d7f66
@ -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")
|
||||
|
18
mods/_misc/list_players.lua
Normal file
18
mods/_misc/list_players.lua
Normal 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,
|
||||
})
|
Loading…
Reference in New Issue
Block a user