Givekeys

Gives the player keys to a specific vehicle.

Syntax:

Bridge.VehicleKey.GiveKeys(vehicle, plate)

Parameters:

  • vehicle (number) - Vehicle entity handle

  • plate (string) - License plate of the vehicle

Example:

local Bridge = exports['community_bridge']:Bridge()
-- Get vehicle
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
if vehicle ~= 0 then
    local plate = GetVehicleNumberPlateText(vehicle)
    Bridge.VehicleKey.GiveKeys(vehicle, plate)
    print("Given keys to vehicle: " .. plate)
end

Last updated