GetPlayerLevel
The player’s main level - the level the game shows for the whole character.
The one level the character screen shows for a character, which the game works out itself from the levels of the stats and
skills: it rises and falls as they do, and no call sets it. This is the level of the player’s game as it last reported it
(0 until the first report, a few seconds after the spawn). The same figure is GetPlayerStat with mainlevel.
OnPlayerLevelUp announces a rise the player earns as the stat mainlevel.
Syntax
Section titled “Syntax”GetPlayerLevel(pid)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
Returns
Section titled “Returns”number - the main level; 0 = not reported yet, or a player not connected
Example
Section titled “Example”-- the tournament is for seasoned characterslocal level = GetPlayerLevel(pid)if level == 0 then SendClientMessage(pid, COLOR_YELLOW, "Your character is still being read - try again in a moment.")elseif level < 10 then SendClientMessage(pid, COLOR_RED, string.format("You are level %d. The tournament asks for level 10.", level))endSee also
Section titled “See also”GetPlayerStat · GetPlayerPerkPoints · OnPlayerLevelUp · SetPlayerStat · the Stats, skills, XP and perks group of the index
