If you want the display part to be more dynamic (aka depend on the consts) then you should use a loop to make the HUD string.
I would do something like this:
PHP Code:
// Rangs
new const RANG[][64] = {
"Bandit",
"Cowgirl",
"Cowboy",
"Shireff"
};
// Kills needed
new const KILLS[sizeof(RANG)] = {
1,
5,
10,
15
}
new HUDstring[64]
public plugin_cfg()
{
new len = 0
len = formatex(HUDstring[len], charsmax(HUDstring) - len, "Levels:")
for(new i = 0; i < sizeof(RANG); i++)
{
len += formatex(HUDstring[len], charsmax(HUDstring) - len, "^nRang: %s (Kills: %d)", RANG[i], KILLS[i])
}
}
public Rangs(id)
{
if(get_pcvar_num(Western_status))
{
set_hudmessage(255, 0, 0, 0.01, -1.0)
show_hudmessage(id,HUDstring)
}
return PLUGIN_CONTINUE;
}
You had an extra (unused) %s at the begining of your HUD message so I don't know what you wanted there. Let me know because my example might need modified.
__________________