Fixed moar bugs including spawn

This commit is contained in:
shamoanjac
2016-08-08 16:31:11 +02:00
parent c678fd55e2
commit 169076e8fe
2 changed files with 45 additions and 6 deletions

View File

@ -408,7 +408,7 @@ factions.register_command("newrank", {
--TODO: rank already exists
return false
end
faction:new_rank(rank, args.other)
faction:add_rank(rank, args.other)
return true
end
})
@ -419,7 +419,7 @@ factions.register_command("delrank", {
faction_permissions = {"ranks"},
on_success = function(player, faction, pos, chunkpos, args)
local rank = args.strings[1]
local newrank = args.string[2]
local newrank = args.strings[2]
if not faction.ranks[rank] or not faction.ranks[rank] then
--TODO: error (one of either ranks do not exist)
return false
@ -461,6 +461,19 @@ factions.register_command("help", {
end
})
factions.register_command("spawn", {
description = "Shows your faction's spawn",
infaction = true,
on_success = function(player, faction, pos, chunkpos, args)
if faction.spawn then
minetest.chat_send_player(player, "Spawn is at ("..table.concat(faction.spawn, ", ")..")")
return true
else
minetest.chat_send_player(player, "Your faction has no spawn set.")
end
end
})
-------------------------------------------------------------------------------
-- name: cmdhandler(playername,parameter)
--