Hali olyan kérdésem lenne ha elfogy az üzemanyag akkor ne birja be inditani ezt hogyan birnám megvalósitanI?
-- Üzemanyag Fogyasztás
setTimer(function()
if isPedInVehicle(localPlayer) then
if tonumber(getPedOccupiedVehicle(localPlayer):getData(\"veh:fuel\") or 0) > 0 then
if getPedOccupiedVehicle(localPlayer):getData(\"veh:motor\") then
local fogyaszt = 0
if getElementSpeed(getPedOccupiedVehicle(localPlayer), 1) > 0 then
fogyaszt = 1.1
else
fogyaszt = 0.6
end
getPedOccupiedVehicle(localPlayer):setData(\"veh:fuel\",getPedOccupiedVehicle(localPlayer):getData(\"veh:fuel\") - fogyaszt)
end
else
getPedOccupiedVehicle(localPlayer):setData(\"veh:fuel\",0)
triggerServerEvent(\"vehicleStart\",localPlayer,localPlayer,getPedOccupiedVehicle(localPlayer),false)
end
end
end,1000*60*2,0)
-- Üzemanyagtank Check
setTimer(function()
if isPedInVehicle(localPlayer) and getPedOccupiedVehicle(localPlayer) then
if getVehicleEngineState (getPedOccupiedVehicle(localPlayer)) then
if tonumber(getPedOccupiedVehicle(localPlayer):getData(\"veh:fuel\") or 0) > 0 then else
getPedOccupiedVehicle(localPlayer):setData(\"veh:fuel\",0)
triggerServerEvent(\"vehicleStart\",localPlayer,localPlayer,getPedOccupiedVehicle(localPlayer),false)
end
end
end
end,1000,0)