Back to Script

🚓 Parking Enforcement Career | Qb-core - Qbox - ESX Documentation

Installation guide, configuration details, and best practices.

About WD Parking Enforcement

wd_parking_enforcment is an immersive and interactive career script for FiveM that allows players to take on the role of a Parking Enforcement Officer. Built to seamlessly integrate with modern frameworks, it brings life to city streets by adding realistic ticketing mechanics and unexpected encounters.

Key Features

  • Multi-Framework Support: Works natively out-of-the-box with QBCore, Qbox (qbx_core), and ESX (es_extended).
  • Targeting Integration: Fully supports interaction via qb-target, qbx_target, and ox_target.
  • Dynamic Job Flow: Players interact with a dedicated NPC to sign on duty and receive their official parking enforcement vehicle.
  • Vehicle Inspections: Use your target system (third eye) on parked local vehicles to check their:
    • Parking Validity
    • Inspection Status
    • Registration Status
  • Interactive Ticketing UI: An integrated custom NUI allows players to write out detailed tickets and physically attach them to offending vehicles.
  • Dynamic Encounters: Features a built-in probability system where "Angry Locals" might confront and attack the officer while they are inspecting or ticketing a vehicle, adding a layer of risk and excitement.
  • Customizable Economy: Configure payouts for valid tickets and penalties for returning damaged equipment or issuing false charges.

How it Works

  1. Sign On Duty: Approach the parking enforcement NPC to start your shift.
  2. Get Vehicle & Equipment: Retrieve your official enforcement vehicle and grab your ticketing equipment from the trunk.
  3. Patrol: Drive around the city searching for parked NPC vehicles (population type 2).
  4. Inspect: Use the target eye on a vehicle to check its parking, inspection, and registration status.
  5. Issue Tickets: If an offence is found, write a ticket via the custom UI and attach it directly to the car.
  6. Watch Your Back: Keep an eye out for angry vehicle owners who might not appreciate you ticketing their car!
  7. Sign Off: Return your vehicle and equipment to end your shift and collect your earnings.

Installation Guide

Follow these steps to successfully install wd_parking_enforcment on your FiveM server.

Requirements

The script is built to be highly compatible and requires the following dependencies based on your server's setup:

  1. A Supported Framework (Choose One):

    • qb-core
    • qbx_core (Qbox)
    • es_extended (ESX)
    • Note: Standalone mode is partially supported but requires custom implementation for player and inventory management.
  2. A Supported Target System (Choose One):

    • qb-target
    • qbx_target
    • ox_target
  3. Database Resource:

    • oxmysql (Required for saving ticket data)
  4. Inventory System (Optional but Recommended):

    • Integrates natively with ox_inventory, qb-inventory, and standard ESX inventory.
  5. Vehicle Keys System (Optional but Recommended):

    • Natively supports qb-vehiclekeys, qbx_vehiclekeys, wasabi_carlock, qs-vehiclekeys, and mr-vehiclekeys.

Installation Steps

  1. Download and Extract: Download the resource and place the wd_parking_enforcment folder into your server's resources directory (e.g., inside a [jobs] or [wd] folder).

  2. Configure the Script: Open shared/sh_main.lua and adjust the configuration to fit your server's needs (ped locations, vehicle models, payouts, etc.). Refer to config.md for detailed explanations.

  3. Database Setup: Ensure you import any provided .sql files into your database if the script came with them, so the ticketing tables are created. (If no .sql is provided, the script might automatically manage its tables depending on the version, or relies purely on server state).

  4. Add to Server Config: Open your server.cfg and add the following line to ensure the resource starts with your server:

    ensure wd_parking_enforcment
    

    Make sure you ensure this resource after your framework and target resources have been started.

  5. Restart Server: Restart your server or run ensure wd_parking_enforcment in your live server console.

Troubleshooting

  • No options on the NPC ped: Ensure your targeting script (ox_target, qb-target, or qbx_target) is running correctly. If you are using Qbox, ensure qbx_target or ox_target is started before this script.
  • Can't get vehicle keys: Ensure you are using a supported key system. The script automatically attempts to grant keys via the most common QBCore, Qbox, and ESX exports.
  • Errors in server console on startup: Ensure oxmysql is running and properly connected to your database.

Configuration Guide

The script's settings can be found in shared/sh_main.lua. This file allows you to customize almost every aspect of the parking enforcement job.

Below is a breakdown of the configuration options:

Config = {
    Debug = false, -- Set to true to enable debug prints in the server/client consoles.

Offences

The offences table controls the different types of checks an officer can perform on a parked vehicle, as well as the chance of that vehicle failing the check.

    offences = {
        ["parking"] = {
            chance = 0.25, -- 25% chance the vehicle is parked illegally
            messages = {
                nValid = "The vehicle does not have valid parking.",
                valid = "Vehicle has valid parking."
            },
            title = "Parking"
        },
        ["inspection"] = {
            chance = 0.25, -- 25% chance the vehicle fails inspection
            messages = {
                nValid = "The vehicle does not have a valid inspection.",
                valid = "Vehicle has a valid inspection."
            },
            title = "Inspection"
        },
        ["registration"] = {
            chance = 0.25, -- 25% chance the vehicle is unregistered
            messages = {
                nValid = "The vehicle does not have a valid registration.",
                valid = "Vehicle has a valid registration."
            },
            title = "Registration"
        }
    },
  • chance: A decimal representing the probability of failure (e.g., 0.25 is 25%).
  • messages: The notification text shown to the officer after performing the check.
  • title: The title of the offence shown in menus/notifications.

Vehicle & NPC Settings

Configure where the NPC stands, what they look like, and what vehicle is given to the officer.

    -- Where the official enforcement vehicle will spawn
    vehicleSpawn = vector4(822.58, -1366.63, 26.13, 6.09),
    
    -- The spawn name of the enforcement vehicle
    vehicleType = `Stanier`, 
    
    -- Optional vehicle mods to apply upon spawn (e.g., liveries, performance)
    vehicleMods = {
        -- Example: [48] = 1 (Applies livery index 1)
    },
    
    -- Where the NPC ped stands to give the job
    pedPosition = vector4(818.46, -1375.48, 25.31, 1.29),
    
    -- The model of the NPC ped
    pedType = `csb_cop`,

Economy & Penalties

Customize how much players earn and how much they are penalized for mistakes.

    penalties = {
        vehicleRet = 150,  -- Fine for returning a damaged vehicle
        equipment = 50,    -- Fine for losing or damaging equipment
        falseCharge = 50   -- Fine for ticketing a vehicle that actually had valid documents
    },

    payout = {
        money = {
            min = 50, -- Minimum payout for a valid ticket
            max = 75  -- Maximum payout for a valid ticket
        }
    },

Dynamic Events

The angry local system brings the city to life by occasionally spawning an aggressive NPC when an officer interacts with a vehicle.

    -- The probability (0.0 to 1.0) that an angry local will attack the officer
    -- when they inspect or ticket a vehicle. 
    -- 0.1 = 10% chance
    angryLocal = 0.1,

Map Blip

Configure the map icon for the starting location.

    blip = {
        sprite = 56, -- The blip icon ID (56 is a standard police/badge icon)
        colour = 5,  -- The blip color ID (5 is yellow)
    }
}

You can find full lists of Blip sprites and colors on the FiveM Native Reference documentation.

Claim your coupons here!