πŸ“–
Documentation
  • Welcome!
  • Common Issues
    • Keymaster
    • Updating resources
  • πŸ“„Scripts
    • πŸš™AdvancedParking
      • Installation
      • Commands
      • Exports (server)
      • Exports (client)
      • Events (server)
      • Events (client)
      • FAQ
    • 🚚VehicleTransport
      • Installation
      • How to use it
      • Creating a new transport
      • Exports (client)
      • Events (server & client)
    • πŸ”‘VehicleKeyChain
      • Installation
      • Commands
      • Exports (server)
      • Exports (client)
      • FAQ
    • πŸ—œοΈVehicleClamp - Pre-Release
      • Installation
      • Commands
      • Exports (server)
      • Exports (client)
      • Integration
        • ESX
        • QB
    • πŸ“„VehicleRegistration
      • Installation
      • Exports (server)
      • Exports (client)
    • πŸ“ƒVehicleInteraction
      • Installation
    • πŸ—ΊοΈVehicleTracker
      • Installation
      • Exports (server)
      • Exports (client)
    • 🌐JobTracker
      • Installation
    • πŸ•΅οΈβ€β™‚οΈVehicleForceFirstPerson
      • Installation
    • 🎯BulletRicochet
      • Installation
  • πŸ†“Free Scripts
    • πŸ“žkimi_callbacks
      • Installation
      • Exports (server)
      • Exports (client)
      • Examples
    • 🚜VehicleDeformation
      • Installation
      • Exports (server)
      • Exports (client)
    • 🎦OrbitCam
      • Installation
      • Exports (client)
      • Commands
    • πŸ”οΈEarthquakeSimulator
      • Installation
      • Exports (server)
      • Commands
    • πŸ’€DeathCam
      • Installation
Powered by GitBook
On this page
  • OpenInventory
  • GetPlayerKeys
  • GetPlayerVehicles
  • GetPlayerVehiclesAndKeys
  • GetPlayerVehiclesAndKeyCount
  • GetPlayerTempKeys
  • IsVehicleOwner
  • IsKeyOwner
  • IsVehicleOrKeyOwner
  • ToggleLock
  1. Scripts
  2. VehicleKeyChain

Exports (client)

OpenInventory

Opens the key inventory for the player. If the menu is open, it will be closed instead.

exports["VehicleKeyChain"]:OpenInventory()


GetPlayerKeys

Returns a list containing all player keys.

Returns: table<table<plate: string, count: int, model: int>> - List of keys with their plate, count and associated model.

local keys = exports["VehicleKeyChain"]:GetPlayerKeys()
for i = 1, #keys do
	print("Plate:", keys[i].plate)
	print("Count:", keys[i].count)
	print("ModelHash:", keys[i].model)
	print("")
end


GetPlayerVehicles

Returns a list of all vehicles a player owns.

Returns: table<table<string, int>> - List of vehicles with their plate and model hash.

local vehicleList = exports["VehicleKeyChain"]:GetPlayerVehicles()
for i = 1, #vehicleList do
	print("Plate:", vehicleList[i][1])
	print("ModelHash:", vehicleList[i][2])
	print("")
end


GetPlayerVehiclesAndKeys

Returns a list of all vehicles a player owns.

Returns: table<table<string, int>> - List of vehicles with their plate and model hash. table<table<string, int, int>> - List of keys with their plate, count and associated model.

local vehicleList, keys = exports["VehicleKeyChain"]:GetPlayerVehicles()
for i = 1, #vehicleList do
	print("Plate:", vehicleList[i][1])
	print("ModelHash:", vehicleList[i][2])
	print("")
end
for i = 1, #keys do
	print("Plate:", keys[i][1])
	print("ModelHash:", keys[i][2])
	print("Count:", keys[i][3])
	print("")
end


GetPlayerVehiclesAndKeyCount

Returns a list of all vehicles a player owns including the amount of keys.

Returns: table<table<string, int, int>> - List of vehicles with their plate, model hash and key count.

local vehicleList = exports["VehicleKeyChain"]:GetPlayerVehiclesAndKeyCount()
for i = 1, #vehicleList do
	print("Plate:", vehicleList[i][1])
	print("ModelHash:", vehicleList[i][2])
	print("Key count:", vehicleList[i][3])
	print("")
end


GetPlayerTempKeys

Returns a list of all temporary keys a player owns.

Returns: dictionary<string, int> - Plates associated with a model (or -1 if no model).

local tempKeys = exports["VehicleKeyChain"]:GetPlayerTempKeys()
for plate, model in pairs(tempKeys) do
	print("Plate:", plate)
	print("Model:", model)
	print("")
end


IsVehicleOwner

Check if a player is the owner of a vehicle.

Parameters: vehicle - int - A vehicle handle.

Returns: bool - True if player is owner.

local isVehicleOwner = exports["VehicleKeyChain"]:IsVehicleOwner(vehicle)


IsKeyOwner

Check if a player is the owner of a key for a vehicle.

Parameters: vehicle - int - A vehicle handle.

Returns: bool - True if player is key owner.

local isKeyOwner = exports["VehicleKeyChain"]:IsKeyOwner(vehicle)


IsVehicleOrKeyOwner

Check if a player is the owner of a vehicle or a key for the vehicle.

Parameters: vehicle - int - A vehicle handle.

Returns: bool - True if player is owner.

local isOwner = exports["VehicleKeyChain"]:IsVehicleOrKeyOwner(vehicle)


ToggleLock

Toggles the lock of the closest and owned vehicle.

exports["VehicleKeyChain"]:ToggleLock()
PreviousExports (server)NextFAQ

Last updated 9 months ago

πŸ“„
πŸ”‘