Skip to content

GetPlayerWeight

What the server judges the player carries, the most they may carry, and whether that is too much.

The carry-weight check’s own figures, worked out from the list of items the server follows in the player’s bag and the weights of the game’s item list, and never from the weight figure their game shows. carried is the weight of that bag - what they wear counts, as it does for the game; the money and any item the game’s list gives no weight are left out, so it is meant to be at or under the game’s own figure - and capacity the most the game lets a character carry as the server can bound it: 90 and 10 for each point of strength the server holds for them, with the perks, the strength potions and the drinks it knows of (a drink lifts a player’s strength for a while, and the server allows for that for at least ten minutes after the drink; a lower capacity from the player’s game counts when it is recent and plausible, a higher one never does). overloaded is true once they have carried more than 105 % of that for three seconds, and false again after a second and a half under it; it is false while the check is not judging them - dead, flying, on a cart, at a dice table, while their game’s reports of its items have stopped or stalled, while their game says its item reporting cannot run (under [audit] mode = "observe"), and while the server has given them the game’s debug buff that lifts the carry capacity by 1000 (GivePlayerBuff).

Nothing is ever taken from a heavy player. The game itself only holds them back - it refuses a sprint and getting on a horse, and lets them jump, so a jump is never held against them - and the check watches whether a player over the limit sprints or mounts a horse; a trainer that hides the weight still carries it. In this version those checks are counted and logged only: they pull nobody back and the weight hint is not told to OnPlayerCheatDetected yet. The answer is nil while the server cannot tell: before the player is in the world, before the player’s first whole report of their progression (a few seconds after the spawn) and before it follows their bag (which waits for the spawn’s clearing of the character’s starting items too), with the audit off, and without the game’s tables export (Exporting the game’s tables), whose item list holds the weights.

GetPlayerWeight(pid)
Parameter Type
pid number the player

number | nil, number | nil, boolean | nil - carried, capacity, overloaded - the weight, the most the server judges they may carry and whether they carry more; nil while the server cannot tell, or for a player who is not there

-- the ferryman turns away anyone who would sink the boat
local carried, capacity, overloaded = GetPlayerWeight(pid)
if carried == nil then
SendClientMessage(pid, COLOR_YELLOW, "Let me see your pack again in a moment.")
elseif overloaded then
SendClientMessage(pid, COLOR_RED, string.format("You carry %.0f and can bear %.0f - the boat would sink.", carried, capacity))
end

GetPlayerProgressAudit · GetPlayerInventory · GetPlayerStat · OnPlayerCheatDetected · the Stats, skills, XP and perks group of the index