Jump to content

como desativar sistema de gasolina em bikes?


Recommended Posts

factor = 0.5

function createVehicles(player)
	for i,v in ipairs(getElementsByType("vehicle")) do
		fuel = math.random(10,25)
		setElementData(v, "fuel", fuel)
	end
end

function processFuel(player)
	for i,v in ipairs(getElementsByType("vehicle")) do
		--if getVehicleNameFromModel(481) == false 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)

O sistema de combustível esta funcionando em bikes, isso não é bom, tentei detectar com um getVehicleNameFromModel mas não funcionou, alguma solução, para fazer o script ignorar bikes?

Link to comment
  • 7 months later...

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...