Back to TPG

TPG.ACE.GetPlayerPoints

S🏷️ Ace

Part of TPG namespace

TPG.ACE.GetPlayerPoints(ply, refresh)
View on GitHub|gamemode/systems/sv_ace_integration.lua:143-153
📋 Has LDoc👁️ 0 viewsUpdated 1 month ago

Description

Total ACE points across everything a player owns. refresh decides whether we force ACE to bring its numbers up to date first. Leave it off for anything periodic. ACE's point system is deliberately lazy: a split, merge, armor change or vehicle unfreeze only marks the contraption dirty, and nothing rebuilds until a reader actually needs the value. Polling it on a timer defeats that design -- it turns "rebuild when someone asks" into "rebuild everything, forever" -- and combat re-dirties contraptions constantly (every destroyed component splits one), so the rebuild is rarely a no-op while a fight is happening. Each rebuild also fires ACE_OnContraptionPointsRecalculated, which runs TPG's own re-bill listener (tpg.economy). This is the one thing TPG asks of ACE that plain sandbox+ACE never does, which makes it the first suspect for "same tanks, but only laggy under TPG."

Parameters

NameTypeDescription
plyPlayer
refresh?booleanForce a rebuild before reading.(default: false)

Returns

TypeDescription
number

Examples

No examples available.

Used In

No usages found in the codebase.