Weapon
constWeapon:object
Defined in: server/api.d.ts:2438
Per-weapon damage balance. A multiplier scales a weapon’s native power curve on every client, so bullets, blasts and melee swings with that weapon id deal that much more or less.
Type Declaration
Section titled “Type Declaration”getBaseDamage()
Section titled “getBaseDamage()”getBaseDamage(
weaponId):WeaponBaseDamage|null
Returns the retail power curve of a bullet or blast weapon: power at 0 m and at two falloff distances, then the three distances in metres.
Parameters
Section titled “Parameters”weaponId
Section titled “weaponId”number
Weapon id to look up.
Returns
Section titled “Returns”WeaponBaseDamage | null
The curve, or null for melee and unknown ids.
getDamageMultiplier()
Section titled “getDamageMultiplier()”getDamageMultiplier(
weaponId):number
Reports the damage scale currently applied to a weapon.
Parameters
Section titled “Parameters”weaponId
Section titled “weaponId”number
Weapon id to query.
Returns
Section titled “Returns”number
The multiplier, 1 when the weapon is at retail damage.
resetDamage()
Section titled “resetDamage()”resetDamage(
weaponId?):void
Restores a weapon, or all weapons, to retail damage.
Parameters
Section titled “Parameters”weaponId?
Section titled “weaponId?”number
Weapon id to restore; omit to restore every weapon.
Returns
Section titled “Returns”void
setDamageMultiplier()
Section titled “setDamageMultiplier()”setDamageMultiplier(
weaponId,factor):void
Scales how much damage a weapon deals. Takes effect on every client within a moment and applies to bullets, blasts and melee swings; shots already in flight keep the previous value. Throws for a weapon without adjustable damage or a factor outside 0..100.
Parameters
Section titled “Parameters”weaponId
Section titled “weaponId”number
Weapon id (weapons.tbl row) to scale.
factor
Section titled “factor”number
Scale applied to the weapon’s retail damage; 1 is retail, 0 disarms it, up to 100.
Returns
Section titled “Returns”void
