Ratasauria Posted August 11, 2021 Share Posted August 11, 2021 (edited) lo que quiero hacer ES EN ESE CODIGO YA LISTO QE ANDE EL VEHICULO UN POCO MAS DESPACIO DE LO NORMAL desde ya gracias function Contador_Combustivel () for _, players in ipairs( getElementsByType 'player' ) do -- Verifica Todos jogadores Online local Motorista = getPedOccupiedVehicleSeat ( players ) if Motorista == 0 then for _, veh in ipairs ( Veiculos ) do local Veiculo = getPedOccupiedVehicle ( players ) local ID_Veh = getElementModel ( Veiculo ) if ID_Veh == veh then local Combustivel = getElementData ( Veiculo, "DNL:Combustivel" ) or 0 if getVehicleEngineState ( Veiculo ) and Combustivel > 0 then VelocidadeX, VelocidadeY, VelocidadeZ = getElementVelocity ( Veiculo ) VelocidadeAtual = ( VelocidadeX ^ 2 + VelocidadeY ^ 2 + VelocidadeZ ^ 2 ) ^ ( 0.5 ) KMH = math.floor ( VelocidadeAtual * 180 ) if KMH == 0 then Combustivel_Seg = 0 elseif KMH > 0 then Combustivel_Seg = 0.1 end Combustivel = Combustivel - Combustivel_Seg end if Combustivel <= 0.50 then // en esta parteee Combustivel = 0 setVehicleEngineState ( Veiculo, true ) // aca elñ codigo dice QUE SE PRENDA EL AUTO PERO COMO HAGO PARA QUE PRENDA PERO ANDE MAS DESPACIO ?? AYUDENME PORFAA end setElementData ( Veiculo, "DNL:Combustivel", Combustivel ) end end end end end setTimer ( Contador_Combustivel, 3000, 0 ) Edited August 11, 2021 by Ratasauria 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