diff --git a/client/events.lua b/client/events.lua index 363d208fe..815359354 100644 --- a/client/events.lua +++ b/client/events.lua @@ -129,8 +129,7 @@ RegisterNetEvent('QBCore:Command:GoToMarker', function() end) -- Vehicle Commands - -RegisterNetEvent('qbx_core:client:vehicleSpawned', function(netId, props) +lib.callback.register('qbx_core:client:vehicleSpawned', function(netId, props) local veh = NetworkGetEntityFromNetworkId(netId) for i = -1, 0 do diff --git a/modules/lib.lua b/modules/lib.lua index 55ae5532e..b7efb13b9 100644 --- a/modules/lib.lua +++ b/modules/lib.lua @@ -170,7 +170,7 @@ if isServer then end, 5000) local netId = NetworkGetNetworkIdFromEntity(veh) - TriggerClientEvent('qbx_core:client:vehicleSpawned', owner, netId, props) + lib.callback.await('qbx_core:client:vehicleSpawned', owner, netId, props) return netId end else diff --git a/modules/utils.lua b/modules/utils.lua index 2f7edfeb3..d0f03928d 100644 --- a/modules/utils.lua +++ b/modules/utils.lua @@ -223,7 +223,7 @@ if isServer then end, 5000) local netId = NetworkGetNetworkIdFromEntity(veh) - TriggerClientEvent('qbx_core:client:vehicleSpawned', owner, netId, props) + lib.callback.await('qbx_core:client:vehicleSpawned', owner, netId, props) return netId end