Developer Reference

FiveM Weapon Hashes

A searchable list of the most common GTA V weapon spawn codes and hex hashes used in FiveM scripting.

Writing a script? Take a break and build your loading screen.

Use Vice-Forge's visual builder to create a stunning custom loading screen in 60 seconds without writing any HTML.

Weapon List

Weapon NameSpawn CodeHash (Hex)
Pistol
Combat Pistol
AP Pistol
Stun Gun (Taser)
Pump Shotgun
Carbine Rifle
Assault Rifle
Advanced Rifle
Special Carbine
Bullpup Rifle
Micro SMG
SMG
Assault SMG
Combat PDW
Sniper Rifle
Heavy Sniper
RPG
Minigun
Knife
Nightstick
Bat
Crowbar
Flashlight
Unarmed

What are FiveM Weapon Hashes?

When writing Lua scripts for your FiveM server (such as an admin menu, a gun store, or a police armory job), you cannot simply type "Pistol" to give a player a weapon. The game engine requires the exact Weapon Hash or the Spawn Code.

A Spawn Code (like WEAPON_CARBINERIFLE) is the readable string name of the weapon. Under the hood, FiveM uses the Jenkins One-at-a-Time (joaat) hashing algorithm to convert this string into a 32-bit integer. The Hex Hash (like 0x83BF0278) is simply the hexadecimal representation of that integer.

How to give a weapon in Lua

To give a player a weapon in a server-side Lua script, you use the GiveWeaponToPed native function. You can use either the readable spawn code wrapped in the GetHashKey function, or pass the hex hash directly.

-- Using the Spawn Code (Recommended for readability)
GiveWeaponToPed(playerId, GetHashKey("WEAPON_COMBATPISTOL"), 250, false, true)

-- Using the Hex Hash directly (Slightly more performant)
GiveWeaponToPed(playerId, 0x5EF9FEC4, 250, false, true)