GetPlayerStat
The level of a stat, as the server last heard or set it.
What the player’s game last reported, or what the mode last set - and, where the progression check acts under
[audit] mode = "enforce", never more than the server can explain. 0 means the server does not know it: the player’s
game has not reported yet (the first report comes a few seconds after the spawn), or the name is no stat. The name
mainlevel answers the main level, as GetPlayerLevel does.
Syntax
Section titled “Syntax”GetPlayerStat(pid, stat)| Parameter | Type | |
|---|---|---|
pid |
number | the player |
stat |
string | the stat’s name |
Returns
Section titled “Returns”number - the level, 0 .. 30 (mainlevel: the figure the game works out); 0 = not known (not reported yet, a skill’s name, or a player not connected)
Example
Section titled “Example”if GetPlayerStat(pid, "strength") < 13 then SendClientMessage(pid, COLOR_RED, "You are too weak to draw that bow.")endSee also
Section titled “See also”SetPlayerStat · GetPlayerLevel · GetPlayerStatXP · GetPlayerSkill · GetPlayerProgress · the Stats, skills, XP and perks group of the index
