Push Vehicle

This module allows players to push vehicles with immersive mechanics and physics-aware behavior.

Features

  • Target-based interaction for pushable vehicles

  • Push speed adjusts based on slope (uphill = slower, downhill = faster)

  • Ragdoll "slip" effect on steep inclines

  • Prevents pushing if:

    • Vehicle engine or fuel is too high

    • Vehicle is in use, flipped, or being pushed

  • Steering while pushing (A / D)

  • Vehicle class blacklist (e.g., aircraft, heavy trucks)

Installation

To properly install this a couple steps are required

qb-core
  1. First of all you need to remove qb-smallresource's built in "Push Vehicle" file - Delete qb-smallresources/client/vehiclepush.lua

  2. (Optional) Remove the vehicle bone checks for toggling doors, this appears to overwrite "model" targets. This is optional because I've found looking at the wheels seems to get around this overwrite

  3. Restart server and test

  4. If the "Push Vehicle" target appears with a little car image next to it, then you're all good

ox_target

If using QBOX:

  1. Remove or comment out the file: qbx_smallresources/qbx_vehiclepush/client.lua

  2. In my tests, this is all that needs to be done as ox_target appears to happily mix the options together

How It Works

  • Adds interaction targets to all vehicle models on resource start

  • canPush runs checks on:

    • Vehicle health, fuel, class

    • Driver presence or attachment

    • Player state (e.g., dead/downed)

  • When pushing:

    • Player is attached to the vehicle front/back

    • Animation plays

    • Vehicle is pushed with speed adjusted by slope angle

    • Raycast checks for obstruction or unsafe terrain (causes fall)

  • Pushing ends if:

    • E is pressed

    • Vehicle is driven or started

    • Player ragdolls or goes airborne

    • Pitch exceeds ±30°

Notes

  • Enable debugMode to visualize raycasts and pitch/speed info

  • Fully configurable via Config.VehiclePush

  • Supports QBCore/QBox for isDead / isDown player state checks

Last updated