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 maxvaluefound, leader = 0;
for(new i=1;i<=MaxClients;i++)
{
if(IsClientInGame(i) && GetClientTeam(i) == team)
{
int value = GetEntData(g_iPlayerManager, g_iScoreOffset + (i * 4), 4);
if(value > maxvaluefound)
{
leader = i;
maxvaluefound = value;
}
}
}
return leader;
}
GetPlayerTopOfScoreBoard(CS_TEAM_CT);
__________________