RDE_PARKING DOCS
RED DRAGON ELITE // PLAYER SYSTEMS

One Vehicle Per Plate.
Not a Duplicate Every Delivery.

rde_parking is a production-grade parking & lock system: server-side proximity streaming so parked vehicles only exist as world entities near a player, statebag-synced lock state and mods, and a bidirectional bridge with rde_carservice so parking and delivery never fight over the same vehicle again.

01 / Start Here

Overview

Server-side proximity streaming, full statebag synchronization for lock state and vehicle mods, ox_target interaction, persistent MySQL storage, and server-validated ownership on every action. v1.1.1 completes bidirectional integration with rde_carservice so both scripts operate as one coherent system.

Core Principle Parked vehicles only exist as world entities while a player is actually within range — a server with thousands of parked vehicles spread across the map costs roughly the same as one with a hundred.

Why this over other parking scripts

Other Parking Scriptsrde_parking
Every parked car spawns at boot, foreverProximity-streamed — spawns only near players
Client trusts its own plate/netId for lockingServer-side owner verification on every action
Vehicle mods only visible to whoever parked itStatebag + broadcast sync to every nearby player
Silently conflicts with delivery scriptsFull rde_carservice integration, zero conflicts
02 / Start Here

Quick Start

server.cfg
ensure oxmysql
ensure ox_lib
ensure ox_core
ensure ox_target
ensure rde_parking

-- optional
ensure rde_nostr_log
ensure rde_carservice

Everything runs through ox_target — no keybind system. Standing near your own vehicle shows Lock/Unlock/Park/Retrieve depending on state. Getting in a parked vehicle and starting the engine auto-retrieves it.

03 / Reference

Configuration

config.lua
Config.ParkDistance  = 5.0    -- max distance to park from vehicle
Config.LockDistance  = 10.0   -- max distance for lock/unlock
Config.SpawnDistance = 150.0  -- proximity radius: vehicles spawn within this range

Config.RequireEngineOff = true
Config.MinHealthToPark  = 100.0

Config.Performance = {
    proximityCheckInterval    = 5000,   -- ms between server sweeps
    despawnDistanceMultiplier = 1.5,    -- despawn radius = SpawnDistance × this
    despawnGraceMs            = 30000,  -- ms with nobody nearby before despawn
}
04 / Reference

rde_carservice Integration

Requires rde_carservice v1.1.0+. Both resources degrade gracefully if the other isn't running. Two silent bugs existed before this bridge:

BugRoot CauseFix
Duplicate entity / disappearing parked vehiclecarservice interpreted stored IS NOT NULL as "in garage" and spawned a second entity for the same platestored = 'rde_parking' — a distinct value carservice explicitly excludes
"Not your vehicle" after deliveryclient's parkedCache[plate] stayed true after delivery, silently blocking re-parkrde_parking:clearParkedCache event resets the client cache

Park a vehicle → call carservice → it auto-unparks and delivers it to you. Pick it up via carservice → the parking entry is gone. Deliver it back → you can park it again.

05 / Reference

Developer API

FunctionSideNotes
LoadParkingIndex()ServerForce a full reload of the parking index
RunProximitySweep()ServerImmediate proximity sweep
GlobalState.rde_parking_activeAny{ [vehicleId] = { plate, coords, locked } }
GlobalState.rde_parking_spawned_countAnyCurrently spawned (nearby) vehicle count
06 / Reference

Security

Every park, lock, and unlock action verified server-side against the vehicles table
Per-player parking lock prevents concurrent park-spam
Lock/unlock cooldown enforced on both client and server
Single statebag sync path per state change — no parallel TriggerClientEvent for the same data
07 / More

Common Pitfalls

setStored despawn bug

oxVeh:setStored('parked', true) with despawn=true could silently delete the parked entity if ox_core happened to be tracking it.

Fix (v1.1.1): replaced with a direct MySQL.update writing stored = 'rde_parking' with no entity side effects.

Vehicle mods/paint not showing for other players

Props were only broadcast to whoever's client triggered the spawn.

Fix (v1.1.0): props now broadcast to all connected clients and write to the entity statebag.

Missing ownership check on lock sync

Any client could previously call the lock-sync event with an arbitrary plate/netId and lock or unlock any vehicle.

Fix (v1.1.0): every lock/unlock request is now verified server-side against vehicles.owner before anything happens.

08 / More

FAQ

Is rde_carservice required?

No — fully optional. Without it, parking works exactly the same, just without the auto-unpark-on-delivery bridge.

Does the schema change between versions?

No — unchanged since v1.0.0. Upgrading is always a direct drop-in, no migration step.

09 / More

Changelog

v1.1.1

Full bidirectional rde_carservice integration, setStored fix, client parkedCache clearing after delivery.

v1.1.0

Proximity loading overhaul, GlobalState register, statebag-based lock/props sync, ownership check fix.