Skip to content

10% off shop orders, applied at checkout

RPScripts

Perri-CarLock for ESX: Setup and Ownership Checks

By Luke

Illustration of a parked car with a glowing padlock, a key fob and an ownership card with flashing hazard lights

Perri-CarLock is perrituber’s ESX vehicle-lock resource. Its manifest loads es_extended imports, ox_lib and oxmysql. The server checks owned_vehicles for the player’s identifier and vehicle plate; this is not a universal key system for every framework or garage schema.

Creator repository and resource files

Install the inner resource folder

The repository contains a nested Perri-CarLock folder. Copy the inner folder with fxmanifest.lua into resources, start the required dependencies first and use ensure Perri-CarLock. Back up the resource and vehicle database before adapting its ownership query. Config.lua sets OpenKey to U and DisableLeave to true; verify both behaviors with your existing vehicle resources.

Check cached permissions and client errors

The inspected server remembers a successful ownership result by temporary player ID and plate. It does not clear that cache on disconnect or vehicle sale. Invalidate cached permission when identity or ownership changes, including reuse of a server player ID. A successful ownership check once must not grant permanent access after a transfer.

The client reads the closest vehicle’s lock status before checking that a vehicle was found, and its sound call uses x, y and z without defining those coordinates in the inspected file. Review those paths before public use. This guide does not include a patched resource or claim that every lock integration has been tested.

Test with two ordinary players: owned and unowned vehicles, no nearby vehicle, vehicle transfer, disconnect and reconnect. Confirm lock state and notifications on both clients, then repeat after a resource restart.

  • fxJobCenter for FiveM

    fxJobCenter for FiveM

    fxJobCenter is a free QBCore job center: players take regular jobs at an NPC or apply for whitelisted jobs, and the answers go to Discord webhooks. It needs qb-core, PolyZone, oxmysql and an fx_jobcenter table.