Raised This Month: $ Target: $400
 0% 

top 15 list from saved file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
scrtxxcaz
Senior Member
Join Date: Feb 2007
Location: a place u cant find
Old 06-07-2007 , 02:16   top 15 list from saved file
Reply With Quote #1

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++
 }
 
}
__________________
Please leave your name when giving me any karma

Counter Strike Freeze Tag
Status: Testing.... (bugs)

Revised Registration
Status: In Progress
scrtxxcaz is offline
Send a message via AIM to scrtxxcaz
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 10:30.


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