Server

Library
Updated 2 months ago · v1.3.7

lib.vehicle.addKeys

Give a player keys to a vehicle.

lua
lib.vehicle.addKeys(src, veh, plate)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
vehnumberyesVehicle entity handle
platestringyesVehicle plate string

lib.vehicle.removeKeys

Remove a player's keys for a vehicle.

lua
lib.vehicle.removeKeys(src, veh, plate)
ParameterTypeRequiredDescription
srcnumberyesPlayer source
vehnumberyesVehicle entity handle
platestringyesVehicle plate string

lib.vehicle.setFuel

Set a vehicle's fuel level.

lua
lib.vehicle.setFuel(veh, val, _type)
ParameterTypeRequiredDescription
vehnumberyesVehicle entity handle
valnumberyesFuel level
_typeanynoFuel type (resource-specific)

lib.vehicle.getFuel

Get a vehicle's current fuel level.

lua
local fuel = lib.vehicle.getFuel(veh)

lib.vehicle.getByPlate

Look up vehicle data from the framework by plate.

lua
local vehicleData = lib.vehicle.getByPlate(plate)
ParameterTypeRequiredDescription
platestringyesVehicle plate string

lib.vehicle.generatePlate

Generate a unique vehicle plate that doesn't already exist in the database.

lua
local plate = lib.vehicle.generatePlate(format)
ParameterTypeRequiredDescription
formatstringnoPlate format pattern (default: '........' — 8 random alphanumeric characters)

Uses string.random() under the hood. Recursively generates until a unique plate is found. Result is always uppercase.

Was this page helpful?
This page was last updated on 12 March 2026
DIRKSCRIPTS
All you need for your FiveM server.10% off your first order

Unsubscribe any time.

Copyright © 2026 DirkScripts. Not affiliated with or endorsed by Rockstar North or Take-Two Interactive.