All products

np_crouch-crawl-shoot

Crouch, crawl and prone as stances that chain into each other, and a prone stance you can shoot from. A sniper sets up on a roof with a scope, hold breath and zoom, an entry team crawls up to a wall with rifles. It is built so other players see what the shooter does: a synced pose, a body that turns with the aim and the real weapon firing.

v0.1.0ESX · qbx · qb · standaloneNo dependenciesNo databaseNot yet run on a live server
Price TBAStore link follows at release
Installation guideDocumentation
Version
0.1.0
Status
Complete and unit tested, not yet run on a live server. /ccs_check and /ccs_spike verify it on yours
Frameworks
ESX, qbx, qb or standalone, detected at start
Dependencies
None. np_inventory, np_hud and the other np_* resources are optional
Database
Not needed
Weapons from prone
Sniper rifles, assault rifles and MGs by default, per weapon class or weapon
Keys
LCTRL crouch, Z prone, right mouse to aim. All rebindable
Languages
English, German
Server
OneSync, so other players see stances and prone fire
Sniper scope while deployed prone: the reticle on a target, range, zoom and breath chips, the stance pill and key hints for fire, reload, zoom, hold breath and lowering the weapon
Sniper scope while deployed prone: the reticle on a target, range, zoom and breath chips, the stance pill and key hints for fire, reload, zoom, hold breath and lowering the weapon

The renders show the NUI in the browser over a mock scene. In game, the real world sits behind it. With np_hud running, the stance chip is drawn by np_hud (last shot) instead of the built-in pill.

What's in it

Public crouch and crawl scripts stop where a weapon matters: firing from prone is turned off, because it either looks wrong or isn't synced. This one is built around making it look right for everybody.

Stances

  • Stand, crouch and prone. Crouch to prone and back never stands you up first.
  • Z from prone goes back to where you came from, hold it to stand up fully.
  • Crouch keeps normal GTA aiming and firing, and your walkstyle comes back when you stand.

Crawl

  • Crawl forward and back, turn on the spot, roll onto your back with Space.
  • Dive: prone at a sprint throws you forward onto your stomach.
  • A lower collision capsule, so a prone player fits under low gaps. Prone is refused on steep slopes.

Prone fire

  • Sniper rifles: scope view, scroll zoom and hold breath with SHIFT against the sway.
  • Assault rifles and MGs: a first-person or low shoulder view with recoil and spread per weapon class.
  • Hold right mouse to deploy, reload with R. A blocked muzzle refuses the shot instead of firing into cover.

Seen by everyone

  • The pose is an ordinary synced animation, and the body turns with the aim past a set arc.
  • Shots fire only when the aim and the body match, so nobody is hit by a ped looking the other way.
  • The real weapon fires: sound, muzzle flash, damage, kill credit and ammo go through the game.

Stealth

  • Lower noise per stance: crouched is quieter than standing, prone quieter still.
  • Footsteps per stance, set in the config.
  • The stance sits in state bags, so missions and other scripts can read it.

Test kit

  • /ccs_check lists which animations load on your client and whether OneSync is on.
  • /ccs_spike runs the engine aim, pose, shot, bullet and capsule tests one by one.
  • Two clients watching each other settle on your server what nobody can promise from a desk.

A closer look

What other players see

Only things FiveM syncs on its own are used for what others see. No custom netcode draws a fake shooter, so the shooter, the target and the bystander all see the same ped.

PartHow it's synced
PoseA looping full-body animation, synced by OneSync like an emote
Left and rightThe ped's heading. The aim may lead the body by 40°, past that the body turns at a limited rate. Shots only within 12° of the body
Up and downPose packs: one clip per pitch bucket, switched as you aim up or down. The built-in pack has one level pose and limits the pitch, a streamed pack adds buckets through the config
The shotThe ped's own weapon, so the game handles sound, flash, damage and ammo. If that breaks the pose on a build, it falls back to a bullet from the muzzle for the session
Server checkEvery prone shot is reported and checked: rate per weapon class, range, origin near the player, prone and deployed. Valid shots are relayed to players nearby
Muzzle effectsNearby players add a muzzle flash only when their game didn't show one. The relay never deals damage

Controls

Key mappings, so players rebind them in Settings › Key Bindings › FiveM. LCTRL replaces GTA's stealth walk. The keys don't clash with the other np_* resources.

KeyStandingCrouchedProne
LCTRLCrouchStand upStraight to crouch
ZGo prone, or dive at a sprintStraight to proneBack to where you came from. Hold to stand
Right mouseAimAimDeploy the rifle, release to lower it
SpaceRoll onto your back and back again
DeployedLeft mouse fires, R reloads. With a scope, scroll zooms and SHIFT holds your breath for 4 seconds

Weapons from prone

Weapons are sorted into classes by their weapon group. Each class has its own spread, recoil, sway and fire rate, and you allow or block classes and single weapons in the config.

ClassProneView
Sniper rifles✓Scope with zoom and hold breath
Assault rifles✓First person at the eye, or a low shoulder camera
MGs✓First person at the eye, or a low shoulder camera
SMGs, shotguns, pistolsOff by defaultLie down holstered, or switch them on
Config.Weapons.overrides = {
  weapon_marksmanrifle = 'sniper',  -- treat as a sniper
  weapon_musket = false,            -- never from prone
}

With the other np_* resources

Every resource below is optional and detected when it starts. Without them the resource brings its own stance pill and key hints.

np_inventory

  • Fires the weapon np_inventory has drawn, so ammo and durability stay right.
  • A jammed weapon clicks instead of firing.
  • Reload while deployed goes through np_inventory without breaking the pose.

np_hud

  • A stance chip above the weapon card: crouching, prone, prone deployed.
  • Key hints as np_hud prompts and messages as np_hud toasts.

np_menu

  • The walkstyle picked in np_menu comes back after you crouch.
  • Other resources that set a walkstyle through the SetWalkstyle export get it back too.

np_phone, np_character

  • The phone works while prone or crouched, but doesn't open while you are deployed.
  • No stance changes in the character creator, the phone camera or np_helicam's fullscreen view.

Dead, downed, cuffed, ragdolled, falling, swimming or in a vehicle: the stance ends or is refused, read from ESX, qbx or qb and the usual state bags.

Set it up

Compatibility

Nothing is required. Stances and prone fire need no framework; everything below is detected when the resource starts.

KindSupported
Frameworkes_extended, qbx_core, qb-core (dead, downed and cuffed checks), or standalone
Inventorynp_inventory (drawn weapon, ammo, jams, reload), ox_inventory events, or GTA's own weapon wheel
HUDnp_hud stance chip, prompts and toasts, or the built-in Nimbus UI pill and hints
Other resourcesnp_menu, np_phone, np_character, np_helicam busy states and hooks
crouch_crawlAnswers exports.crouch_crawl:IsPlayerProne() and the other crouch_crawl exports, events and the isProne state bag
ServerOneSync on, so remote players see stances and prone fire

Installation

No database, no SQL, no items, nothing to build.

  1. Put the resource in resources/ as np_crouch-crawl-shoot. Remove crouch_crawl or another crouch script: two scripts on the same key fight over the ped.
  2. Start it after its optional dependencies:
    ensure es_extended        # or qbx_core / qb-core
    ensure np_inventory       # optional, weapons as items
    ensure np_hud             # optional, stance chip and hints
    ensure np_crouch-crawl-shoot
  3. In config.lua, pick the keys, the weapon classes allowed from prone, the aim arc and the stealth noise per stance.
  4. Join with two clients and run /ccs_check, then deploy prone and fire while the other client watches.

For your own scripts

Client exports to read, set and block the stance, local events when it changes, state bags any resource can read and a server export. The name has hyphens, so call it with brackets.

local ccs = exports['np_crouch-crawl-shoot']
ccs:GetStance()                  -- 'stand' | 'crouch' | 'prone'
ccs:BlockStance('my_minigame')   -- refuse stance changes until unblocked
ccs:SetStance('stand', true)     -- force a stance, without the animation

AddEventHandler('np_ccs:deployChanged', function(deployed, weaponClass)
  -- a rifle went up or down
end)

-- any resource, any side
Player(src).state.stance          -- 'stand' | 'crouch' | 'prone'

Questions

Has it been tested in game?

Not yet on a live server. Version 0.1.0 is complete, and its logic (stances, aim maths, shot checks) is covered by unit tests, but the animations and the sync haven't been run with real players. /ccs_check and /ccs_spike are there so you can check both on your server before players use it.

Why don't other prone scripts let you shoot?

GTA's own prone aim task isn't synced in FiveM: other players see the shooter stand up. This resource keeps the ped in a synced animation and fires the real weapon from script, with the body turned towards the aim.

Can other players see me aim up and down?

With the built-in pose, only left and right: the rifle looks level, so the pitch is limited to a small range. A streamed pose pack with one clip per pitch level shows it, set up in Config.Poses.

Do I need a framework?

No. Stances and prone fire work standalone. ESX, qbx or qb only add the dead, downed and cuffed checks.

Will my scripts written for crouch_crawl still work?

Yes. With crouch_crawl removed, this resource answers its exports and fires its events, and sets the isProne state bag.

What about anticheats?

Shots normally go through the ped's own weapon. Only the fallback fires a script bullet, and every prone shot is checked on the server. Set Config.Fire.method = 'ped' to never use script bullets.

Works well with

Get down, line it up, take the shot.

Installation, controls, configuration and every export are in the docs.

Install np_crouch-crawl-shoot