Configuration

All configuration for legends_driveby is done in the config.lua file. The configuration is divided into three main sections: POV Settings, Vehicle Access, and Offset Settings.

Configuration File Structure

Location: config.lua

Config = {
    POVSettings = { ... },
    VehicleAccess = { ... },
    OffsetSettings = { ... }
}

POV Settings

Controls camera behavior during drive-by mode and regular vehicle shooting.

ForceFirstPersonInDriveby

POVSettings = {
    ForceFirstPersonInDriveby = true,
}

Description: Forces players into first-person camera view while in drive-by mode.

Type: boolean

Default: true

ValueBehavior
trueCamera locked to first-person during drive-by
falsePlayers can use any camera angle during drive-by

ForceFirstPersonInVehicle

POVSettings = {
    ForceFirstPersonInVehicle = false,
}

Description: Forces first-person view when shooting from inside vehicles (when NOT in drive-by mode).

Type: boolean

Default: false

This setting only affects regular vehicle shooting, not the custom drive-by system.

DisableVehicleShooting

POVSettings = {
    DisableVehicleShooting = false
}

Description: Completely disables the default GTA vehicle shooting. When enabled, players can only shoot from vehicles using the drive-by system.

Type: boolean

Default: false

ValueBehavior
trueDefault vehicle shooting disabled; must use drive-by system
falseBoth default shooting and drive-by system available

Vehicle Access

Controls which vehicles can use the drive-by feature.

GlobalSettings

VehicleAccess = {
    GlobalSettings = true,
}

Description: Determines the access mode for vehicles.

Type: boolean

Default: true

ValueModeBehavior
trueBlacklist ModeAll vehicles allowed EXCEPT those in BlacklistedVehicles
falseWhitelist ModeONLY vehicles in WhitelistedVehicles are allowed

WhitelistedVehicles

VehicleAccess = {
    WhitelistedVehicles = {
        -664141241, -- krieger
        970598228,  -- sultan
        -1216765807 -- adder
    },
}

Description: List of vehicle hashes that CAN use drive-by when GlobalSettings = false.

Type: table (array of vehicle hashes)

Default: Contains krieger, sultan, and adder as examples

Only used when GlobalSettings = false (whitelist mode).

BlacklistedVehicles

VehicleAccess = {
    BlacklistedVehicles = {
        -331467772, -- italigto
    },
}

Description: List of vehicle hashes that CANNOT use drive-by when GlobalSettings = true.

Type: table (array of vehicle hashes)

Default: Contains italigto as an example

Only used when GlobalSettings = true (blacklist mode).

BlockedVehicleClasses

VehicleAccess = {
    BlockedVehicleClasses = {
        8,  -- Motorcycles
        13, -- Cycles (Bicycles)
        14, -- Boats
        15, -- Helicopters
        16, -- Planes
        22, -- Open Wheel
    }
}

Description: Vehicle classes that are always blocked from using drive-by, regardless of whitelist/blacklist settings.

Type: table (array of vehicle class IDs)

Default: Blocks motorcycles, bicycles, boats, helicopters, planes, and open wheel vehicles

Class IDVehicle Type
0Compacts
1Sedans
2SUVs
3Coupes
4Muscle
5Sports Classics
6Sports
7Super
8Motorcycles
9Off-road
10Industrial
11Utility
12Vans
13Cycles
14Boats
15Helicopters
16Planes
17Service
18Emergency
19Military
20Commercial
21Trains
22Open Wheel

Offset Settings

Controls player positioning when in drive-by mode.

DebugCommand

OffsetSettings = {
    DebugCommand = false,
}

Description: Enables the /GetVehicleHash command for finding vehicle hashes.

Type: boolean

Default: false

When enabled, use /GetVehicleHash while inside a vehicle to print the vehicle's hash to the F8 console.

DefaultOffsets

OffsetSettings = {
    DefaultOffsets = {
        [0] = { x = 0.5,  y = 0.0, z = 0.75, rotation = 30.0,  bone = "seat_pside_f" },  -- Front Right
        [1] = { x = -0.5, y = 0.0, z = 0.75, rotation = -30.0, bone = "seat_dside_r" },  -- Rear Left
        [2] = { x = 0.5,  y = 0.0, z = 0.75, rotation = 30.0,  bone = "seat_pside_r" },  -- Rear Right
    },
}

Description: Default position offsets applied to all vehicles unless overridden.

Type: table (indexed by seat number)

Seat Index Reference:

IndexSeat Position
-1Driver (cannot use drive-by)
0Front Passenger
1Rear Left
2Rear Right
3+Additional seats

Offset Properties:

PropertyTypeDescription
xnumberLeft/right offset (positive = right)
ynumberForward/backward offset (positive = forward)
znumberUp/down offset (positive = up)
rotationnumberPlayer rotation in degrees
bonestringVehicle bone to attach to

Common Bone Names:

  • seat_pside_f - Front passenger seat
  • seat_dside_r - Rear driver-side seat
  • seat_pside_r - Rear passenger-side seat

VehicleOffsets

OffsetSettings = {
    VehicleOffsets = {
        -- Example using GetHashKey
        [GetHashKey("adder")] = {
            [0] = { x = 0.6, y = 0.0, z = 0.8, rotation = 35.0, bone = "seat_pside_f" },
        },
 
        -- Example using hardcoded hash
        [-664141241] = { -- krieger
            [0] = { x = 0.5, y = 0.1, z = 0.7, rotation = 25.0, bone = "seat_pside_f" },
        },
    }
}

Description: Vehicle-specific offsets that override DefaultOffsets for specific vehicles.

Type: table (indexed by vehicle hash, then by seat number)

Use vehicle-specific offsets for:

  • Right-hand drive vehicles
  • Vehicles with unique window shapes
  • Vehicles where default positioning looks incorrect

Getting Vehicle Hashes

There are two ways to get a vehicle's hash:

Method 1: Debug Command

  1. Set DebugCommand = true in config
  2. Enter the vehicle in-game
  3. Type /GetVehicleHash in chat
  4. Check F8 console for the hash

Method 2: Lua Function

Use GetHashKey("vehicle_spawn_name") directly in the config:

[GetHashKey("adder")] = { ... }

Example Configurations

Whitelist Mode (Specific Vehicles Only)

VehicleAccess = {
    GlobalSettings = false,
    WhitelistedVehicles = {
        GetHashKey("sultan"),
        GetHashKey("kuruma"),
        GetHashKey("schafter2"),
    },
    BlockedVehicleClasses = {
        8, 13, 14, 15, 16, 22
    }
}

Immersive Roleplay Setup

POVSettings = {
    ForceFirstPersonInDriveby = true,
    ForceFirstPersonInVehicle = true,
    DisableVehicleShooting = true -- Only allow custom drive-by
}

Need Help?

Join our Discord for support: discord.gg/lgnds (opens in a new tab)


Legends Store - Premium FiveM Scripts