diff options
| author | Apickx <Apickx@cogarr.org> | 2015-12-28 19:18:30 -0500 |
|---|---|---|
| committer | Apickx <Apickx@cogarr.org> | 2015-12-28 19:18:30 -0500 |
| commit | 868e729d68b5913716bfe5ddb512f4099851e9a2 (patch) | |
| tree | 6441108754145dfd68a6e23bea382b5cb1ab63d5 /gamemode/cl_hud/draw_healthbox.lua | |
| download | gearfox-868e729d68b5913716bfe5ddb512f4099851e9a2.tar.gz gearfox-868e729d68b5913716bfe5ddb512f4099851e9a2.tar.bz2 gearfox-868e729d68b5913716bfe5ddb512f4099851e9a2.zip | |
Diffstat (limited to 'gamemode/cl_hud/draw_healthbox.lua')
| -rw-r--r-- | gamemode/cl_hud/draw_healthbox.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gamemode/cl_hud/draw_healthbox.lua b/gamemode/cl_hud/draw_healthbox.lua new file mode 100644 index 0000000..0801181 --- /dev/null +++ b/gamemode/cl_hud/draw_healthbox.lua @@ -0,0 +1,10 @@ +function DrawHealthbar() + local HP = LocalPlayer():Health() + local MP = 100 --player:GetMaxHealth() apparently doesn't work quite well on Clients... + local C = math.Clamp(HP/MP,0,1) + + DrawBoxy( 10, ScrH()-60, 200, 50, MAIN_COLOR ) + DrawRect( 20, ScrH()-50, 180, 30, MAIN_BLACKCOLOR ) + DrawRect( 20, ScrH()-50, 180*C, 30, MAIN_GREENCOLOR ) + DrawText( HP.."/"..MP, "Trebuchet24", 110, ScrH()-35, MAIN_TEXTCOLOR, 1 ) +end
\ No newline at end of file |
