Skip to content

GetPlayerPerkPoints

The perk points a stat, a skill or the main level has not spent yet.

Every stat and skill holds the perk points the game gave it and the player has not spent yet. The name mainlevel is the main level’s pool: the points that belong to no stat or skill. They are the player’s game’s own counts, as it last reported them or the mode last set them (SetPlayerPerkPoints). 0 means none - or that the server does not know yet: the player’s game has not reported, or the name is neither a stat nor a skill.

GetPlayerPerkPoints(pid, name)
Parameter Type
pid number the player
name string a stat’s or skill’s name, or mainlevel for the pool

number - 0 .. 999; 0 = none, or not known (not reported yet, an unknown name, or a player not connected)

-- what the trainer can tell the player
local function perk_points_line(pid, skill)
local points = GetPlayerPerkPoints(pid, skill)
if points == 0 then return "You have no perk points in " .. skill .. "." end
return string.format("You have %d perk point%s to spend in %s.", points, points == 1 and "" or "s", skill)
end
SendClientMessage(pid, COLOR_WHITE, perk_points_line(pid, "weapon_sword"))

SetPlayerPerkPoints · GetPlayerLevel · GetPlayerProgress · GetPlayerPerks · the Stats, skills, XP and perks group of the index