mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-26 01:03:48 +01:00
standardize var name and reduce looping
This commit is contained in:
parent
62684884b9
commit
c8c83fb4b1
12
init.lua
12
init.lua
@ -280,18 +280,16 @@ function cc.info(player_name, params)
|
|||||||
if not facts[faction_name] then
|
if not facts[faction_name] then
|
||||||
return false, S("Faction @1 doesn't exist.", faction_name)
|
return false, S("Faction @1 doesn't exist.", faction_name)
|
||||||
else
|
else
|
||||||
local fmembers = {}
|
local faction_members
|
||||||
if table.getn(facts[faction_name].members) > factions.max_members_list then
|
if table.getn(facts[faction_name].members) > factions.max_members_list then
|
||||||
table.insert(fmembers, S("The faction has more than @1 members,"
|
faction_members = { S("The faction has more than @1 members,"
|
||||||
.. " the members list can't be shown.", factions.max_members_list))
|
.. " the members list can't be shown.", factions.max_members_list) }
|
||||||
else
|
else
|
||||||
for play in pairs(facts[faction_name].members) do
|
faction_members = facts[faction_name].members
|
||||||
table.insert(fmembers, play)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
local summary = S("Name: @1\nOwner: @2\nMembers: @3",
|
local summary = S("Name: @1\nOwner: @2\nMembers: @3",
|
||||||
faction_name, factions.get_owner(faction_name),
|
faction_name, factions.get_owner(faction_name),
|
||||||
table.concat(fmembers, ", "))
|
table.concat(faction_members, ", "))
|
||||||
return true, summary
|
return true, summary
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user