diff --git a/bridge/qb/client/events.lua b/bridge/qb/client/events.lua index 0e2b9dc71..0118429f5 100644 --- a/bridge/qb/client/events.lua +++ b/bridge/qb/client/events.lua @@ -5,7 +5,8 @@ RegisterNetEvent('QBCore:Command:CallCommand', function(command) end) RegisterNetEvent('QBCore:Client:VehicleInfo', function(info) - local plate = GetPlate(info.vehicle) + local vehicle = NetworkGetEntityFromNetworkId(info.netId) + local plate = GetPlate(vehicle) local hasKeys = true if GetResourceState('qb-vehiclekeys') == 'started' then @@ -13,12 +14,12 @@ RegisterNetEvent('QBCore:Client:VehicleInfo', function(info) end local data = { - vehicle = info.vehicle, + vehicle = vehicle, seat = info.seat, name = info.modelName, plate = plate, - driver = GetPedInVehicleSeat(info.vehicle, -1), - inseat = GetPedInVehicleSeat(info.vehicle, info.seat), + driver = GetPedInVehicleSeat(vehicle, -1), + inseat = GetPedInVehicleSeat(vehicle, info.seat), haskeys = hasKeys } diff --git a/bridge/qb/server/events.lua b/bridge/qb/server/events.lua index 22d416ef8..d4d1e77b7 100644 --- a/bridge/qb/server/events.lua +++ b/bridge/qb/server/events.lua @@ -1,21 +1,23 @@ -- Vehicles -RegisterServerEvent('baseevents:enteringVehicle', function(veh,seat,modelName) +RegisterServerEvent('baseevents:enteringVehicle', function(veh, seat, modelName, netId) local src = source local data = { vehicle = veh, seat = seat, name = modelName, + netId = netId, event = 'Entering' } TriggerClientEvent('QBCore:Client:VehicleInfo', src, data) end) -RegisterServerEvent('baseevents:enteredVehicle', function(veh,seat,modelName) +RegisterServerEvent('baseevents:enteredVehicle', function(veh, seat, modelName, netId) local src = source local data = { vehicle = veh, seat = seat, name = modelName, + netId = netId, event = 'Entered' } TriggerClientEvent('QBCore:Client:VehicleInfo', src, data) @@ -26,12 +28,13 @@ RegisterServerEvent('baseevents:enteringAborted', function() TriggerClientEvent('QBCore:Client:AbortVehicleEntering', src) end) -RegisterServerEvent('baseevents:leftVehicle', function(veh,seat,modelName) +RegisterServerEvent('baseevents:leftVehicle', function(veh, seat, modelName, netId) local src = source local data = { vehicle = veh, seat = seat, name = modelName, + netId = netId, event = 'Left' } TriggerClientEvent('QBCore:Client:VehicleInfo', src, data)