function FuelRespawn()
for k,v in ipairs(getElementsByType(\"vehicle\"))do
if getElementData(v,\"fuel\") == false then
setElementData(v,\"fuel\",MaxFuel)
end
end
end
addEventHandler(\"onClientRender\", root, FuelRespawn)
function FuelDecreasing()
for f,v in ipairs(getElementsByType(\"vehicle\"))do
local fuel = getElementData(v,\"fuel\")
if getVehicleEngineState(v) == true and (not getElementData(v,\"fuel\") == false) then
setElementData(v,\"fuel\",fuel - ElementSpeed(v,\"kph\")*0.00004 - Decreasing)
end
end
end
addEventHandler(\"onClientRender\", root, FuelDecreasing)
function setVehicleFuelToZero()
veh = getPedOccupiedVehicle(localPlayer)
if veh and (not getElementData(veh,\"fuel\") == false ) and getElementData(veh,\"fuel\") <= 0 then
setElementData(veh,\"fuel\",0)
setElementData(veh,\"run.of.fuel\",true)
setVehicleEngineState(veh,false)
end
end
addEventHandler(\"onClientRender\",root,setVehicleFuelToZero)
function setPriceTo0()
if getElementData(localPlayer,\"price\") == false then
setElementData(localPlayer,\"price\",0)
end
end
addEventHandler(\"onClientRender\",root,setPriceTo0)
Ezek mik? Úristen.