Santa & Christmas Edition36 maps, limited runlimited runShop the drop
Chapter 03 of 10The Weapon Skins Handbook for FiveM

Add-on weapons: meta files, weapons.meta and sounds

In short

An add-on weapon is a new WEAPON_… name with its own model, textures and meta files, and it sits beside the stock weapons. A replace streams files under a stock weapon’s names instead, so that weapon changes for everyone.

text
my_pistol/
  fxmanifest.lua
  meta/
    weapons.meta
    weaponarchetypes.meta
    weaponanimations.meta
    weaponcomponents.meta
    pedpersonality.meta
  stream/
    w_pi_mypistol.ydr
    w_pi_mypistol.ytd
    w_pi_mypistol_mag1.ydr
fxmanifest.lua
fx_version 'cerulean'
game 'gta5'

files {
    'meta/weaponcomponents.meta',
    'meta/weaponarchetypes.meta',
    'meta/weaponanimations.meta',
    'meta/pedpersonality.meta',
    'meta/weapons.meta',
}

data_file 'WEAPONCOMPONENTSINFO_FILE' 'meta/weaponcomponents.meta'
data_file 'WEAPON_METADATA_FILE'      'meta/weaponarchetypes.meta'
data_file 'WEAPON_ANIMATIONS_FILE'    'meta/weaponanimations.meta'
data_file 'PED_PERSONALITY_FILE'      'meta/pedpersonality.meta'
data_file 'WEAPONINFO_FILE'           'meta/weapons.meta'

client_script 'names.lua'
names.lua
AddTextEntry('WT_MYPISTOL', 'My Pistol')
ReplaceAdd-on
HowStream files with vanilla names (w_pi_pistol.ydr)New WEAPON_… with its own meta files
Meta filesNone neededweapons, archetypes, animations (+ components)
InventoryNothing to addAdd the weapon and its item
Use forSkins and vanilla overhaulsWhen players should have both
  • weaponarchetypes.meta: every modelName and txdName has to equal the streamed file name exactly, without the extension.
  • weaponanimations.meta: copy the entries of the stock weapon yours most resembles, and change nothing but the weapon key.
  • <HumanNameHash> in weapons.meta is the text key that AddTextEntry registers.

weapons.meta holds CWeaponInfo items inside a CWeaponInfoBlob. Of everything in an item, only these fields are ones you are likely to edit.

FieldControls
NameThe weapon name, e.g. WEAPON_MYPISTOL
ModelThe streamed model name
SlotWhich weapon wheel slot it uses
AmmoInfoThe ammo type, e.g. AMMO_PISTOL — weapons sharing a type share ammo
ClipSizeRounds per magazine
DamageBase damage per bullet
HeadShotDamageModifierPlayerHeadshot multiplier against players
DamageFallOffRangeMin / Max / ModifierHow damage drops with distance
TimeBetweenShotsFire rate (seconds between shots)
WeaponRangeMaximum range
RecoilShakeHash / RecoilShakeAmplitudeVisual recoil shake
WeaponFlagsBehaviour flags
AttachPointsWhich components attach to which bone
HumanNameHashThe display name key

The same file names the weapon’s audio. Pointing it at another weapon’s sound is a one-line change; fully custom sounds need audio banks.

  • <Audio>AUDIO_ITEM_…</Audio> in weapons.meta selects the sound set, and an add-on can simply reuse a stock one.
  • Fully custom sounds are .awc wave packs plus .rel audio data, streamed through the AUDIO_WAVEPACK, AUDIO_GAMEDATA and AUDIO_SOUNDDATA data files.
  • Players can install sound packs on their own client. sv_pureLevel 1 still lets audio mods through; level 2 blocks them.

The Weapon Skins Handbook for FiveM

This chapter is one of 10. The handbook also carries the native, control and data-file cheat sheets, a glossary and the official references behind every chapter.

Open the handbook