Moved a function

This commit is contained in:
Cooldude2606
2017-09-14 18:16:34 +01:00
parent f1fa1e231f
commit 4e6e960cd2
2 changed files with 8 additions and 8 deletions

View File

@@ -38,6 +38,13 @@ function string_to_rank(string)
if #found_ranks == 1 then return found_ranks[1] end if #found_ranks == 1 then return found_ranks[1] end
end end
end end
-- surches the rank for a certain allow command
function rank_allowed(rank,is_allowed)
for _,allow in rank.allow do
if allow == is_allowed then return true end
end
return false
end
--Send a message to all members of this rank and above, if no rank given default is mod --Send a message to all members of this rank and above, if no rank given default is mod
--inv sends message to all lower ranks rather than higher --inv sends message to all lower ranks rather than higher
function rank_print(msg, rank, inv) function rank_print(msg, rank, inv)

View File

@@ -149,7 +149,7 @@ local ranks = {
} }
} }
} }
-- Feed the disallows of each rank into the one below itself -- rank table setup
for n,rank in pairs(ranks.ranks) do for n,rank in pairs(ranks.ranks) do
local ranks_list = ranks.ranks local ranks_list = ranks.ranks
rank.power = n rank.power = n
@@ -167,13 +167,6 @@ for n,rank in pairs(ranks.ranks) do
if rank.time then ranks.lowest_timed_rank=rank end if rank.time then ranks.lowest_timed_rank=rank end
ranks.number_of_ranks=ranks.number_of_ranks+1 ranks.number_of_ranks=ranks.number_of_ranks+1
end end
-- surches the rank for a certain allow command
function rank_allowed(rank,is_allowed)
for _,allow in rank.allow do
if allow == is_allowed then return true end
end
return false
end
-- returns a list off all the ranks, return only one part if given -- returns a list off all the ranks, return only one part if given
function get_ranks(part) function get_ranks(part)
local to_return = {} local to_return = {}