Jump to content

ERRO flodando no console


Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...