Skip to content

np_crouch-crawl-shoot v0.1.0 ​

A stance system for FiveM: crouch, crawl and prone, plus aiming and firing a rifle while lying down. Public crouch and crawl scripts disable firing while prone, because the engine's prone aim task is not synced to other players. This resource builds prone fire only from things FiveM does replicate (a looping animation, the ped heading and a real weapon shot), so other players see a prone shooter where the bullets come from.

It is standalone. A framework is only used to know when a player is dead or cuffed. np_inventory, np_hud and np_menu are used when they run.

Scoped sniper rifle, prone and deployed

Scope overlay with range, zoom and breath, the key strip and the fallback stance pill. A mockup of the resource's own NUI (html/, used when np_hud is not running) rendered with mock data, not an in-game capture. Key labels in game come from the locale files and can differ.

Features ​

  • Three stances with direct transitions: stand ⇄ crouch ⇄ prone. Crouch to prone and prone to crouch never stand the player up first. Sprinting into prone plays a dive.
  • Crouch with the crouched movement and strafe clipsets, normal GTA aiming and firing, and the player's own walk style restored on exit (np_menu, or any resource that reports it through SetWalkstyle). It replaces GTA's stealth walk on LCONTROL by default.
  • Crawl forward and backward, turn on the spot, steer while crawling, roll onto the back and back again.
  • Prone fire for sniper rifles, assault rifles and LMGs (SMGs, shotguns and pistols can be switched on). Hold aim while prone with an allowed weapon to deploy: snipers get a scope with zoom, sway and hold breath, rifles an eye or shoulder camera. Recoil, spread and fire rate are per weapon class. See Prone fire & sync.
  • What others see matches the shot. The body follows the aim and a shot is only allowed when the body faces the crosshair. A muzzle too close to a wall shows blocked and does not fire.
  • Server validation of every prone shot (stance, weapon, origin, range, fire rate, burst) and a relay for the muzzle flash on nearby clients.
  • Stealth: lower NPC noise multipliers per stance, quiet footsteps while crawling.
  • State bags stance, proneType, proneDeployed for any resource and the server. np_hud shows a stance chip from them. See Events, state bags & commands.
  • Exports to read, set and block the stance, and compatibility aliases for scripts written for MadsLeander's crouch_crawl. See Compatibility.
  • In-game test kit (/ccs_check, /ccs_spike) to check the animations and the sync with two clients. See In-game test kit.
  • English and German locales.
Rifle, ready Rifle, turning Rifle, muzzle blocked
Rifle deployed and ready Rifle deployed while the body turns Rifle deployed with the muzzle blocked
Prone, not deployed Scope Scope, muzzle blocked
Prone with the stance pill Sniper scope Sniper scope with the muzzle blocked

All six are mockups of the fallback NUI with mock data. With np_hud running, the stance pill and the key strip are replaced by np_hud's stance chip and prompts.

Status ​

Not yet run on a live server

Version 0.1.0 was written against stubbed natives. The pure logic (stance transitions, aim maths, weapon classes, shot validation, state bag validation, locales) is covered by plain Lua tests, but nothing has been run in game yet. Run the in-game test kit with two clients before you put it on a live server, and expect animation and tuning values to change.

Known limits of the current version:

  • Pitch is not visible with the vanilla animations. Other players see the shooter's pose and heading (yaw), but the game has no prone aim clips for up and down. With the default vanilla pose pack, the rifle looks level from outside whatever the shooter aims at. Aim pitch is kept within Config.Prone.vanillaPitch (−12° to +18°) so the mismatch stays small. Visible pitch needs a streamed pose pack with one clip per pitch angle. See Prone fire & sync → Pose packs.
  • The shot method is decided at runtime. The resource first fires the ped's real weapon. If that breaks the pose or does not fire on a client, it falls back to a scripted bullet for the rest of the session. Some anticheats flag scripted bullets. See Shot.
  • OneSync is required for other players to see stances and prone fire.
  • Firing on the back (pistol) and slope alignment are not implemented. Prone is refused on ground steeper than Config.Prone.blockOnSlopeDeg.

Next steps ​