Raised This Month: $ Target: $400
 0% 

Show player rank while spectating


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
newb1e
Junior Member
Join Date: Feb 2016
Old 02-04-2016 , 18:18   Re: Show player rank while spectating
Reply With Quote #4

Quote:
Originally Posted by Croxeye View Post
Try this, not tested.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <csstats>
#include <fakemeta>

#define PLUGIN "Spec Rank"
#define VERSION "1.0"
#define AUTHOR "Croxeye"

new g_SpecInfo

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)

    
set_task(1.0"SpecInfo"___"b")

    
g_SpecInfo CreateHudSyncObj()
}

public 
SpecInfo()
{
    new 
players[32], num 
    get_players
(playersnum"ch")
    
    new 
idtargetszTargetName[32]
    
    
target pev(idpev_iuser2)
    
    
set_hudmessage(085255, -1.00.7506.01.0)
    
    for(new 
inumi++)
    {
        
id players[i]
        
        if(!
is_user_alive(id))
        {
            
            if(!
target)
                continue
                
            if(
is_user_alive(target))
            {
                return 
PLUGIN_HANDLED;
            }
            
            
get_user_name(targetszTargetNamecharsmax(szTargetName))
            new 
stats[8], body[8]
            new 
rank_pos get_user_stats(targetstatsbody)
            new 
rank_max get_statsnum()
            
            
ShowSyncHudMsg(idg_SpecInfo"Spectating: %s ® Rank: %d of %d"szTargetNamerank_posrank_max)
        }
    }
    return 
PLUGIN_HANDLED;

Or just change this:

PHP Code:
len format(buffercharsmax(buffer), "%L",LANG_PLAYER,"RANK"); 
to this:

PHP Code:
len format(buffercharsmax(buffer), "%L %d",LANG_PLAYER,"RANK"rank_pos); 
and you need to define rank_pos

PHP Code:
new stats[8], body[8]
new 
rank_pos get_user_stats(idstatsbody
not working mate
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 09:29.


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