Raised This Month: $ Target: $400
 0% 

Show player rank while spectating


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
newb1e
Junior Member
Join Date: Feb 2016
Old 02-04-2016 , 14:25   Show player rank while spectating
Reply With Quote #1

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 1id <= MaxPlayersid++)
    {
        if(
is_user_alive(id) && is_user_connected(id))
        {
            if(
PlayerLevel[id] <= 18)
            {
                
needXP[id] = LEVELS[PlayerLevel[id]] - PlayerXP[id];
                
set_hudmessage(1001001000.010.1501.01.0__, -1)
                static 
buffer[192], len;
                
len format(buffercharsmax(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(idg_MsgHud"%s"buffer);
            } else {
                
set_hudmessage(1001001000.010.1301.01.0__, -1)
                static 
buffer[192], len;
                
len format(buffercharsmax(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(idg_MsgHud"%s"buffer);
            }
        }
        
// if i'm dead, hide my rank
        
return PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE


Last edited by newb1e; 02-04-2016 at 14:28.
newb1e is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode