_GET_WEAPON_NAME
Returns "WNS_INVALID" if the weapon is invalid/doesn't exist.
Hash
0x89CF5FF3D363311ERuntime name
GetWeaponNameNamespaceWEAPON
SideClient
NameCommunity guess
Docs
Since build1207
Signature
const char* _GET_WEAPON_NAME(Hash weaponHash);Parameters
| Name | Type | Description |
|---|---|---|
weaponHash | Hash | — |
Returns const char*
Description
Returns "WNS_INVALID" if the weapon is invalid/doesn't exist.
Usage
local retval = GetWeaponName(weaponHash)
-- always works, by hash
local retval = Citizen.InvokeNative(0x89CF5FF3D363311E, weaponHash, Citizen.ResultAsString())JavaScript and C#
const retval = GetWeaponName(weaponHash);
// by hash
const retval = Citizen.invokeNative('0x89CF5FF3D363311E', weaponHash, Citizen.returnResultAnyway(), Citizen.resultAsString());string retval = Function.Call<string>((Hash)0x89CF5FF3D363311E, weaponHash);- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("name")or a backtick literal like`name`. - The name is a community guess and may change. If the named call is missing in your client build, use
InvokeNativewith the hash — it always works.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.