View Single Post
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 02-07-2009 , 08:14   Re: Team Icon Spr
Reply With Quote #8

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_teamid )==1) ? g_t_red_spr g_ct_red_spr ); 
PHP Code:
public reset_hud()
{
    new 
id;
    for(
id 1id <= 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 1id <= g_maxplayersid++) 
Why ? because is not called at every loop
__________________

anakin_cstrike is offline