# 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

<details>

<summary>qb-core</summary>

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

<figure><img src="https://2579759843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsfxDadT7FSSj4RnXqjJP%2Fuploads%2FHjaZkO0LeV4tR6emXTIL%2Fimage.png?alt=media&#x26;token=6130ad83-cb7b-49c7-8300-fc6a71693fe9" alt=""><figcaption></figcaption></figure>



</details>

<details>

<summary>ox_target</summary>

### If using QBOX:

1. Remove or comment out the file: `qbx_smallresources/qbx_vehiclepush/client.lua`&#x20;
2. In my tests, this is all that needs to be done as ox\_target appears to happily mix the options together\
   \
   ![](https://2579759843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsfxDadT7FSSj4RnXqjJP%2Fuploads%2FSn7pbjROl5F22IB9bfge%2Fimage.png?alt=media\&token=91d025a5-410b-4bc4-8959-415ae3261490)

</details>

### 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
