Paste this at the bottom of your main.txtQuote'Auto-update Highscore'Coded by zack a.k.a Homicidal Monkey'version 1 based on /top5 by m4kSub HighScore(index)Dim acc(50) Dim Char(50) Dim Charlvl(50) I=1 j=1 C=0 Cnum = 0 Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index)) Do While C = 0 acc(I) = GetVar("accounts.ini", "Players", "Name" & I) If acc(I) <> "" Then j = 1 Do While j < 4 If GetVar("accounts\" & acc(I) & ".ini", "CHAR" & j, "Name") <> "" Then Cnum=Cnum+1 Char(Cnum) = GetVar("accounts\" & acc(I) & ".ini", "CHAR" & j, "Name") Charlvl(Cnum) = INT(GetVar("accounts\" & acc(I) & ".ini", "CHAR" & j, "Level")) End If j = j + 1 Loop I = I + 1 Else C=1 Max=(I - 1) End If Loop Ca=1 Cb=2 Do While Ca < Cnum Do While Cb <= Cnum If Charlvl(Ca) < Charlvl(Cb) Then templvla = Charlvl(Ca) templvlb = Charlvl(Cb) tempnamea = Char(Ca) tempnameb = Char(Cb) Charlvl(Ca) = templvlb Charlvl(Cb) = templvla Char(Ca) = tempnameb Char(Cb) = tempnamea End If Cb=(Cb + 1) Loop Ca=(Ca + 1) Cb=(Ca + 1) Loop Call battleMsg(index, "Top 5 Players by Level", 15, 0) Ca=1 Do While Ca <= 5 Call battleMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0) Ca=Ca+1 Loop Call GlobalMsg("Current Top Player: " & Char(1) & " at level " & charlvl(1), 15)End SubSub UpdateHS(Index)Dim acc(50) Dim Char(50) Dim Charlvl(50) z = 1Do While C = 0 If GetVar("accounts.ini", "Players", "Name" & z) <> "" then If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then C = 1 'Call PlayerMsg(index, "Acc Exists!", 15) End if z = z + 1 Else Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index)) 'Call PlayerMsg(index, "Acc Added!", 6) C = 1 End if Loop end sub ok we are almost done.Put this Code at the top of joingame, leftgame, levelupQuoteCall UpdateHS(Index) Call Highscore(Index)
'Auto-update Highscore'Coded by zack a.k.a Homicidal Monkey'version 1 based on /top5 by m4kSub HighScore(index)Dim acc(50) Dim Char(50) Dim Charlvl(50) I=1 j=1 C=0 Cnum = 0 Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index)) Do While C = 0 acc(I) = GetVar("accounts.ini", "Players", "Name" & I) If acc(I) <> "" Then j = 1 Do While j < 4 If GetVar("accounts\" & acc(I) & ".ini", "CHAR" & j, "Name") <> "" Then Cnum=Cnum+1 Char(Cnum) = GetVar("accounts\" & acc(I) & ".ini", "CHAR" & j, "Name") Charlvl(Cnum) = INT(GetVar("accounts\" & acc(I) & ".ini", "CHAR" & j, "Level")) End If j = j + 1 Loop I = I + 1 Else C=1 Max=(I - 1) End If Loop Ca=1 Cb=2 Do While Ca < Cnum Do While Cb <= Cnum If Charlvl(Ca) < Charlvl(Cb) Then templvla = Charlvl(Ca) templvlb = Charlvl(Cb) tempnamea = Char(Ca) tempnameb = Char(Cb) Charlvl(Ca) = templvlb Charlvl(Cb) = templvla Char(Ca) = tempnameb Char(Cb) = tempnamea End If Cb=(Cb + 1) Loop Ca=(Ca + 1) Cb=(Ca + 1) Loop Call battleMsg(index, "Top 5 Players by Level", 15, 0) Ca=1 Do While Ca <= 5 Call battleMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0) Ca=Ca+1 Loop Call GlobalMsg("Current Top Player: " & Char(1) & " at level " & charlvl(1), 15)End SubSub UpdateHS(Index)Dim acc(50) Dim Char(50) Dim Charlvl(50) z = 1Do While C = 0 If GetVar("accounts.ini", "Players", "Name" & z) <> "" then If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then C = 1 'Call PlayerMsg(index, "Acc Exists!", 15) End if z = z + 1 Else Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index)) 'Call PlayerMsg(index, "Acc Added!", 6) C = 1 End if Loop end sub
Call UpdateHS(Index) Call Highscore(Index)
How do you check the Hi-Scores?
Quote from: J-Master on December 25, 2006, 04:03:53 PMHow do you check the Hi-Scores?when logging in, someone else logs in, or just make a command under "/help" that calls sub highscore
Quote from: Homicidal Monkey Vers. 1.337 on January 04, 2007, 05:06:44 PMQuote from: J-Master on December 25, 2006, 04:03:53 PMHow do you check the Hi-Scores?when logging in, someone else logs in, or just make a command under "/help" that calls sub highscoreThe code works nicely, but just how do u make a command under /help that calls sub highscore?? could you help me?
Case "/Highscore"call Highscore(Index)Call UpdateHs(Index)exit sub
Great Script! I have a question though. If I want to exclude 3 admins from the high scores named:KainBloodbaneAlex FernandezLightningsunHow can I do that? I want them to be excluded so the other players can fairly get a high score without admins all taking the top spots.
Sub UpdateHS(Index)Dim acc(50)Dim Char(50)Dim Charlvl(50)z = 1Do While C = 0 If GetPlayerAccess(Index) < 2 then If GetVar("accounts.ini", "Players", "Name" & z) <> "" then If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then C = 1 'Call PlayerMsg(index, "Acc Exists!", 15) End if z = z + 1 Else Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index)) 'Call PlayerMsg(index, "Acc Added!", 6) C = 1 End ifEnd IfLoopend sub
Sub UpdateHS(Index)Dim acc(50)Dim Char(50)Dim Charlvl(50)z = 1Do While C = 0 If GetPlayerAccess(Index) < 2 then If GetVar("accounts.ini", "Players", "Name" & z) <> "" then If GetVar("accounts.ini", "Players", "Name" & z) = GetPlayerLogin(index) Then C = 1 'Call PlayerMsg(index, "Acc Exists!", 15) End if z = z + 1 Else Call PutVar("accounts.ini", "Players", "Name" & z, GetPlayerLogin(index)) 'Call PlayerMsg(index, "Acc Added!", 6) C = 1 End ifElseExit SubEnd IfLoopend sub