forked from mtcontrib/factions
commit
8ee4238893
@ -161,10 +161,13 @@ factions.register_command ("claim", {
|
|||||||
description = "Claim the plot of land you're on.",
|
description = "Claim the plot of land you're on.",
|
||||||
on_success = function(player, faction, pos, chunkpos, args)
|
on_success = function(player, faction, pos, chunkpos, args)
|
||||||
local chunk = factions.chunks[chunkpos]
|
local chunk = factions.chunks[chunkpos]
|
||||||
if not chunk then
|
if not chunk and faction:can_claim_chunk(chunkpos) then
|
||||||
minetest.chat_send_player(player, "Claming chunk "..chunkpos)
|
minetest.chat_send_player(player, "Claming chunk "..chunkpos)
|
||||||
faction:claim_chunk(chunkpos)
|
faction:claim_chunk(chunkpos)
|
||||||
return true
|
return true
|
||||||
|
elseif not faction:can_claim_chunk(chunkpos) then
|
||||||
|
send_error(player, "Chunk cannot be claimed.")
|
||||||
|
return false
|
||||||
else
|
else
|
||||||
if chunk == faction.name then
|
if chunk == faction.name then
|
||||||
send_error(player, "This chunk already belongs to your faction.")
|
send_error(player, "This chunk already belongs to your faction.")
|
||||||
@ -519,6 +522,22 @@ factions.register_command("convert", {
|
|||||||
else
|
else
|
||||||
minetest.chat_send_player(player, "Error.")
|
minetest.chat_send_player(player, "Error.")
|
||||||
end
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
factions.register_command("free", {
|
||||||
|
description = "Forcefully frees a chunk",
|
||||||
|
infaction = false,
|
||||||
|
global_privileges = {"faction_admin"},
|
||||||
|
on_success = function(player, faction, pos, chunkpos, args)
|
||||||
|
local fac = factions.chunks[chunkpos]
|
||||||
|
if not fac then
|
||||||
|
send_error(player, "No claim at this position")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
faction:unclaim_chunk(chunkpos)
|
||||||
|
return true
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user