Back to TPG

TPG.GetRank

S🏷️ Ranks

Part of TPG namespace

TPG.GetRank(rating)
View on GitHub|gamemode/config/sh_ranks.lua:49-56
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

The rank entry for a rating value, and its index in TPG.Ranks. Rating defaults to 1000 (the ladder's centre, and every new player's starting rating) when not given. Walks the whole table keeping the LAST entry whose min the rating still clears, so it depends on TPG.Ranks staying sorted ascending by min; never returns nil since Ranks[1].min is 0 and every rating is >= 0.

Parameters

NameTypeDescription
rating?number(default: 1000)

Returns

TypeDescription
tableThe matching rank entry.
numberIts index in `TPG.Ranks`.

Examples

No examples available.

Used In

No usages found in the codebase.