ive tried many times to do this and researched alot and could not find any answers. Maybe some one can help me. My question is.... is there any way to read from a file and then print that info out as a top15 list? For example some of my code below that i was playin around with:
Code:
public show_top15awp(sBuffer[MAX_BUFFER_LENGTH + 1]) {
new iLen = 0
new pos
new nick[32],sid[32],kl[32],dd[32],hh[32],ht[32],awpsomin[32]
new filepointer = fopen(awpfile,"r")
if(filepointer)
{
new readdata[128]
while(fgets(filepointer,readdata,127))
{
parse(readdata,nick,32,sid,32,kl,31,dd,31,hh,31,ht,31)
{
awpsomin[pos] = str_to_num(kl)
}
pos++
}
}
new rank = pos + 1,stats[32]
new j = 0,h = 0
while( h <= pos)
{
while (j <= pos)
{
if (awpsomin[h] >= awpsomin[j])
{
rank--
}
j++
stats[h] = rank
}
h++
}
new HUD[212]
new g = 1
while(g <= pos)
{
format(HUD,211,"%s %d %d %d",nick[g],kl[g],dd[g],stats[g])
new num,players[32]
get_players(players,num)
iLen = format(sBuffer, MAX_BUFFER_LENGTH, "<body bgcolor=#000000><font color=#FFB000><pre>")
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2s %-22.22s %6s %6s^n", "#", "Nick", "Kills","Deaths")
for(new r = 0;r <= num;r++)
{
iLen += format(sBuffer[iLen], MAX_BUFFER_LENGTH - iLen, "%2d %-22.22s %6d %6d^n",stats[g],nick[g],kl[g],dd[g])
}
g++
}
}
__________________