TPG.Gear.Price(kind, id)Description
Price table for an item, or nil if it is free. For armor, this is a straight lookup into TPG.Gear.Armor (the price table in this file, not TPG.Armor in sh_armor.lua); ids not listed there (None/Light/Medium) come back nil, meaning free. For a weapon, this first checks whether the id's DISCOVERED entry (in TPG.Weapons.Primary/Secondary/Special) carries a positive cost. That field is only ever non-zero when an admin has set a per-weapon cost override in the weapon panel (config/sh_weapons_config.lua's static Overrides can also seed it) -- it is NOT populated from this file's Weapons table, so the normal case is that discovered cost is 0 and this falls through to base, the static entry below. When an admin override IS present, it wins outright over the baseline in this file. An admin-set cost gets a matching cooldown for free, computed as entry.cooldown or (base and base.cooldown) or cost/COST_PER_COOLDOWN_SEC. In practice entry.cooldown is never populated anywhere in config/sh_weapons.lua (discovery never sets it and neither does TPG.Weapons.ApplyState), so that first branch is currently always nil and the real fallback is the static baseline's cooldown, or the derived one if there is no baseline entry at all. Without a cooldown here, gating a weapon through the panel would do nothing at all in a normal round; the cost only bites under the economy, which most rounds aren't. lives is always filled in, from the entry or from TPG.Config.gearCooldownLives, so callers never have to default it.
Parameters
| Name | Type | Description |
|---|---|---|
kind | string | `"armor"` or `"weapon"`. |
id | string|number | Armor id or weapon class/virtual id. |
Returns
| Type | Description |
|---|---|
table | `{ cost, cooldown, lives }`, or nil if the item is free. |
Examples
No examples available.
Used In
No usages found in the codebase.