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

Damage, headshots, recoil, aiming and the weapon HUD

In short

Settle access first, then prices, then damage. Roleplay needs fights long enough to play out; PvP needs them fast and consistent. Recoil, aiming, the crosshair and the ammo counter decide how the result feels.

client — server-wide combat rules
CreateThread(function()
    SetWeaponDamageModifier(`WEAPON_PISTOL`, 0.8)
    SetWeaponDamageModifier(`WEAPON_CARBINERIFLE`, 0.7)
    SetPlayerMeleeWeaponDamageModifier(PlayerId(), 0.5)
end)

AddEventHandler('playerSpawned', function()
    SetPedSuffersCriticalHits(PlayerPedId(), false)  -- no instant headshot kills
end)
LeverRoleplayPvP / redzone
AccessLicences, crafting, black market, police by gradeLoadout kits on entry
HeadshotsNot instant (SetPedSuffersCriticalHits false)Consistent, often instant
DamageLower, longer fightsFixed per weapon class
Ammo and durabilityA running costFree or generous
MeleeReduced; no pistol-whippingOften disabled
  • Permanent per-weapon values are Damage and HeadShotDamageModifierPlayer in weapons.meta.
  • Throwables such as grenades, molotovs and sticky bombs are stackable items, so restrict them in shops.
  • Change a single value, then read the kill logs before you change the next.

Complaints that combat feels bad usually trace back to five things: recoil, first-person aiming, the crosshair, combat rolls and quick swaps.

client — recoil, forced first-person aim, no reticle, no combat roll
local KICK = { [`WEAPON_PISTOL`] = 0.3, [`WEAPON_CARBINERIFLE`] = 0.5 }

CreateThread(function()
    while true do
        local ped = PlayerPedId()
        local weapon = GetSelectedPedWeapon(ped)
        if weapon == `WEAPON_UNARMED` then
            Wait(500)
        else
            Wait(0)
            if IsPedShooting(ped) then
                local kick = KICK[weapon] or 0.3
                SetGameplayCamRelativePitch(GetGameplayCamRelativePitch() + kick, 0.2)
            end
            if IsPlayerFreeAiming(PlayerId()) then
                HideHudComponentThisFrame(14)   -- reticle
                DisableControlAction(0, 22, true)  -- jump = combat roll while aiming
            end
        end
    end
end)
WantHow
First person while aimingSetFollowPedCamViewMode(4) on aim, restore after; disable control 0 (V)
No weapon wheelDisable control 37, hide HUD components 19 and 20, SetWeaponsNoAutoswap(true)
No quick swap while shootingDisable slot controls 157–165 and scroll 14–17, or SetPedCanSwitchWeapon(ped, false)
Holster animationreaction@intimidation@1h intro/outro when drawing and holstering
Camera shakeShakeGameplayCam('HAND_SHAKE', 0.2); stop with StopGameplayCamShaking(true)

Run these loops at Wait(0) only while the player is armed. Unarmed they sleep, which keeps the idle cost at 0.00 ms in resmon.

A custom ammo counter follows the same rule. It takes a few natives and one message to the NUI, sent only when a value has changed.

client
local last = {}

CreateThread(function()
    while true do
        local ped = PlayerPedId()
        local weapon = GetSelectedPedWeapon(ped)
        local armed = weapon ~= `WEAPON_UNARMED`
        local _, clip = GetAmmoInClip(ped, weapon)
        local total = GetAmmoInPedWeapon(ped, weapon)
        if armed ~= last.armed or clip ~= last.clip or total ~= last.total then
            last = { armed = armed, clip = clip, total = total }
            SendNUIMessage({ action = 'ammo', data = last })
        end
        Wait(armed and 150 or 600)
    end
end)
  • DisplayAmmoThisFrame(false) on every frame hides the game’s own counter; hiding HUD component 2 does the same.
  • GetMaxAmmoInClip(ped, weapon, true) returns the magazine size, which is what a bar needs.
  • On ox_inventory, the ox_inventory:currentWeapon event fires when the equipped weapon changes.

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