local health = nil local max_health = nil local blip_delay = nil local blip = nil function health_bar_init(e) end function health_bar_main(e) if max_health == nil then max_health = g_PlayerHealth blip = 25 blip_delay = GetTimer(e) + 1 health = g_PlayerHealth else --if g_PlayerHealth < health then local perc = (g_PlayerHealth / max_health ) * 100 placement = 50 - (perc / 4) for a = 1, perc do TextCenterOnXColor(placement,3,5,"I",255,0,0) TextCenterOnXColor(placement,7,5,"I",255,0,0) placement = placement + 0.5 end if g_PlayerHealth < health then blip = 50 - (perc / 4) health = g_PlayerHealth else if g_PlayerHealth > 0 then if GetTimer(e) > blip_delay then if blip < 50 + (perc / 4) - 1 then blip = blip + 0.5 else blip = 50 - (perc / 4) end blip_delay = GetTimer(e) + 1 end TextCenterOnXColor(blip,3,5,"I",255,255,0) TextCenterOnXColor(blip,7,5,"I",255,255,0) if blip > 50 - (perc / 4) then TextCenterOnXColor(blip-0.5,3,5,"I",255,255,0) TextCenterOnXColor(blip-0.5,7,5,"I",255,255,0) end end end --[[ if GetInKey() == "l" then HurtPlayer(e,1) end --]] end end function health_bar_exit(e) end