forked from mtcontrib/factions
Added /f chat command
This commit is contained in:
parent
9931060c71
commit
abe814f195
@ -5,9 +5,9 @@
|
|||||||
--
|
--
|
||||||
--! @file chatcommnd.lua
|
--! @file chatcommnd.lua
|
||||||
--! @brief factions chat interface
|
--! @brief factions chat interface
|
||||||
--! @copyright Sapier
|
--! @copyright Sapier, agrecascino, shamoanjac
|
||||||
--! @author Sapier
|
--! @author Sapier, agrecascino, shamoanjac
|
||||||
--! @date 2013-05-08
|
--! @date 2016-08-12
|
||||||
--
|
--
|
||||||
-- Contact sapier a t gmx net
|
-- Contact sapier a t gmx net
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
@ -240,7 +240,6 @@ factions.register_command("leave", {
|
|||||||
description = "Leave your faction.",
|
description = "Leave your faction.",
|
||||||
on_success = function(player, faction, pos, chunkpos, args)
|
on_success = function(player, faction, pos, chunkpos, args)
|
||||||
faction:remove_player(player)
|
faction:remove_player(player)
|
||||||
--TODO: message?
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@ -254,7 +253,6 @@ factions.register_command("kick", {
|
|||||||
if factions.players[victim.name] == faction.name
|
if factions.players[victim.name] == faction.name
|
||||||
and victim.name ~= faction.leader then -- can't kick da king
|
and victim.name ~= faction.leader then -- can't kick da king
|
||||||
faction:remove_player(player)
|
faction:remove_player(player)
|
||||||
--TODO: message?
|
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
send_error(player, "Cannot kick player "..victim.name)
|
send_error(player, "Cannot kick player "..victim.name)
|
||||||
@ -294,7 +292,6 @@ factions.register_command("join", {
|
|||||||
if new_faction:can_join(player) then
|
if new_faction:can_join(player) then
|
||||||
if player_faction then -- leave old faction
|
if player_faction then -- leave old faction
|
||||||
player_faction:remove_player(player)
|
player_faction:remove_player(player)
|
||||||
--TODO: message
|
|
||||||
end
|
end
|
||||||
new_faction:add_player(player)
|
new_faction:add_player(player)
|
||||||
else
|
else
|
||||||
@ -542,6 +539,14 @@ factions.register_command("free", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
factionsm.register_command("chat", {
|
||||||
|
description = "Send a message to your faction's members"
|
||||||
|
on_success = function(player, faction, pos, chunkpos, args)
|
||||||
|
local msg = table.concat(args.other, " ")
|
||||||
|
faction:broadcast(msg, player)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
-- name: cmdhandler(playername,parameter)
|
-- name: cmdhandler(playername,parameter)
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user