Skip to content

Commit

Permalink
Fix issue #113
Browse files Browse the repository at this point in the history
  • Loading branch information
hoangducvn committed Apr 12, 2022
1 parent 383e970 commit 5552be2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ end)

RegisterNetEvent('MojiaGarages:client:updateVehicleKey', function(plate) -- Update vehicle key for qb-vehiclekey
QBCore.Functions.TriggerCallback('MojiaGarages:server:getVehicleData', function(owner)
if owner ~= nil then
if owner then
TriggerServerEvent('MojiaGarages:server:updateOutsiteVehicleKeys', plate, owner.citizenid)
end
end, plate)
Expand Down Expand Up @@ -1583,11 +1583,6 @@ CreateThread(function() -- Check if the player is in the garage area or not
end
end)






local function GetNearOusiteVehicle()
local near = nil
local distance = 10000
Expand Down Expand Up @@ -1632,8 +1627,9 @@ function SpawnVehicles(vehdata)
SetVehicleModifications(veh, vehdata.mods)
SetEntityRotation(veh, vehdata.rotation)
exports['LegacyFuel']:SetFuel(veh, vehdata.mods.fuelLevel)
local plate = QBCore.Functions.GetPlate(veh)
if not UsingMojiaVehiclekeys then
TriggerServerEvent('MojiaGarages:server:updateVehicleKey')
TriggerServerEvent('MojiaGarages:server:updateVehicleKey', plate)
end
end, vehdata.position, true)
end
Expand Down
6 changes: 3 additions & 3 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ QBCore.Functions.CreateCallback('MojiaGarages:server:getVehicleData', function(s
{
plate
}, function(result)
if result then
cb(result)
if result[1] then
cb(result[1])
else
cb(false)
end
Expand Down Expand Up @@ -698,6 +698,6 @@ RegisterNetEvent('MojiaGarages:server:refreshVehicles', function()
RefreshVehicles()
end)

RegisterNetEvent('MojiaGarages:server:updateVehicleKey', function()
RegisterNetEvent('MojiaGarages:server:updateVehicleKey', function(plate)
TriggerClientEvent('MojiaGarages:client:updateVehicleKey', -1, plate) -- Update vehicle key for qb-vehiclekey
end)

0 comments on commit 5552be2

Please sign in to comment.