Skip to content

Commit

Permalink
Remove vehicle keys depdency from core (#920)
Browse files Browse the repository at this point in the history
Co-authored-by: Zerio <54480523+Z3rio@users.noreply.github.com>
  • Loading branch information
S33G and Z3rio committed Jan 18, 2023
1 parent 9878aea commit e6f5bf5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,22 @@ end)

RegisterNetEvent('QBCore:Client:VehicleInfo', function(info)
local plate = QBCore.Functions.GetPlate(info.vehicle)
local hasKeys = true

if GetResourceState('qb-vehiclekeys') == 'started' then
hasKeys = exports['qb-vehiclekeys']:HasKeys()
end

local data = {
vehicle = info.vehicle,
seat = info.seat,
name = info.modelName,
plate = plate,
driver = GetPedInVehicleSeat(info.vehicle, -1),
inseat = GetPedInVehicleSeat(info.vehicle, info.seat),
haskeys = exports['qb-vehiclekeys']:HasKeys(plate)
haskeys = hasKeys
}

TriggerEvent('QBCore:Client:'..info.event..'Vehicle', data)
end)

Expand Down

0 comments on commit e6f5bf5

Please sign in to comment.