Prevented extra long rank names

This commit is contained in:
shamoanjac
2016-08-18 15:29:43 +02:00
parent c552a58b63
commit 0a47417e77
2 changed files with 6 additions and 1 deletions

View File

@ -403,8 +403,12 @@ factions.register_command("newrank", {
faction_permissions = {"ranks"},
on_success = function(player, faction, pos, parcelpos, args)
local rank = args.strings[1]
if #rank > factions.rank then
send_error(player, "Go away Todd")
return false
end
if faction.ranks[rank] then
--TODO: rank already exists
send_error(player, "Rank already exists")
return false
end
faction:add_rank(rank, args.other)