Raised This Month: $51 Target: $400
 12% 

access to CSS scoreboard


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 01-29-2019 , 01:33   access to CSS scoreboard
Reply With Quote #1

Is there a way to get the current leader on each team for CS:S? This would be the players on the top line of the scoreboard for T and CT.

I can probably recreate this myself but, if it is already available, I won't have to.

Thanks in advance.
.......CG (O&S)
__________________
.......Chuck |TxA| Old and Slow [AARP]
Old and Slow is offline
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 01-29-2019 , 10:01   Re: access to CSS scoreboard
Reply With Quote #2

I threw this together really fast, not sure if it will work or not as I haven't tried compiling even. There may be a function for this already but if not this is how i would do it from scratch.

PHP Code:
new g_iScoreOffset;

public 
OnPluginStart()
{
    
g_iScoreOffset FindSendPropInfo("CCSPlayerResource""m_iScore");
}

int GetPlayerTopOfScoreBoard(int team)
{
    new 
maxvaluefoundleader 0;
    for(new 
i=1;i<=MaxClients;i++)
    {
        if(
IsClientInGame(i) && GetClientTeam(i) == team)
        {
            
int value GetEntData(g_iPlayerManagerg_iScoreOffset + (4), 4);
            if(
value maxvaluefound)
            {
                
leader i;
                
maxvaluefound value;
            }
        }
    }
    return 
leader;
}

GetPlayerTopOfScoreBoard(CS_TEAM_CT); 
__________________
I highly recommend joining the SourceMod Discord Server for real time support.
backwards is offline
Old and Slow
Senior Member
Join Date: May 2005
Location: Arlington, Texas
Old 01-29-2019 , 10:26   Re: access to CSS scoreboard
Reply With Quote #3

Thanks - I will give that a try.
__________________
.......Chuck |TxA| Old and Slow [AARP]
Old and Slow is offline
Reply



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 16:40.


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