forked from mtcontrib/factions
Added /f which to get a player's faction
This commit is contained in:
parent
919666c7f7
commit
80be027f88
@ -557,6 +557,23 @@ factions.register_command("forceupdate", {
|
||||
end
|
||||
})
|
||||
|
||||
factions.register_command("which", {
|
||||
description = "Gets a player's faction",
|
||||
infaction = false,
|
||||
format = {"string"},
|
||||
on_success = function(player, faction, pos, parcelpos, args)
|
||||
local playername = args.strings[1]
|
||||
local faction = factions.get_player_faction(playername)
|
||||
if not faction then
|
||||
send_error(player, "Player "..playername.." does not belong to any faction")
|
||||
return false
|
||||
else
|
||||
minetest.chat_send_player(player, "player "..playername.." belongs to faction "..faction.name)
|
||||
return true
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- name: cmdhandler(playername,parameter)
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user