WeaponClient

getWeaponDamage

GET_WEAPON_DAMAGE0x3133B907D8B32053

The GTA V native GET_WEAPON_DAMAGE of the WEAPON namespace, as LS:MP client scripts call it: the global function getWeaponDamage, in JavaScript and in Lua.

SignatureJavaScript
getWeaponDamage(weaponHash: Hash, componentHash: Hash): number
SignatureLua
getWeaponDamage(weaponHash: Hash, componentHash: Hash): number

Usage

JavaScript
const value = getWeaponDamage(weaponHash, componentHash);
Lua
local value = getWeaponDamage(weaponHash, componentHash)

Parameters

ParameterTypeJavaScriptLua
weaponHashHashnumberinteger
componentHashHashnumberinteger

Returns

float JavaScript number, Lua number

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

This native does not return damages of weapons from the melee and explosive group.
Full list of weapons by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json

Reference

Namespace
Weapon WEAPON
In the game
float GET_WEAPON_DAMAGE(Hash weaponHash, Hash componentHash)
Hash
0x3133B907D8B32053
Formerly
_GET_WEAPON_DAMAGE

Open in the interactive natives reference