Server
This page documents all server-side exports available in AK47 Vehicle Keys.
GiveKey
Gives a vehicle key (physical item) to a player on the server.
exports['ak47_vehiclekeys']:GiveKey(source, plate, temp, target)Parameters
source(number): The server ID (source) of the player giving/receiving the key.plate(string): The vehicle license plate.temp(boolean| optional): Whether the key is temporary.target(number| optional): If specified, the key is given directly to this target player server ID.
Example
local src = source
local plate = 'ABC 123'
-- Give key to player
exports['ak47_vehiclekeys']:GiveKey(src, plate)RemoveKey
Removes a vehicle key from a player's inventory on the server.
Parameters
source(number): The server ID (source) of the player.plate(string): The vehicle license plate.temp(boolean| optional): Whether the key being removed is temporary.
Example
HasKey
Checks whether a player on the server holds the key (physical or virtual) for a given vehicle plate.
Parameters
source(number): The server ID of the player.plate(string): The vehicle license plate to check.
Returns
boolean: Returnstrueif the player has the key,falseotherwise.
Example
GiveVirtualKey
Gives a virtual (keyless) key to a player on the server.
Parameters
source(number): The server ID of the player.plate(string): The vehicle license plate.
Example
RemoveVirtualKey
Removes a virtual key from a player on the server.
Parameters
source(number): The server ID of the player.plate(string): The vehicle license plate.
Example
TransferVirtualKey
Transfers ownership of a virtual key from one player to another.
Parameters
source(number): The server ID of the sending player.plate(string): The vehicle license plate.target(number): The server ID of the receiving player.
Example
Last updated