For the complete documentation index, see llms.txt. This page is also available as Markdown.

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: Returns true if the local player has access/keys to the vehicle, false otherwise.

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. If nil or omitted, checks the closest vehicle in range.

Returns

  • boolean: Returns true if the action was processed, false otherwise.

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: Returns true if vehicle was locked successfully, false if 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: Returns true if vehicle was unlocked successfully, false if already unlocked or invalid.

Example

Last updated