Client
This page documents all client-side exports available in AK47 Vehicle Keys.
GiveKey
Gives a physical vehicle key to the local player for a specified license plate.
exports['ak47_vehiclekeys']:GiveKey(plate, temp)Parameters
plate(string): The vehicle license plate.temp(boolean| optional): Whether this key is temporary.
Example
local plate = 'ABC 123'
exports['ak47_vehiclekeys']:GiveKey(plate)RemoveKey
Removes the physical vehicle key from the local player for a specified license plate.
exports['ak47_vehiclekeys']:RemoveKey(plate, temp)Parameters
plate(string): The vehicle license plate.temp(boolean| optional): Whether the key being removed is temporary.
Example
HasKey
Checks if the local player has a key (physical or virtual) for a specific vehicle plate.
Parameters
plate(string): The vehicle license plate to check.
Returns
boolean: Returnstrueif the local player has access/keys to the vehicle,falseotherwise.
Example
GiveVirtualKey
Grants a virtual (keyless) key for the given plate to the local player.
Parameters
plate(string): The vehicle license plate.
Example
RemoveVirtualKey
Removes a virtual key from the local player for the given plate.
Parameters
plate(string): The vehicle license plate.
Example
ToggleLock
Toggles the lock state of a specific vehicle entity (or the closest vehicle if no entity is passed).
Parameters
vehicle(number| optional): Vehicle entity handle. Ifnilor omitted, checks the closest vehicle in range.
Returns
boolean: Returnstrueif the action was processed,falseotherwise.
Example
LockVehicle
Locks a specified vehicle entity. Closes doors, plays light flash & sound, sets network sync state, and turns off engine if Config.EngineOffWithLockVehicle is enabled.
Parameters
vehicle(number): Vehicle entity handle.
Returns
boolean: Returnstrueif vehicle was locked successfully,falseif already locked or invalid.
Example
UnlockVehicle
Unlocks a specified vehicle entity. Plays light flash and sound, sets network sync state, and displays notification.
Parameters
vehicle(number): Vehicle entity handle.
Returns
boolean: Returnstrueif vehicle was unlocked successfully,falseif already unlocked or invalid.
Example
Last updated