V1RU5 Posted April 5, 2020 Share Posted April 5, 2020 Quando eu inicio o mod "[-=Fuel=-]" junto com o servidor ou seja configurado na mtaserver.conf, fica flodando esse erro no console " [-=BVC=-]\[-=Script=-]\[-=Fuel=-]\server\main.Lua:16: attempt to compare string with number " factor = 0.03 function createVehicles(player) for i,v in ipairs(getElementsByType("vehicle")) do fuel = math.random(70,80) setElementData(v, "fuel", fuel) end end function processFuel(player) for i,v in ipairs(getElementsByType("vehicle")) do local fuel = getElementData(v, "fuel") or math.random(70,80) 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 createVehicles() setTimer(processFuel, 1000, 0) OBS: Só da esse bug se o mod for iniciado com o servidor, se for iniciado com o painel admin. obg pela atenção!! Link to comment
Santi Posted April 5, 2020 Share Posted April 5, 2020 Tente passar o fuel para tonumber(fuel) na linha 16 Link to comment
V1RU5 Posted April 6, 2020 Author Share Posted April 6, 2020 @Santi Funcionou, obrigadão!! 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