Implemented store vehicle, CurrentAction living its own life

This commit is contained in:
ElPumpo
2018-08-04 21:08:36 +02:00
parent 5d4603db4f
commit 78413c2f7b
4 changed files with 33 additions and 14 deletions
+8 -1
View File
@@ -186,6 +186,13 @@ end
function StoreBoatInGarage(vehicle)
local vehicleProps = ESX.Game.GetVehicleProperties(vehicle)
ESX.TriggerServerCallback('esx_boat:storeVehicle', function (rowsChanged)
ESX.Game.DeleteVehicle(vehicle)
ESX.ShowNotification(_U('garage_stored'))
end, vehicleProps.plate)
end
@@ -219,4 +226,4 @@ function getVehicleModelFromHash(hash)
end
return 'Unknown hash [' .. hash .. ']'
end
end
+3 -3
View File
@@ -22,6 +22,9 @@ Citizen.CreateThread(function()
OpenBoatGarage(Config.Zones.Garages[CurrentActionData.zoneNum])
elseif CrurentAction == 'garage_in' then
StoreBoatInGarage(CurrentActionData.vehicle)
else
print('unknown') -- what's going on?!?!
end
CurrentAction = nil
@@ -34,9 +37,6 @@ Citizen.CreateThread(function()
end)
AddEventHandler('esx_boat:hasEnteredMarker', function(zone, zoneNum)
print(zone)
print(zoneNum)
if zone == 'boat_shop' then
CurrentAction = 'boat_shop'
CurrentActionMsg = _U('boat_shop_open')