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.
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.
Why this over other parking scripts
| Other Parking Scripts | rde_parking |
|---|---|
| Every parked car spawns at boot, forever | Proximity-streamed — spawns only near players |
| Client trusts its own plate/netId for locking | Server-side owner verification on every action |
| Vehicle mods only visible to whoever parked it | Statebag + broadcast sync to every nearby player |
| Silently conflicts with delivery scripts | Full rde_carservice integration, zero conflicts |
Quick Start
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.
Configuration
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
}
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:
| Bug | Root Cause | Fix |
|---|---|---|
| Duplicate entity / disappearing parked vehicle | carservice interpreted stored IS NOT NULL as "in garage" and spawned a second entity for the same plate | stored = 'rde_parking' — a distinct value carservice explicitly excludes |
| "Not your vehicle" after delivery | client's parkedCache[plate] stayed true after delivery, silently blocking re-park | rde_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.
Developer API
| Function | Side | Notes |
|---|---|---|
| LoadParkingIndex() | Server | Force a full reload of the parking index |
| RunProximitySweep() | Server | Immediate proximity sweep |
| GlobalState.rde_parking_active | Any | { [vehicleId] = { plate, coords, locked } } |
| GlobalState.rde_parking_spawned_count | Any | Currently spawned (nearby) vehicle count |
Security
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.
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.
Changelog
Full bidirectional rde_carservice integration, setStored fix, client parkedCache clearing after delivery.
Proximity loading overhaul, GlobalState register, statebag-based lock/props sync, ownership check fix.