PHP Code:
switch(get_user_team(id))
{
case 1:
{
write_short(g_t_red_spr);
}
case 2:
{
write_short(g_ct_blue_spr);
}
}
->
PHP Code:
write_short( ( get_user_team( id )==1) ? g_t_red_spr : g_ct_red_spr );
PHP Code:
public reset_hud()
{
new id;
for(id = 1; id <= get_maxplayers(); id++)
Cache the value in plugin_init, like this:
PHP Code:
new g_maxplayers;
// ..
public plugin_init() g_maxplayers = get_maxplayers();
// and use like this
for(new id = 1; id <= g_maxplayers; id++)
Why ? because is not called at every loop
__________________