# X\_UTILITY\_ADVANCED\_DriveBy

### **🚀 Overview**

Replace FiveM’s basic drive-by mechanics with **tactical, rule-based shooting**. Perfect for roleplay servers, anti-cheat environments, or realism-focused communities.

***

### **🔧 Key Features**

#### **1. Precision Seat Control**

* **Restrict shooting per seat**:
  * Block drivers/pilots from shooting
  * Allow drive-bys only for specific seats (e.g., front passenger)
  * Helicopters: Disable shooting for pilots, enable for passengers
* **Vehicle-specific overrides**:

  ```
  Config.SpecificVehicleSeats = {  
    ["granger"] = {  
      [3] = { CanDriveBy = true }, -- 3rd row left seat  
    }  
  }  
  ```

#### **2. Realism Mechanics**

* **"Look Behind" Requirement**:
  * Players must face backward to shoot behind vehicles
  * Adjust detection angle:

    luaCopy

    ```
    Config.LookBehind = -7.0 -- More negative = wider restricted zone  
    ```
* **Speed Limits**:

  ```
  Config.MinDriveBySpeed = 10   -- No drive-bys below 10 KMH/MPH  
  Config.MaxDriveBySpeed = 75   -- No drive-bys above 75 KMH/MPH  
  ```

#### **3. Weapon Management**

* **Blacklist OP Weapons**:

  ```
  Config.WeaponBlacklist = {  
    "WEAPON_RPG",  
    "WEAPON_MINIGUN"  
  }  
  ```
* **Whitelist Mode**:

  ```
  Config.EnableWeaponWhitelist = true  
  Config.WeaponWhitelist = { "WEAPON_PISTOL", "WEAPON_MICROSMG" }  
  ```

#### **4. Vehicle Restrictions**

* **Ban Drive-Bys in Specific Vehicles**:

  ```
  Config.RestrictedVehicles = {  
    ["rhino"] = true,   -- Tank  
    ["bus"] = true       -- Bus  
  }  
  ```
* **Class-Wide Rules**:

  ```
  Config.AffectedVehicleClasses = {  
    [15] = false, -- Disable drive-bys in helicopters  
    [19] = false  -- Disable in military vehicles  
  }  
  ```

#### **5. Anti-Abuse Tools**

* **Routing Bucket Restrictions**:

  ```
  Config.RoutingBuckets = { 0, 5 } -- Only allow drive-bys in buckets 0 & 5  
  ```
* **Debug Mode**:\
  Use `/carseat` to view real-time seat permissions and vehicle data.

***

### **⚙️ Configuration Guide**

#### **Core Settings**

```
Config.BetterDriveBy = true        -- Master switch  
Config.DebugMode = false           -- Enable for troubleshooting  
Config.DebugCommandName = "carseat"  
```

#### **Recommended Presets**

| Server Type         | Settings                                                               |
| ------------------- | ---------------------------------------------------------------------- |
| **Roleplay**        | `LookBehind = -7.0`, `MaxSpeed = 50`, `EnableWeaponBlacklist = true`   |
| **Zombie Survival** | `MinSpeed = 0`, `AllowAllVehicleClasses = true`                        |
| **Cops vs Robbers** | `RestrictDriverShooting = true`, `WeaponWhitelist = {"WEAPON_PISTOL"}` |

***

### **🚨 Troubleshooting**

#### **Common Issues**

* **"Drive-By Not Working"**:
  1. Check `Config.BetterDriveBy = true`
  2. Verify seat permissions for the vehicle
  3. Use `/carseat` debug command
* **Conflicts with Other Resources**:

  * Disable sky-to-ground transitions if using multicharacter scripts

  luaCopy

  ```
  Config.transition.enabled = false  
  ```

***

### **📥 Download & Support**

* **Tebex Store**: LINK
* **Discord Support**: [HERE](https://discord.gg/8MzHYRtKME)

\\
