forked from mtcontrib/factions
Corrige le fonctionnement du chat des factions et l'aide
This commit is contained in:
parent
3287b6793f
commit
a596a1bf35
@ -360,7 +360,7 @@ function factions_chat.allfactions_chathandler(playername,parameter)
|
||||
local recipients = {}
|
||||
|
||||
for faction,value in pairs(factions.get_factions(player)) do
|
||||
for name,value in pairs(factions.dynamic_data.membertable[faction]) do
|
||||
for name,val in pairs(factions.dynamic_data.membertable[value]) do
|
||||
local object_to_check = minetest.get_player_by_name(name)
|
||||
|
||||
if object_to_check ~= nil then
|
||||
@ -405,16 +405,15 @@ function factions_chat.chathandler(playername,parameter)
|
||||
local valid_faction = false
|
||||
|
||||
for faction,value in pairs(factions.get_factions(player)) do
|
||||
if target_faction == faction then
|
||||
if target_faction == value then
|
||||
valid_faction = true
|
||||
end
|
||||
end
|
||||
|
||||
if faction ~= nil and valid_faction and
|
||||
factions.dynamic_data.membertable[faction] ~= nil then
|
||||
for name,value in pairs(factions.dynamic_data.membertable[faction]) do
|
||||
if target_faction ~= nil and valid_faction and
|
||||
factions.dynamic_data.membertable[target_faction] ~= nil then
|
||||
for name,value in pairs(factions.dynamic_data.membertable[target_faction]) do
|
||||
local object_to_check = minetest.get_player_by_name(name)
|
||||
factions_chat.show_help(playername)
|
||||
if object_to_check ~= nil and
|
||||
name ~= playername then
|
||||
minetest.chat_send_player(name,playername ..": " .. text,false)
|
||||
@ -422,7 +421,7 @@ function factions_chat.chathandler(playername,parameter)
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(playername,
|
||||
"Factions: you're not a member of " .. dump(faction),false)
|
||||
"Factions: you're not a member of " .. dump(target_faction),false)
|
||||
end
|
||||
return
|
||||
end
|
||||
@ -456,10 +455,10 @@ function factions_chat.show_help(playername)
|
||||
|
||||
MSG("\tAdmin commands:")
|
||||
MSG("\t\t/factions create <factionname> -> create a new faction")
|
||||
MSG("\t\t/factions delete <factionname> -> delete a faction faction")
|
||||
MSG("\t\t/factions delete <factionname> -> delete a faction")
|
||||
MSG("\t\t/factions leave <factionname> <playername> -> remove player from faction")
|
||||
MSG("\t\t/factions invite <factionname> <playername> -> invite player to faction")
|
||||
MSG("\t\t/factions set_free <factionname> <value> -> set faction free to join")
|
||||
MSG("\t\t/factions admin <factionname> <playername> <value> -> make player admin of faction")
|
||||
MSG("\t\t/factions set_free <factionname> <true|false> -> set faction free to join")
|
||||
MSG("\t\t/factions admin <factionname> <playername> <true|false> -> make player admin of faction")
|
||||
MSG("\t\t/factions description <factionname> <text> -> set description for faction")
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user