Add new cmd change_def_rank

This commit is contained in:
Coder12a
2018-10-29 19:36:46 -05:00
parent e2f9cdb9f2
commit 4a15fb3646
2 changed files with 39 additions and 0 deletions

View File

@ -816,6 +816,23 @@ factions.register_command("delrank", {
end
},false)
factions.register_command("change_def_rank", {
description = "Change the default rank given to new players and also replace rankless players in this faction.",
format = {"string"},
faction_permissions = {"ranks"},
global_privileges = def_global_privileges,
on_success = function(player, faction, pos, parcelpos, args)
local rank = args.strings[1]
if not faction.ranks[rank] then
send_error(player, "This rank does not exist.")
return false
end
faction:change_def_rank(rank)
faction.rankless = false
return true
end
},false)
factions.register_command("setspawn", {
description = "Set the faction's spawn",
faction_permissions = {"spawn"},