Nice! i think this is working much better!
btw, are this a good way to hide my rank when i'm dead?
PHP Code:
public Info()
{
new iPlayers[ 32 ] , iNum , len , id;
static buffer[ 192 ];
get_players( iPlayers , iNum , "ch" );
for( new i = 0 ; i < iNum ; i++ )
{
id = iPlayers[ i ];
set_hudmessage(100, 100, 100, 0.01, 0.13, 0, 1.0, 1.0, _, _, -1)
len = format(buffer, charsmax(buffer), "%L",LANG_PLAYER,"RANK");
// this
if(is_user_alive(id))
{
if ( PlayerLevel[ id ] <= 18 )
{
needXP[ id ] = LEVELS[ PlayerLevel[ id ] ] - PlayerXP[ id ];
len += format(buffer[len], charsmax(buffer) - len, " %L",LANG_PLAYER,RANKS[PlayerLevel[id]]);
len += format(buffer[len], charsmax(buffer) - len, "^n%L %d",LANG_PLAYER,"PL_XP",PlayerXP[id]);
len += format(buffer[len], charsmax(buffer) - len, "^n%L",LANG_PLAYER,"NEXT_LVL");
len += format(buffer[len], charsmax(buffer) - len, " %d ",needXP[id]);
len += format(buffer[len], charsmax(buffer) - len, "%L",LANG_PLAYER,"FRAGS");
}
else
{
len += format(buffer[len], charsmax(buffer) - len, " %L",LANG_PLAYER,RANKS[PlayerLevel[id]]);
len += format(buffer[len], charsmax(buffer) - len, "^n%L",LANG_PLAYER,"PL_MAX");
}
ShowSyncHudMsg( id , g_MsgHud , buffer );
}
// here if user dead hide his rank
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
i just added if(is_user_alive(id)) and an return handled.
and would be nice if you help me creating a fuction that will show the rank of the player you spectact. that means if you die, your rank already will hide but will show another player rank when you spectate him. thanks by the way!!