I am trying to configure my Carhud to look like DOJ’s system, everything looks and works well. When my vehicle is damaged I made it so my “ENG” turns red but and now I am trying to figure out how to make it so if I turn off my engine, the “ENG” will also turn red but will return green if the engine is turned back on. Im very new to lua and I am trying to start small so that probably means I am doing this completely wrong
if (VehEngineHP > 0) and (VehEngineHP < 300) then
drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "Fluid", 255, 255, 255, 200)
drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "Oil", 255, 255, 255, 200)
drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "AC", 255, 255, 255, 200)
drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~g~ENG", 255, 255, 255, 200)
elseif VehEngineHP < 1 then
drawRct(UI.x + 0.159, UI.y + 0.809, 0.005, 0,0,0,0,100) -- panel damage
drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "Fluid", 255, 255, 255, 200)
drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "Oil", 255, 255, 255, 200)
drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "AC", 255, 255, 255, 200)
drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~r~ENG", 255, 255, 255, 200)
else
drawTxt(UI.x + 0.619, UI.y + 1.266, 1.0,1.0,0.45, "Fluid", 255, 255, 255, 150)
drawTxt(UI.x + 0.514, UI.y + 1.266, 1.0,1.0,0.45, "Oil", 255, 255, 255, 150)
drawTxt(UI.x + 0.645, UI.y + 1.266, 1.0,1.0,0.45, "AC", 255, 255, 255, 150)
drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~g~ENG", 255, 255, 255, 200)
end
if ifVehicleEngineOn then
drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~g~ENG", 255, 255, 255, 200)
else
drawTxt(UI.x + 0.620, UI.y + 1.240, 1.0,1.0,0.45, "~r~ENG", 255, 255, 255, 200)
end