From 63d53288040ece10f6565064b708940e4bcf9c72 Mon Sep 17 00:00:00 2001 From: AnishBplayz <91739770+AnishBplayz@users.noreply.github.com> Date: Sun, 29 Jan 2023 00:26:04 +0530 Subject: [PATCH] garage improvements / vehicle state fix --- client/garage.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/garage.lua b/client/garage.lua index 44c2b77..3add4a3 100644 --- a/client/garage.lua +++ b/client/garage.lua @@ -26,7 +26,12 @@ end) RegisterNUICallback('gps-vehicle-garage', function(data, cb) local veh = data.veh - if findVehFromPlateAndLocate(veh.plate) then + if veh.state == 'In' then + if veh.parkingspot then + SetNewWaypoint(veh.parkingspot.x, veh.parkingspot.y) + QBCore.Functions.Notify("Your vehicle has been marked", "success") + end + elseif veh.state == 'Out' and findVehFromPlateAndLocate(veh.plate) then QBCore.Functions.Notify("Your vehicle has been marked", "success") else QBCore.Functions.Notify("This vehicle cannot be located", "error") @@ -54,4 +59,4 @@ RegisterNetEvent('qb-phone:client:updateGarages', function() SendNUIMessage({ action = "UpdateGarages", }) -end) \ No newline at end of file +end)