The FiveM developer’s field guide
Know the native.
Build the world.
Engine functions, framework docs, and game assets.
One reference. From the first lookup to the last line.
knowledge base
Explore / FiveM
Native reference
- WEAPONfloat
_GET_VEHICLE_WEAPON_RELOAD_TIME
``` NativeDB Introduced: v3407 ```
0xD0AD348FFD7A6868 - WEAPONint
GET_WEAPON_CLIP_SIZE
``` // Returns the size of the default weapon component clip. Use it like this: char cClipSize[32]; Hash cur; if (WEAPON::GET_CURRENT_PED_WEAPON(playerPed, &cur, 1)) { if (WEAPON::IS_WEAPON_VALID(cur)) { int iClipSize = WEAPON::GET_WEAPON_CLIP_SIZE(cur); sprintf_s(cClipSize, "ClipSize: %.d", iClipSize); vDrawString(cClipSize, 0.5f, 0.5f); } } ```
0x583BE370B1EC6EB4 - WEAPONBOOL
GET_WEAPON_COMPONENT_HUD_STATS
Description not yet documented
0xB3CAF387AE12E9F8 - WEAPONHash
GET_WEAPON_COMPONENT_TYPE_MODEL
Description not yet documented
0x0DB57B41EC1DB083 - WEAPONint
_GET_WEAPON_COMPONENT_VARIANT_EXTRA_COMPONENT_COUNT
Description not yet documented
0x6558AC7C17BFEF58 - WEAPONHash
_GET_WEAPON_COMPONENT_VARIANT_EXTRA_COMPONENT_MODEL
Description not yet documented
0x4D1CB8DC40208A17 - WEAPONfloat
GET_WEAPON_DAMAGE
This native does not return damages of weapons from the melee and explosive group.
0x3133B907D8B32053 - WEAPONint
GET_WEAPON_DAMAGE_TYPE
``` 0=unknown (or incorrect weaponHash) 1= no damage (flare,snowball, petrolcan) 2=melee 3=bullet 4=force ragdoll fall 5=explosive (RPG, Railgun, grenade) 6=fire(molotov) 8=fall(WEAPON_HELI_CRASH) 10=electric 11=barbed wire 12=extinguisher 13=gas 14=water cannon(WEAPON_HIT_BY_WATER_CANNON) ```
0x3BE0BB12D25FB305 - WEAPONBOOL
GET_WEAPON_HUD_STATS
``` // members should be aligned to 8 bytes by default but it's best to use alignas here, just to be sure struct WeaponHudStatsData { alignas(8) uint8_t hudDamage; // 0x0000 alignas(8) uint8_t hudSpeed; // 0x0008 alignas(8) uint8_t hudCapacity; // 0x0010 alignas(8) uint8_t hudAccuracy; // 0x0018 alignas(8) uint8_t hudRange; // 0x0020 }; Usage: WeaponHudStatsData data; if (GET_WEAPON_HUD_STATS(weaponHash, (Any*)&data)) { // uint8_t damagePercentage = data.hudDamage etc... } ```
0xD92C739EE34C9EBA - WEAPONObject
GET_WEAPON_OBJECT_FROM_PED
``` Drops the current weapon and returns the object Unknown behavior when unarmed. ```
0xCAE1DC9A0E22A16D - WEAPONint
_GET_WEAPON_OBJECT_LIVERY_COLOR
Description not yet documented
0xB3EA4FEABF41464B - WEAPONint
GET_WEAPON_OBJECT_TINT_INDEX
Description not yet documented
0xCD183314F7CD2E57 - WEAPONfloat
_GET_WEAPON_TIME_BETWEEN_SHOTS
Description not yet documented
0x065D2AACAD8CF7A4 - WEAPONint
GET_WEAPON_TINT_COUNT
Description not yet documented
0x5DCF6C5CAB2E9BF7 - WEAPONHash
GET_WEAPONTYPE_GROUP
Gets and returns the hash of the group of the specified weapon (group names can be found/changed under "Group" in the weapons' meta file). Note that the group is **not** the same as the location on the weapon wheel.
0xC3287EE3050FB74C - WEAPONHash
GET_WEAPONTYPE_MODEL
``` Returns the model of any weapon. Can also take an ammo hash? sub_6663a(&l_115B, WEAPON::GET_WEAPONTYPE_MODEL(${ammo_rpg})); ```
0xF46CDC33180FDA94 - WEAPONHash
GET_WEAPONTYPE_SLOT
Description not yet documented
0x4215460B9B8B7FA0 - WEAPONvoid
GIVE_DELAYED_WEAPON_TO_PED
``` Gives a weapon to PED with a delay, example: WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PED::PLAYER_PED_ID(), MISC::GET_HASH_KEY("WEAPON_PISTOL"), 1000, false) ```
0xB282DC6EBD803C75 - WEAPONvoid
_GIVE_LOADOUT_TO_PED
List of all available loadouts: ``` LOADOUT_DEFAULT LOADOUT_ANIMAL LOADOUT_COUGAR LOADOUT_HILLBILLY LOADOUT_CULT LOADOUT_CHEAT_0 LOADOUT_CHEAT_1 LOADOUT_GUARD LOADOUT_NETWORK_BOT LOADOUT_LOST LOADOUT_LOST_L1 LOADOUT_LOST_L2 LOADOUT_LOST_L3 LOADOUT_MEXICAN LOADOUT_MEXICAN_L1 LOADOUT_MEXICAN_L2 LOADOUT_MEXICAN_L3 LOADOUT_FAMILY LOADOUT_ASIAN LOADOUT_SECUR LOADOUT_POLICE_GUARD LOADOUT_COP LOADOUT_COP_L1 LOADOUT_COP_L2 LOADOUT_COP_L3 LOADOUT_SWAT LOADOUT_SWAT_NO_LASER LOADOUT_COP_SHOTGUN LOADOUT_FIREMAN LOADOUT_COP_HELI LOADOUT_COP_BOAT LOADOUT_ARMY LOADOUT_ANIMAL_RETRIEVER LOADOUT_SMALL_DOG LOADOUT_TIGER_SHARK LOADOUT_HAMMERHEAD_SHARK LOADOUT_KILLER_WHALE LOADOUT_BOAR LOADOUT_PIG LOADOUT_COYOTE LOADOUT_DEER LOADOUT_HEN LOADOUT_RABBIT LOADOUT_CAT LOADOUT_COW ```
0x68F8BE6AF5CDF8A6 - WEAPONvoid
GIVE_WEAPON_COMPONENT_TO_PED
Description not yet documented
0xD966D51AA5B28BB9 - WEAPONvoid
GIVE_WEAPON_COMPONENT_TO_WEAPON_OBJECT
``` addonHash: (use WEAPON::GET_WEAPON_COMPONENT_TYPE_MODEL() to get hash value) ${component_at_ar_flsh}, ${component_at_ar_supp}, ${component_at_pi_flsh}, ${component_at_scope_large}, ${component_at_ar_supp_02} ```
0x33E179436C0B31DB - WEAPONvoid
GIVE_WEAPON_OBJECT_TO_PED
Description not yet documented
0xB1FA61371AF7C4B7 - WEAPONvoid
GIVE_WEAPON_TO_PED
Description not yet documented
0xBF0FD6E56C964FCB - WEAPONBOOL
HAS_ENTITY_BEEN_DAMAGED_BY_WEAPON
``` It determines what weapons caused damage: If you want to define only a specific weapon, second parameter=weapon hash code, third parameter=0 If you want to define any melee weapon, second parameter=0, third parameter=1. If you want to identify any weapon (firearms, melee, rockets, etc.), second parameter=0, third parameter=2. ```
0x131D401334815E94 - WEAPONBOOL
HAS_PED_BEEN_DAMAGED_BY_WEAPON
``` It determines what weapons caused damage: If you want to define only a specific weapon, second parameter=weapon hash code, third parameter=0 If you want to define any melee weapon, second parameter=0, third parameter=1. If you want to identify any weapon (firearms, melee, rockets, etc.), second parameter=0, third parameter=2. ```
0x2D343D2219CD027A - WEAPONBOOL
HAS_PED_GOT_WEAPON
``` p2 should be FALSE, otherwise it seems to always return FALSE Bool does not check if the weapon is current equipped, unfortunately. ```
0x8DECB02F88F428BC - WEAPONBOOL
HAS_PED_GOT_WEAPON_COMPONENT
Description not yet documented
0xC593212475FAE340 - WEAPONBOOL
HAS_VEHICLE_GOT_PROJECTILE_ATTACHED
``` Third Parameter = unsure, but pretty sure it is weapon hash --> get_hash_key("weapon_stickybomb") Fourth Parameter = unsure, almost always -1 ```
0x717C8481234E3B88 - WEAPONBOOL
HAS_WEAPON_ASSET_LOADED
Description not yet documented
0x36E353271F0E90EE - WEAPONBOOL
HAS_WEAPON_GOT_WEAPON_COMPONENT
Description not yet documented
0x76A18844E743BF91 - WEAPONBOOL
_HAS_WEAPON_RELOADING_IN_VEHICLE
``` NativeDB Introduced: v3407 ```
0x8062F07153F4446F - WEAPONvoid
HIDE_PED_WEAPON_FOR_SCRIPTED_CUTSCENE
``` Hides the players weapon during a cutscene. ```
0x6F6981D2253C208F - WEAPONBOOL
_IS_ANY_AIR_DEFENSE_ZONE_INSIDE_SPHERE
Description not yet documented
0xDAB963831DBFD3F4 - WEAPONBOOL
IS_FLASH_LIGHT_ON
Description not yet documented
0x4B7620C47217126C - WEAPONBOOL
IS_PED_ARMED
Checks if the ped is currently equipped with a weapon matching a bit specified using a bitwise-or in typeFlags. | Bit value | Effect | |-----------|-------------------| | 1 | Melee weapons | | 2 | Explosive weapons | | 4 | Any other weapons | Not specifying any bit will lead to the native *always* returning 'false', and for example specifying '4 | 2' will check for any weapon except fists and melee weapons.
0x475768A975D5AD17 - WEAPONBOOL
IS_PED_CURRENT_WEAPON_SILENCED
``` This native returns a true or false value. Ped ped = The ped whose weapon you want to check. ```
0x65F0C5AE05943EC7 - WEAPONBOOL
IS_PED_WEAPON_COMPONENT_ACTIVE
Description not yet documented
0x0D78DE0572D3969E - WEAPONBOOL
IS_PED_WEAPON_READY_TO_SHOOT
Description not yet documented
0xB80CA294F2F26749 - WEAPONBOOL
IS_WEAPON_VALID
Description not yet documented
0x937C71165CF334B3 - WEAPONBOOL
MAKE_PED_RELOAD
Forces a ped to reload only if they are able to; if they have a full magazine, they will not reload.
0x20AE33F3AC9C0033
A living reference. Documentation coverage varies by native and source.