Przejdź do treści

Edytor weapons.meta

Zacznij od prawdziwego domyślnego weapons.meta dowolnej broni z podstawki albo DLC, zmieniaj obrażenia, zasięg, szybkostrzelność, przeładowanie, pojemność magazynka, celność i odrzut z objaśnieniami, porównuj z domyślnymi wartościami i wyeksportuj czysty weapons.meta i fxmanifest na swój serwer.

To narzędzie i jego opis są na razie po angielsku.

Config i kodBroń, Meta, PobieraniePrzeczytaj dokumentację
Loading the game's weapons.meta data...

How to use it

  1. Pick a weapon on the left. Hand weapons are grouped by weapon group, vehicle weapons by the DLC they came with.
  2. Change values with the slider or type a number. Changed fields turn amber and show the game default next to a reset link.
  3. Magazine size is under Ammo & reload. It lives on the clip component, so it exports as a separate weaponcomponents.meta.
  4. Edit as many weapons as you like. The weapons.meta tab only contains the weapons you changed. The Changes tab lists every field next to its default.
  5. Download the files, copy the fxmanifest and ensure the resource. Your edits are saved in this browser.

Already have a weapons.meta? Use Import and paste it or open the file. Base game weapons are compared against their defaults, so you see exactly what the file changes. Weapons that are not in the base game (add-on guns) are added as custom weapons and exported as they are.

Defaults

Defaults are the game's own values (game build 3889), DLC weapons and Rockstar's later patches included. A weapon you do not edit exports the same block the game has.

Loading it in a resource

fx_version 'cerulean'
game 'gta5'

files {
    'weapons.meta',
    'weaponcomponents.meta',
}

data_file 'WEAPONINFO_FILE_PATCH' 'weapons.meta'
data_file 'WEAPONCOMPONENTSINFO_FILE' 'weaponcomponents.meta'
  • WEAPONINFO_FILE_PATCH is the type people use to override base game weapons. FiveM mounts it with the same loader asWEAPONINFO_FILE (both are listed in the data file table and handled together in FiveM's source), and plenty of servers report that either works. We default to the patch type because that is what Rockstar uses for files that change existing weapons.
  • Items replace the game's weapon by <Name>. Ship the whole <Item type="CWeaponInfo"> block, not only the lines you changed. The export does that for you.
  • ClipSize inside weapons.meta is ignored for weapons that have a default clip component (most guns). Change the clip component in weaponcomponents.meta instead.
  • Players have to reconnect to pick up changes. If one of your weapons is also edited by another resource, the one loaded last wins, so keep all weapon edits in one resource.

Meta file or runtime natives

Some values can be changed from a client script without shipping a meta file. The Runtime tab writes that script for your changes.

  • SetWeaponDamageModifier(weaponHash, multiplier) (game native 0x4757F00BC6323CFE, older nameN_0x4757f00bc6323cfe / _SET_WEAPON_DAMAGE_MODIFIER) multiplies the weapon's base damage for that weapon type on the client that runs it. It does not need to be called every frame, and it is not reset when the resource stops.
  • SetWeaponRecoilShakeAmplitude(weaponHash, amplitude) is a FiveM native that sets RecoilShakeAmplitude directly. FiveM also has GetWeaponDamageModifier and GetWeaponRecoilShakeAmplitude to read them back.
  • SetPlayerWeaponDamageModifier(player, modifier) and SetPlayerWeaponDefenseModifier(player, modifier) scale damage per player, for every weapon. Useful for buffs, safe zones or jobs.

Use natives when you want to tune damage live, change it per situation, or avoid a client restart. Use weapons.meta for everything else (fire rate, range, falloff, reload, accuracy, flags) and for values that should be the same for everyone from the moment they join. Damage is worked out on the shooter's client, so a runtime modifier has to run on every client.

What the derived stats mean

  • Fire rate is 60 / TimeBetweenShots. For semi auto guns it is the cap, you cannot click faster than that but you can click slower.
  • Burst DPS is damage per shot times shots per second, every bullet hitting, no falloff, no armour.
  • Empty a clip is (rounds - 1) x TimeBetweenShots using the default clip component's size.
  • Shots to down a player uses 100 points (a FiveM player has 200 health and goes down at 100) times NetworkPlayerDamageModifier, body shots with no armour. Headshots add NetworkHeadShotPlayerDamageModifier.
  • Falloff: full damage up to DamageFallOffRangeMin, then a straight line down to Damage x DamageFallOffModifier at DamageFallOffRangeMax, and nothing past WeaponRange. The chart draws exactly that.

These are estimates from the meta values. Scripts that change damage modifiers, armour, limb hits and animation timing all change the real result. Nobody outside Rockstar has an official description of every CWeaponInfo field, so the one line explanations are the community's best understanding plus what the values in the game files show.

Sources