For the complete documentation index, see llms.txt. This page is also available as Markdown.

Configuration

Available configuration options to customize the script.

const Config = {};

// Legend
// Outside Garages = Refers to parking the vehicle anywhere on the map and a prop model appearing in it's place.
// Inside Garages = Refers to parking the vehicle in a specific garage and despawning it.

// ⚠⚠⚠ = An option that could cause the resource to stop working as intended or cause performance issues. Use with caution!
// DISCLAIMER: NO SUPPORT WILL BE PROVIDED IF ANY OF THE OPTIONS MARKED WITH ⚠⚠⚠ ARE NOT THE DEFAULT VALUES!

// ####################################
// #                                  #
// #                                  #
// #         GLOBAL OPTIONS           #
// #                                  #
// #                                  #
// ####################################

Config.Framework = 'auto'; // auto, qbox, qb, esx, custom
// The default framework inventory is supported out of the box.
// If you use another inventory, modify the code in dist/bridge/server/(your_framework).js

Config.Debug = false // Prints additional debug messages

Config.GarageMenu = {
    enabled: true,
    command: {
        name: 'garage',
        description: 'View and manage all your vehicles'
    },
    remoteUnpark: { // Allows players to remotely unpark/spawn their outside vehicles from the menu
        enabled: true,
        giveKeyRadius: 10 // Shows all players in range of the vehicle that should receive the keys
    },
    markLocation: { // Ability for player to mark the vehicle location when parked or impounded
        inside: true,
        outside: true,
        impound: false
    }
};

Config.Interactions = {
    maxDistance: 1.7,
    canParkWhileInside: true, // Whether you can park the vehicle while sitting in it.
    canParkWithPassengers: true, // Whether you can park the vehicle if it has passengers inside.
    keybind: 38 // Used for TextUI interactions. https://docs.fivem.net/docs/game-references/controls/#controls
};

Config.Permissions = {
    canParkIfNotOwned: { // Whether anyone can park a vehicle, even if it's owned by someone else.
        outside: true,
        inside: true
    },
    canParkIfNoAccess: { // Whether anyone can park a vehicle inside a garage they do not have access to.
        inside: true
    },
};

Config.Animations = {
    park: { // Vehicle fading when parking
        outside: true,
        inside: true,
        rate: 3, // The rate at which the animation is played
        delay: 1 // The delay in miliseconds between the next animation frame
    },
    appear: { // Object appearing after vehicle has been parked
        outside: true,
        rate: 3, // The rate at which the animation is played
        delay: 1 // The delay in miliseconds between the next animation frame
    },
};

Config.SpawnOptions = {
    outside: {
        unparkLockState: 1, // 0 = default game state; 1 = unlocked; 2 = locked; This is after the vehicle has been spawned (unparked).
        engineRunning: false,
        warpIntoVehicle: false,
    },
    inside: {
        unparkLockState: 1, // 0 = default game state; 1 = unlocked; 2 = locked; This is after the vehicle has been spawned (unparked).
        engineRunning: true,
        warpIntoVehicle: true,
        checkOccupied: { // Check if the area is occupied by another vehicle when taking out of garage
            enabled: true,
            distance: 2
        },
    },
    depot: {
        unparkLockState: 1, // 0 = default game state; 1 = unlocked; 2 = locked; This is after the vehicle has been spawned.
        engineRunning: true,
        warpIntoVehicle: true,
        checkOccupied: { // Check if the area is occupied by another vehicle when taking out of garage
            enabled: true,
            distance: 2
        },
    },
    jacked: { // When the vehicle has been carjacked
        unparkLockState: 2, // 0 = default game state; 1 = unlocked; 2 = locked; This is after the vehicle has been spawned (unparked).
        engineRunning: false,
        warpIntoVehicle: false,
    },
    impound: {
        unparkLockState: 2,
        engineRunning: false,
        warpIntoVehicle: false,
        checkOccupied: { // Check if the area is occupied by another vehicle when SPAWNING non-physical vehicle from impound
            enabled: true,
            distance: 2
        },
    }
};


// When spawning a vehicle through the depot, it will be repaired with full health.
// Depending on the current state of the vehicle, the price is different. Prices can be changed below.
// When spawning via the depot, if the old vehicle exists on the map it will be deleted to prevent duplication.
Config.Depot = {
    interactions: {
        preferTarget: true, // If true, will use ox_target if available, false for text UI
        targetOptions: {
            name: 'Open Depot',
            icon: 'warehouse'
        },
    },
    prices: { // Prices depend on the vehicle state when taking out of the depot.
        missingWorking: 1500, // Vehicle is not spawned on the map and when it was last spawned it's engine was working.
        missingBroken: 10000, // Vehicle is not spawned on the map and when it was last spawned, it's engine was broken.
        spawnedBroken: 3000, // Vehicle is spawned on the map, but it's engine is broken.
        spawnedWorking: 7000 // Vehicle is spawned and it's not broken.
    },
    locations: {
        city: {
            label: 'Los Santos',
            type: 'land', // land, water, air
            points: {
                menu: [-160.6362, -1162.0336, 22.8887, 269.8439],
                spawn: [
                    [-151.9821, -1162.2888, 25.2869, 259.7493],
                    [-152.1170, -1165.7527, 25.2589, 269.0813],
                    [-152.1190, -1168.9435, 25.2176, 267.7451],
                    [-152.2957, -1172.0688, 25.1755, 265.3527],
                    [-152.5797, -1175.0745, 25.1296, 268.2219]
                ]
            },
            blip: {
                enabled: true,
                sprite: 317, // https://docs.fivem.net/docs/game-references/blips/
                color: 1, // https://docs.fivem.net/docs/game-references/blips/#blip-colors
                scale: 0.7,
            },
            npcModel: 's_m_m_ccrew_01'
        },
        paleto: {
            label: 'Paleto Bay',
            type: 'land', // land, water, air
            points: {
                menu: [96.0323, 6363.4253, 30.3759, 10.9867],
                spawn: [
                    [95.0378, 6372.0400, 31.2258, 9.3269],
                    [98.6111, 6373.8335, 31.2258, 7.9667],
                    [101.9770, 6376.3726, 31.2258, 8.3493],
                ]
            },
            blip: {
                enabled: true,
                sprite: 317, // https://docs.fivem.net/docs/game-references/blips/
                color: 1, // https://docs.fivem.net/docs/game-references/blips/#blip-colors
                scale: 0.7,
            },
            npcModel: 's_m_m_ccrew_01'
        },
        sandy: {
            label: 'Sandy Shores',
            type: 'land', // land, water, air
            points: {
                menu: [1898.4939, 3707.3521, 31.7805, 117.1301],
                spawn: [
                    [1894.8556, 3706.2773, 32.8254, 118.1982],
                ]
            },
            blip: {
                enabled: true,
                sprite: 317, // https://docs.fivem.net/docs/game-references/blips/
                color: 1, // https://docs.fivem.net/docs/game-references/blips/#blip-colors
                scale: 0.7,
            },
            npcModel: 's_m_m_ccrew_01'
        },
        airport: {
            label: 'City Airport',
            type: 'air', // land, water, air
            points: {
                menu: [-1289.3459, -3350.7886, 12.9401, 239.8171],
                spawn: [
                    [-1274.1547, -3379.7485, 13.9401, 327.4670],
                ]
            },
            blip: {
                enabled: true,
                sprite: 317, // https://docs.fivem.net/docs/game-references/blips/
                color: 1, // https://docs.fivem.net/docs/game-references/blips/#blip-colors
                scale: 0.7,
            },
            npcModel: 's_m_m_ccrew_01'
        },
        docks: {
            label: 'City Docks',
            type: 'water', // land, water, air
            points: {
                menu: [611.4539, -3204.2271, 5.0695, 0.9396],
                spawn: [
                    [621.7027, -3238.6921, 13.1654, 181.7283],
                ]
            },
            blip: {
                enabled: true,
                sprite: 317, // https://docs.fivem.net/docs/game-references/blips/
                color: 1, // https://docs.fivem.net/docs/game-references/blips/#blip-colors
                scale: 0.7,
            },
            npcModel: 's_m_m_ccrew_01'
        },
    }
};


Config.Impound = {
    command: {
        name: 'confiscate',
        description: 'Impound a parked or spawned vehicle (police only)',
        params: ['Name of the impound (optional)', 'Slot where the vehicle should be placed, starting from 0 (optional)'],
        accessGroups: ['police'], // Add groups (jobs, gangs), CIDs or group-grade pairs (jobs: { police: 0 }) that can access this impound.
    },
    depotCommand: {
        name: 'depotveh',
        description: 'Remove a spawned vehicle and send it depot. (police only)',
        accessGroups: ['police'], // Add groups (jobs, gangs), CIDs or group-grade pairs (jobs: { police: 0 }) that can access this impound.
    },
    interactions: {
        menu: { // Impound menu
            preferTarget: true, // If true, will use ox_target if available, false for text UI
            targetOptions: {
                name: 'Open Impound',
                icon: 'warehouse'
            },
        },
        release: { // Target for physical vehicles
            enabled: true,
            targetOptions: {
                name: 'Release Vehicle',
                icon: 'car-on'
            },
        }
    },
    transferFee: 2500, // Fee for transferring a vehicle from one impound to another
    giveKeyRadius: 10, // Displays all nearby players with this radius to receive the vehicle key when releasing.
    purge: { // An option to remove all vehicles from an impound. Action is defined below
        enabled: true,
        accessGroups: { police: 4 }, // Add groups (jobs, gangs), CIDs or group-grade pairs (jobs: { police: 0 }) that can access this impound.

        // despawn = keep in current depot, but non-physical. depot = send to depot. delete = permanently delete vehicle from garage
        // NOTE: it will only delete vehicles from the garage table, NOT the framework's player vehicles table. Meaning, they can be spawned again, just
        // not with up-to-date information.
        action: 'depot' // 'despawn' | 'depot' | 'delete'
    },
    // When the impound is full and a new vehicle is impounded, what should happen to the first impounded vehicle (oldest).
    // deny = cannot impound new vehicles; despawn = remove first vehicle as physical but keep in impound; depot = send to depot; delete = permanently delete from garages DB
    overflowAction: 'deny', // 'deny' | 'despawn' | 'depot' | 'delete'
    locations: {
        // ##################################################################
        // #                                                                #
        // #   ALL IMPOUND LOCATIONS CAN BE FOUND IN THE ./impounds.js FILE #
        // #                                                                #
        // ##################################################################
    }
};

// ###########################################################################################################################################
// ###########################################################################################################################################


// ####################################
// #                                  #
// #                                  #
// #         OUTSIDE GARAGES          #
// #                                  #
// #                                  #
// ####################################

// The chunks determine which vehicles are loaded at the same time. They should cover the whole map.
// ATTENTION: AFTER ADJUSTING VALUES BELOW, ALL VEHICLES THAT ARE CURRENTLY PARKED OUTSIDE AND DO NOT BELONG IN THE NEW CHUNK WILL BE PUT IN THE DEPOT!
Config.Chunks = { // ⚠⚠⚠ CAUTION ⚠⚠⚠

    // These are the coordinates of the 4 corners of the map plus min and max height. 
    // If you have a map extension (like the cayo perico), you should adjust so the chunks cover that additional area.
    boundaries: {
        MAP_MIN_X: -4000,
        MAP_MAX_X: 4500,
        MAP_MIN_Y: -4000,
        MAP_MAX_Y: 8000,
        MAP_MIN_Z: -150,
        MAP_MAX_Z: 1000
    },
    CHUNK_SIZE: 200, // This determines the chunk size. The greater the value, the more stored vehicles will be loaded at a time. DISCLAIMER: TOO SMALL OF A CHUNK SIZE CAN CAUSE PERFORMANCE ISSUES!
    debug: false // Set to true to visualize the chunks (WARNING: Drastically decreases performance)
}

Config.Interactions.Outside = {
    enabled: true,
    park: {
        command: {
            enabled: true,
            name: 'park',
            description: 'Park the closest vehicle or the one you\'re in'
        },
        radial: {
            enabled: true,
            name: 'Park Vehicle',
            icon: 'square-parking'
        },
        target: {
            enabled: true,
            name: 'Park Vehicle',
            icon: 'square-parking'
        },
    },
    unpark: {
        command: {
            enabled: true,
            name: 'unpark',
            description: 'Unpark the closest vehicle'
        },
        radial: {
            enabled: true,
            name: 'Unpark Vehicle',
            icon: 'warehouse'
        },
        target: {
            enabled: true,
            name: 'Unpark Vehicle',
            icon: 'warehouse'
        }
    },
}

// An item that is used for 'jacking' (unparking) outside parked vehicles.
Config.CarJacker = {
    enabled: true,
    item: 'carjacker',
    removeOnFail: true, // Whether the item should be removed from the player if they've failed the minigame.
    removeOnSuccess: true, // Whether the item should be removed from the player after they've succeeded the minigame.
    startMinigame: () => { // This is ran on the client and must return a boolean whether the minigame is successfull.
        return exports['glitch-minigames'].StartFirewallPulse();
    },
    alarm: {
        enabled: true,
        timeout: 60, // After how many seconds the alarm stops if the minigame was failed
        requireMinigame: true, // If true, it will require a second minigame in order to stop the alarm. If false, the alarm stops as soon as the vehicle is jacked.
        startMinigame: () => {
            return exports['glitch-minigames'].StartCircuitBreaker(Math.floor(Math.random() * 2) + 1, 0, 2000, 500, 500, 0, 0);
        },
    },
    giveKeys: false // Whether the player who jacked the vehicle should receive the keys or have to lockpick it.
}

Config.VehicleClasses = [ // What object models should appear when the vehicle is parked, depending on it's class. (https://docs.fivem.net/natives/?_0x29439776AAA00A62)
    'imp_prop_covered_vehicle_02a', // Compacts
    'imp_prop_covered_vehicle_01a', // Sedans
    'imp_prop_covered_vehicle_07a', // SUVs
    'imp_prop_covered_vehicle_03a', // Coupes
    'imp_prop_covered_vehicle_03a', // Muscle
    'imp_prop_covered_vehicle_04a', // Sports Classic
    'imp_prop_covered_vehicle_01a', // Sports
    'imp_prop_covered_vehicle_01a', //Super
    'prop_rub_bike_03', // Motorcycles
    'imp_prop_covered_vehicle_07a', // Offroad
    'prop_flattrailer_01a', // Industrial
    'imp_prop_covered_vehicle_05a', // Utility
    'imp_prop_covered_vehicle_05a', // Vans
    'prop_rub_bike_02', // Cycles
    'prop_byard_boat01', // Boats
    'prop_container_03a', // Helicopters
    'hei_prop_carrier_jet', // Planes
    'imp_prop_covered_vehicle_05a', // Service
    'imp_prop_covered_vehicle_03a', // Emergency
    'prop_container_01e', // Military
    'prop_truktrailer_01a', // Commercial
    '', // Trains
    '' // Open Wheel
];

Config.VehicleModels = { // This overrides the class-based mapping and for each individual vehicle model, a parked object model can be chosen. 
    // 'vehicleModel': 'parkedModel', // Remove the '//' at the start of the line
    // 'vehicleModel': 'parkedModel',
    // 'vehicleModel': 'parkedModel',
};

Config.BlacklistedTypes = { // Prevent vehicles with this type from being parked outside.
    automobile: false, // Set to true to prevent it from being parked.
    bike: false,
    boat: false,
    heli: false,
    plane: false,
    submarine: false,
    trailer: false,
    train: false
};

Config.BlacklistedModels = [ // Prevent specific vehicle models from being parked outside.
    'kosatka',
];

Config.GroundCheck = { // Checks whether the vehicle is on all 4 wheels before parking it.
    automobile: true,
    bike: true,
    boat: true,
    heli: true,
    plane: true,
    submarine: true,
    trailer: true,
    train: true
};

Config.HighlightOwnedVehicles = { // Whether to highlight parked vehicles when the player gets near them if they own them
    enabled: true,
    options: {
        distance: 5,
        color: [255, 255, 255, 255], // RGBA
        glow: true
    },
    interactions: {
        command: {
            enabled: true,
            name: 'highlight',
            description: 'Toggle highlight for nearby parked vehicles that you own'
        },
        keybind: {
            enabled: true,
            default: 'LBRACKET', // Default keybind for new players. Can be changed by each user individually.
            toggle: false, // true = toggleable, false = hold key
            description: 'Highlight owned parked vehicles'
        }
    },
    default: false // Whether the highlight is enabled/disabled by default. If no interactions are enabled, set this to 'true'
};

// Inside garage store points and impound zones are automatically added. Only depot spawn points need to be manually added.
Config.SafeZones = {
    pointsRadius: 5, // Radius of safe zones created around Inside Garage interaction points (park, spawn, menu).
    zones: [ // Make sure each zone is large enough so players can't park a vehicle in the zone while they're outside the zone. (Config.Interactions.maxDistance)
        
        // City Depot
        {
            points: [ // PolyZone points. You can use '/pzcreate poly', '/pzadd' and '/pzfinish' for easier creation.
                vector2(-161.07232666016, -1158.0786132812),
                vector2(-161.16448974609, -1186.2835693359),
                vector2(-140.00260925293, -1186.2198486328),
                vector2(-140.75495910645, -1157.6209716797)
            ],
            minZ: 22,
            maxZ: 28
        },

        // Paleto Depot
        {
            points: [ // PolyZone points. You can use '/pzcreate poly', '/pzadd' and '/pzfinish' for easier creation.
                vector2(86.633056640625, 6377.8676757812),
                vector2(94.066596984863, 6361.9736328125),
                vector2(115.9801864624, 6372.9194335938),
                vector2(105.732421875, 6390.16015625)
            ],
            minZ: 30,
            maxZ: 33
        },

        // Sandy Depot
        {
            points: [ // PolyZone points. You can use '/pzcreate poly', '/pzadd' and '/pzfinish' for easier creation.
                vector2(1903.8697509766, 3702.1652832031),
                vector2(1893.3161621094, 3695.7080078125),
                vector2(1884.6793212891, 3706.6765136719),
                vector2(1895.2440185547, 3714.1262207031)
            ],
            minZ: 31,
            maxZ: 35
        },
    ],
    debug: false // Whether to visualize the polyzones
};

Config.Blips = {
    enabled: true, // Enables blips on the map for parked vehicles outside of garages.
    color: 0xe9a7fffc, // https://docs.fivem.net/docs/game-references/blips/#blip-colors
    scale: 0.8,
    keepOnMinimap: true, // Whether the blips should always appear on the minimap, even if not near them.
    limit: 10, // If keepOnMinimap is true, shows only the last x parked vehicles after joining (Can increase after parking new vehicles). Set to <0 to show all.
    shrink: true, // If keepOnMinimap is true, shrinks the blips on the minimap so they're not in the way
    sprites: { // https://docs.fivem.net/docs/game-references/blips/
        automobile: 825,
        bike: 749,
        boat: 455,
        heli: 753,
        plane: 579,
        submarine: 308,
        trailer: 479,
        train: 795
    }
}

Config.Cache = { // ⚠⚠⚠ CAUTION ⚠⚠⚠
    ttl: 30, // After x minutes unused chunks will be deleted
    cronExpression: '*/5 * * * *', // The cron expression used to run check for expired (TTL) chunks
    maxSize: 300 // Maximum amount of cached chunks. Oldest chunks will be replaced by new ones
};

// ###########################################################################################################################################
// ###########################################################################################################################################


// ####################################
// #                                  #
// #                                  #
// #     INSIDE (BASIC) GARAGES       #
// #                                  #
// #                                  #
// ####################################

Config.Interactions.Inside = {
    enabled: true,
};

Config.Garages = {
    // ##################################################################
    // #                                                                #
    // #   ALL GARAGE LOCATIONS CAN BE FOUND IN THE ./garages.js FILE   #
    // #                                                                #
    // ##################################################################
};


// ###########################################################################################################################################
// ###########################################################################################################################################


// ####################################
// #                                  #
// #                                  #
// #        HELPER FUNCTIONS          #
// #                                  #
// #                                  #
// ####################################

function vector2(x, y) {
    return { x, y };
};

Last updated