Maybe anyone has better ideas than this my attempt?
I tried to make a bar hud by percentage (when it's max limit is 2500).
PHP Code:
#include <amxmodx>
new const g_szBarStatus[][] =
{
" ", "| ", "|| ",
"||| ", "|||| ", "||||| ",
"|||||| ", "||||||| ", "|||||||| ",
"||||||||| ", "|||||||||| ", "||||||||||| ",
"|||||||||||| ", "||||||||||||| ", "|||||||||||||| ",
"||||||||||||||| ", "|||||||||||||||| ", "||||||||||||||||| ",
"|||||||||||||||||| ", "||||||||||||||||||| ", "||||||||||||||||||||"
};
new g_iBar[33];
public plugin_init()
register_clcmd("addbar", "Clcmd_AddBar");
public Task_HUD(id)
{
id -= TASKID_HUD;
set_hudmessage(255, 0, 0, -1.0, 0.8, 0, 0.1, 0.25, 0.01, 0.01, -1);
show_hudmessage(id, "Bar [%s]", g_szBarStatus[g_iBar[id] * 20 / 2500);
set_task(0.2, "Task_HUD", id + TASKID_HUD);
}
public Clcmd_AddBar(id)
{
g_iBar[id] += 100;
Task_HUD(id + TASKID_HUD);
}