Try :
PHP Code:
#include <amxmodx>
new g_score[33]
public plugin_init()
{
register_plugin("RoundEnd Score" , "1.0" , "siriusmd99" )
register_logevent("Round_End_Score", 2, "1=Round_End")
register_event("DeathMsg", "sDeathMsg", "a")
}
public client_connect(id) {g_score[id] = 0;}
public client_disconnect(id) {g_score[id] = 0;}
public sDeathMsg()
{
new Killer = read_data(1);
new Victim = read_data(2);
if(Killer != Victim)
g_score[Killer]++
}
public Round_End_Score(){
new sName[32], sBuffer[1024]
new iLen
new score, temp
new bool:ismax
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "Top Players Score:^n")
while(!is_empty())
{
for(new i = 1; i < sizeof(g_score); i++)
{
score = g_score[i]
ismax = true
for(new j = 1; j < sizeof(g_score); j++)
{
temp = g_score[j]
if(score<temp)
{
ismax = false
break
}
}
if(ismax)
{
if(is_user_connected(i) && score > 0)
{
get_user_name(i, sName, 31)
iLen += formatex(sBuffer[iLen], charsmax(sBuffer) - iLen, "%s - %d^n", sName, score)
}
g_score[i]=0
}
}
}
set_hudmessage(255, 255, 255, 0.02, 0.24, 0, 6.0, 10.0, _, _, -1)
show_hudmessage(0, sBuffer)
}
bool:is_empty()
{
for(new n = 1; n < sizeof(g_score); n++)
if(g_score[n])
return false;
return true;
}
I didn't sort array , just displayed live the score of players.