CoringaBVL Posted January 14, 2021 Share Posted January 14, 2021 (edited) Consegui fazer com que a bike não desça a Gasolina, agora preciso por outros veículos como faço para adicionar apenas alguns modelos de veiculo por ID para a gasolina nao funcionar. (Veiculos de Empregos no caso) factor = 0.03 function createVehicles(player) for i,v in ipairs(getElementsByType("vehicle")) do if getVehicleType (v) ~= "BMX" then fuel = math.random(10,25) setElementData(v, "fuel", fuel) end end end function processFuel(player) for i,v in ipairs(getElementsByType("vehicle")) do if getVehicleType (v) ~= "BMX" then local fuel = getElementData(v, "fuel") or math.random(10,25) if (getVehicleEngineState(v) and fuel > 0 ) then fuel = fuel - factor end if (fuel <= 0.99) then fuel = 0 setVehicleEngineState(v, false) end setElementData(v, "fuel", fuel) end end end createVehicles() setTimer(processFuel, 1000, 0) Edited January 15, 2021 by Lord Henry Script convertido de texto para Lua. Título grande demais colocado no corpo do texto. Link to comment
Administrators Tut Posted January 14, 2021 Administrators Share Posted January 14, 2021 (edited) Welcome to the forums @CoringaBVL! Thread has been moved to the Portuguese scripting section. Please do not use the Title field for entering your question. Keep it short and brief! Original title (edited out) Consegui fazer com que a bike não desça a Gasolina, agora preciso por outros veículos como faço para adicionar apenas alguns modelos de veiculo por ID para a gasolina nao funcionar. (Veiculos de Empregos no caso) Edited January 14, 2021 by Tut 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now