hi. how can i add here a function that will show another player rank if you are spectating him?
PHP Code:
public Info() {
for(new id = 1; id <= MaxPlayers; id++)
{
if(is_user_alive(id) && is_user_connected(id))
{
if(PlayerLevel[id] <= 18)
{
needXP[id] = LEVELS[PlayerLevel[id]] - PlayerXP[id];
set_hudmessage(100, 100, 100, 0.01, 0.15, 0, 1.0, 1.0, _, _, -1)
static buffer[192], len;
len = format(buffer, charsmax(buffer), "%L",LANG_PLAYER,"RANK");
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");
ShowSyncHudMsg(id, g_MsgHud, "%s", buffer);
} else {
set_hudmessage(100, 100, 100, 0.01, 0.13, 0, 1.0, 1.0, _, _, -1)
static buffer[192], len;
len = format(buffer, charsmax(buffer), "%L",LANG_PLAYER,"RANK");
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, "%s", buffer);
}
}
// if i'm dead, hide my rank
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}