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 = {}
|
local recipients = {}
|
||||||
|
|
||||||
for faction,value in pairs(factions.get_factions(player)) do
|
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)
|
local object_to_check = minetest.get_player_by_name(name)
|
||||||
|
|
||||||
if object_to_check ~= nil then
|
if object_to_check ~= nil then
|
||||||
@ -405,16 +405,15 @@ function factions_chat.chathandler(playername,parameter)
|
|||||||
local valid_faction = false
|
local valid_faction = false
|
||||||
|
|
||||||
for faction,value in pairs(factions.get_factions(player)) do
|
for faction,value in pairs(factions.get_factions(player)) do
|
||||||
if target_faction == faction then
|
if target_faction == value then
|
||||||
valid_faction = true
|
valid_faction = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if faction ~= nil and valid_faction and
|
if target_faction ~= nil and valid_faction and
|
||||||
factions.dynamic_data.membertable[faction] ~= nil then
|
factions.dynamic_data.membertable[target_faction] ~= nil then
|
||||||
for name,value in pairs(factions.dynamic_data.membertable[faction]) do
|
for name,value in pairs(factions.dynamic_data.membertable[target_faction]) do
|
||||||
local object_to_check = minetest.get_player_by_name(name)
|
local object_to_check = minetest.get_player_by_name(name)
|
||||||
factions_chat.show_help(playername)
|
|
||||||
if object_to_check ~= nil and
|
if object_to_check ~= nil and
|
||||||
name ~= playername then
|
name ~= playername then
|
||||||
minetest.chat_send_player(name,playername ..": " .. text,false)
|
minetest.chat_send_player(name,playername ..": " .. text,false)
|
||||||
@ -422,7 +421,7 @@ function factions_chat.chathandler(playername,parameter)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(playername,
|
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
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -456,10 +455,10 @@ function factions_chat.show_help(playername)
|
|||||||
|
|
||||||
MSG("\tAdmin commands:")
|
MSG("\tAdmin commands:")
|
||||||
MSG("\t\t/factions create <factionname> -> create a new faction")
|
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 leave <factionname> <playername> -> remove player from faction")
|
||||||
MSG("\t\t/factions invite <factionname> <playername> -> invite player to 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 set_free <factionname> <true|false> -> set faction free to join")
|
||||||
MSG("\t\t/factions admin <factionname> <playername> <value> -> make player admin of faction")
|
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")
|
MSG("\t\t/factions description <factionname> <text> -> set description for faction")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user