mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-22 15:23:47 +01:00
Add the member list in /faction info
This commit is contained in:
parent
d9844f27e4
commit
8e4aa0db51
13
init.lua
13
init.lua
@ -163,11 +163,22 @@ local function handle_command(name, param)
|
|||||||
local faction_name = params[2]
|
local faction_name = params[2]
|
||||||
if faction_name == nil then
|
if faction_name == nil then
|
||||||
faction_name = factions.get_player_faction(name)
|
faction_name = factions.get_player_faction(name)
|
||||||
|
minetest.chat_send_player(name, S("No faction were given, returning information about your oldest faction (e.g. the oldest created faction you are in)"))
|
||||||
end
|
end
|
||||||
if faction_name == nil then
|
if faction_name == nil then
|
||||||
minetest.chat_send_player(name, S("Missing faction name"))
|
minetest.chat_send_player(name, S("Missing faction name"))
|
||||||
|
elseif facts[faction_name] == nil then
|
||||||
|
minetest.chat_send_player(name, S("This faction is not registered"))
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(name, S("Owner: @1", factions.get_owner(faction_name)))
|
local fmembers = ""
|
||||||
|
for play,_ in pairs(facts[faction_name].members) do
|
||||||
|
if fmembers == "" then
|
||||||
|
fmembers = play
|
||||||
|
else
|
||||||
|
fmembers = fmembers..", "..play
|
||||||
|
end
|
||||||
|
end
|
||||||
|
minetest.chat_send_player(name, S("Name: @1\nOwner: @2\nMembers: #@3", faction_name, factions.get_owner(faction_name), fmembers))
|
||||||
if factions.get_owner(faction_name) == name then
|
if factions.get_owner(faction_name) == name then
|
||||||
minetest.chat_send_player(name, S("Password: @1", factions.get_password(faction_name)))
|
minetest.chat_send_player(name, S("Password: @1", factions.get_password(faction_name)))
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user