Module expcore.ranking

Returns a rank object given a player or rank name

Usage:

    Ranking.get_rank(game.player)
     Ranking.get_rank('admin')
    

Functions

Ranking.get_group (mixed) Returns the group object used to sort ranks given group name or see Ranking.get_rank
Ranking.print (rank_base, rtn, colour, below) Prints to all rank of greater/lower power of the rank given
Ranking.give_rank (player, rank[, by_player='server'[, tick=game.tick]]) Gives a user a rank
Ranking.revert (player[, by_player=nil]) Revert the last change to a players rank
Ranking.find_preset (player[, tick=nil]) Given the player has a rank in the preset table it is given
Ranking._rank:allowed (action) Is this rank allowed to open this gui or use this command etc.
Ranking._rank:get_players (online) Get all the players in this rank
Ranking._rank:print (rtn, colour, show_default) Print a message to all players of this rank


Functions

Ranking.get_group (mixed)
Returns the group object used to sort ranks given group name or see Ranking.get_rank

Parameters:

  • mixed player|player index|player name|rank name|rank|'server'|'root'|group name|group what group to get

Returns:

    table the group that is linked to mixed

Usage:

    Ranking.get_group(game.player)
     Ranking.get_group('root')
Ranking.print (rank_base, rtn, colour, below)
Prints to all rank of greater/lower power of the rank given

Parameters:

  • rank_base the rank that acts as the cut off point (rank is always included)
  • rtn what do you want to return to the players
  • colour defines.color the colour that will be used to print
  • below bolean if true rank below base are printed to

Usage:

    Ranking.print('admin','We got a grifer')
Ranking.give_rank (player, rank[, by_player='server'[, tick=game.tick]])
Gives a user a rank

Parameters:

  • player the player to give the rank to
  • rank the rank to give to the player
  • by_player the player who is giving the rank (default 'server')
  • tick the tick that the rank is being given on (default game.tick)

Usage:

    Ranking.give_rank(1,'admin')
Ranking.revert (player[, by_player=nil])
Revert the last change to a players rank

Parameters:

  • player the player to revert the rank of
  • by_player the player who is doing the revert (default nil)

Usage:

    Ranking.revert(1)
Ranking.find_preset (player[, tick=nil])
Given the player has a rank in the preset table it is given

Parameters:

  • player the player to test for an auto rank
  • tick number the tick it happens on (default nil)

Usage:

    Ranking.find_preset(1)
Ranking._rank:allowed (action)
Is this rank allowed to open this gui or use this command etc.

Parameters:

  • action teh to test for

Returns:

    bolean is it allowed

Usage:

    rank:allowed('server-interface')
Ranking._rank:get_players (online)
Get all the players in this rank

Parameters:

  • online bolean get only online players

Returns:

    table a table of all players in this rank

Usage:

    rank:get_players()
Ranking._rank:print (rtn, colour, show_default)
Print a message to all players of this rank

Parameters:

  • rtn any value you want to return
  • colour define.color the colour that will be used to print
  • show_default boolean weather to use the default rank name for the print

Usage:

    rank:print('foo')
generated by LDoc 1.4.6 Last updated 2018-05-29 20:15:05