Eclipse - Free 2D Mmorpg Maker
September 02, 2010, 10:18:52 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Shop Arcade chat Login Register  
 
 
   
 
collapse

* No Spam Or Websites

Refresh History
  • Ertzel: So... Anyone with basic/none/limited photoshop or even paint skills want to make some money converting sprites for me?
    Today at 10:07:35 PM
  • Gamma™: weaver why are you oflfine on H&H? :S
    Today at 10:04:26 PM
  • Ertzel: Ya, only one try per knife, my one try failed :(
    Today at 10:00:17 PM
  • LegendWeaver: is it one use?
    Today at 09:43:15 PM
  • Ertzel: Wish I didnt spend my 1k+ credits to buy the stupid knife that failed at stealing Robins credits >.<
    Today at 09:42:42 PM
  • Wraith: ) Kreator!
    Today at 09:06:52 PM
  • Wraith: yes! you were! (in red text
    Today at 09:06:46 PM
  • ToshiroHayate: Kreator!
    Today at 08:25:02 PM
  • Kreator: o_0 Was I supposed to Wraith?
    Today at 08:16:02 PM
  • [Pie] ICT: Don't worry.. I commented.
    Today at 07:55:08 PM
  • Wraith: Ay, kreator, wtf is up with you not posting anything about my new cliffs??
    Today at 07:50:36 PM

* Recent Topics

[EO] Attaching Problem. by Ertzel
[Today at 10:11:57 PM]


Project Vertigo [2d Tile-based Side-Scrolling Engine] by Miguu
[Today at 10:03:22 PM]


Zacaras Empire (Hiring) by Ertzel
[Today at 08:43:54 PM]


custom cliff tiles by ToshiroHayate
[Today at 08:29:15 PM]


.: RPG Kingdom :. by LegendWeaver
[Today at 08:25:20 PM]


What do you think? by [Pie] ICT
[Today at 07:54:54 PM]


[Show Off] Aztec Stuff by [Pie] ICT
[Today at 07:50:07 PM]


So I herd you liek mudkipz by Kreator
[Today at 07:36:52 PM]


Haven and Hearth: Epic Screenshot Thread by Tompwnage™
[Today at 07:14:21 PM]


The Lonliest Star [RP] by DDunit
[Today at 07:09:46 PM]


* Who's Online


Site Author : Topic: auto updating high score Script  (Read 2620 times)
0 Members and 1 Guest are viewing this topic.
February 25, 2006, 09:41:50 PM
zack
Guest
this is based on M4k's origional high score  script :p
Quote

Sub JoinGame(index)
Dim GameName
Dim MOTD
'put these lines under the last DIM array
Dim acc(50)
Dim Char(50)
Dim Charlvl(50)

Do 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

then u skip down a few lines and put this under
Quote
If Trim(MOTD) <> "" Then
        Call PlayerMsg(index, "MOTD: " & MOTD, 11)
    End If
'put the next line under the END If
I=1
j=1
d=0
Cnum = 0
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))
Do While d = 0
acc(I) = GetVar("accounts.ini", "Players", "Name" & I)
If acc(I) <> "" Then
'Call PlayerMsg(index, acc(I), 1)
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
d=1
Max=(I - 1)
End If
Loop
Ca=1
Cb=2
Do While Ca < Cnum
Do While Cb <= Cnum
'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
If Charlvl(Ca) < Charlvl(Cb) Then
'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
templvla = Charlvl(Ca)
templvlb = Charlvl(Cb)
tempnamea = Char(Ca)
tempnameb = Char(Cb)
Charlvl(Ca) = templvlb
Charlvl(Cb) = templvla
Char(Ca) = tempnameb
Char(Cb) = tempnamea
'Call PlayerMsg(index, "Switching", 1)
End If
Cb=(Cb + 1)
Loop
Ca=(Ca + 1)
Cb=(Ca + 1)
'Call PlayerMsg (index, Ca & Cb, 1)
Loop
Call globalmsg(index, "Top 5 Players by Level", 15, 0)
Ca=1
Do While Ca <= 5
Call globalmsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0)
Ca=Ca+1
Loop
End Sub

notice that I changed battlemsg to globalmsg and that the C variable was changed to D in the second half. this way if som1 logs in right after someone levels up, the list is updated and sent to everyone.

for all u lazy bums out there, I got this simple cut & paste version below.
simply paste over the whole "Sub Join Game"
Quote
Sub JoinGame(index)
Dim GameName
Dim MOTD
Dim acc(50)
Dim Char(50)
Dim Charlvl(50)

Do 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

GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))
MOTD = GetVar("motd.ini", "MOTD", "Msg")

    ' Send a global message that he/she joined
    If GetPlayerAccess(index) <= ADMIN_MONITER Then
        Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 7)
    Else
        Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 15)
    End If

    ' Send them welcome
    Call PlayerMsg(index, "Welcome to " & GameName & "!", 15)
   
    ' Send motd
    If Trim(MOTD) <> "" Then
        Call PlayerMsg(index, "MOTD: " & MOTD, 11)
    End If
I=1
j=1
d=0
Cnum = 0
Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini " , "CHAR" & GetPlayerCharNum(Index) , "Level" , GetPlayerLevel(Index))
Do While d = 0
acc(I) = GetVar("accounts.ini", "Players", "Name" & I)
If acc(I) <> "" Then
'Call PlayerMsg(index, acc(I), 1)
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
d=1
Max=(I - 1)
End If
Loop
Ca=1
Cb=2
Do While Ca < Cnum
Do While Cb <= Cnum
'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
If Charlvl(Ca) < Charlvl(Cb) Then
'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
templvla = Charlvl(Ca)
templvlb = Charlvl(Cb)
tempnamea = Char(Ca)
tempnameb = Char(Cb)
Charlvl(Ca) = templvlb
Charlvl(Cb) = templvla
Char(Ca) = tempnameb
Char(Cb) = tempnamea
'Call PlayerMsg(index, "Switching", 1)
End If
Cb=(Cb + 1)
Loop
Ca=(Ca + 1)
Cb=(Ca + 1)
'Call PlayerMsg (index, Ca & Cb, 1)
Loop
Call globalMsg(index, "Top 5 Players by Level", 15, 0)
Ca=1
Do While Ca <= 5
Call globalMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12, 0)
Ca=Ca+1
Loop
End Sub

thank u m4k for making the origional script  :D
Enjoy
Logged
February 26, 2006, 06:58:15 AM
Active Member
***
User No : 177
Posts: 340
  • 0 credits
  • View Inventory
  • Send Money To Diaga
  • Location : East Coast (but west coast in heart)
    • View Profile
    if this works this is definitly one I'm grabbin :) thanks
    Logged

    Live by the sword, die by the sword, and have the courage to fear neither.
    February 26, 2006, 08:42:41 AM
    zack
    Guest
    there was some bug with the origional. All things in red you have to add. THis script will only work if auto-updatind high score script version  1 did not work and is not in your main script. I recommend that you use this one instead.
    Put this at the TOP of JoinGame SUb

    [quote]Do 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[/quote]


    add this to the bottom
    Quote

    '**************************
    '*AutoUpdatingHighScoreScript*
    '*******Version1.2**********
    '*************************
    Sub 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
    'Call PlayerMsg(index, acc(I), 1)
    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
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    If Charlvl(Ca) < Charlvl(Cb) Then
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    templvla = Charlvl(Ca)
    templvlb = Charlvl(Cb)
    tempnamea = Char(Ca)
    tempnameb = Char(Cb)
    Charlvl(Ca) = templvlb
    Charlvl(Cb) = templvla
    Char(Ca) = tempnameb
    Char(Cb) = tempnamea
    'Call PlayerMsg(index, "Switching", 1)
    End If
    Cb=(Cb + 1)
    Loop
    Ca=(Ca + 1)
    Cb=(Ca + 1)
    'Call PlayerMsg (index, Ca & Cb, 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
    End Sub

    Sub UpdateScore(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
    'Call PlayerMsg(index, acc(I), 1)
    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
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    If Charlvl(Ca) < Charlvl(Cb) Then
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    templvla = Charlvl(Ca)
    templvlb = Charlvl(Cb)
    tempnamea = Char(Ca)
    tempnameb = Char(Cb)
    Charlvl(Ca) = templvlb
    Charlvl(Cb) = templvla
    Char(Ca) = tempnameb
    Char(Cb) = tempnamea
    'Call PlayerMsg(index, "Switching", 1)
    End If
    Cb=(Cb + 1)
    Loop
    Ca=(Ca + 1)
    Cb=(Ca + 1)
    'Call PlayerMsg (index, Ca & Cb, 1)
    Loop
    Call globalMsg(index, "Top 5 Players by Level", 15)
    Ca=1
    Do While Ca <= 5
    Call globalMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12)
    Ca=Ca+1
    Loop
    End Sub
    '*********
    '*endcode*
    '*********

    then put this quote in Command SUb and JoinGame SUb
    Quote
    Call HighScore(Index)

    and this script to LevelUp Sub
    Quote
    Call UpdateScore(index)

    for you ppl that are having problems, this is what ur main script should look like if you ONLY want this script.
    Quote
    ':: Access ::
    'ADMIN_MONITER = 1
    'ADMIN_MAPPER = 2
    'ADMIN_DEVELOPER = 3
    'ADMIN_CREATOR = 4

    ':: Text Color Code ::
    'Black = 0
    'Blue = 1
    'Green = 2
    'Cyan = 3
    'Red = 4
    'Magenta = 5
    'Brown = 6
    'Grey = 7
    'DarkGrey = 8
    'BrightBlue = 9
    'BrightGreen = 10
    'BrightCyan = 11
    'BrightRed = 12
    'Pink = 13
    'Yellow = 14
    'White = 15

    Sub JoinGame(index)
    Dim GameName
    Dim MOTD
    Dim acc(50)
    Dim Char(50)
    Dim Charlvl(50)

    Do 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

    'You still need this.
    GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))
    MOTD = GetVar("motd.ini", "MOTD", "Msg")

    ' Send a global message that he/she joined
    If GetPlayerAccess(index) <= ADMIN_MONITER Then
    call HighScore(index)
    'see here I removed the announcement and replaced it with High Scores.
    Else
    Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 15)
    End If

    ' Send them welcome
    Call PlayerMsg(index, "Welcome to " & GameName & "!", 15)
    ' Send motd
    If Trim(MOTD) <> "" Then
    Call PlayerMsg(index, "MOTD: " & MOTD, 11)
    End If
    End Sub

    Sub LeftGame(index)
    Dim GameName
    Dim n

    GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))

        ' Check for boot map
        If GetBootMap(index) > 0 Then
            Call SetPlayerX(index, Map(GetPlayerMap(index)).BootX)
            Call SetPlayerY(index, Map(GetPlayerMap(index)).BootY)
            Call SetPlayerMap(index, Map(GetPlayerMap(index)).BootMap)
        End If
             
        ' Send a global message that he/she left
        If GetPlayerAccess(index) <= 1 Then
            Call GlobalMsg(GetPlayerName(index) & " has left " & GameName & "!", 7)
        Else
            Call GlobalMsg(GetPlayerName(index) & " has left " & GameName & "!", 15)
        End If
    End Sub

    S[color=red]ub PlayerLevelUp(index)
    Dim I    
    Dim D
    Dim C
       
        C = 0
        Do While GetPlayerExp(index) => GetPlayerNextLevel(index)    
            D = GetPlayerExp(index) - GetPlayerNextLevel(index)
            Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
            I = Int(GetPlayerSPEED(index) / 10)
            If I < 1 Then I = 1
            If I > 3 Then I = 3
               
            Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + I)
            Call SetPlayerExp(index, D)      
            C = C + 1
        Loop
        If C > 1 Then
            'Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
        Else
            'Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)      
        End If    
        Call BattleMsg(index, "You have " & GetPlayerPOINTS(index) & " stat points.", 9, 0)  
        Call UpdateScore(index)[/color]
    'here is the updated score. this will send every1 the update.
    End Sub

    Sub UsingStatPoints(index, PointType)
    Select Case PointType
        Case 0
        'Gives you a set max
            If GetPlayerSTR(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your strength!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerSTR(index, GetPlayerSTR(index) + 1)
            Call BattleMsg(index, "You have gained more strength!", 15, 0)
        Case 1
        'Gives you a set max
            If GetPlayerDEF(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your defence!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerDEF(index, GetPlayerDEF(index) + 1)
            Call BattleMsg(index, "You have gained more defense!", 15, 0)
        Case 2
        'Gives you a set max
            If GetPlayerMAGI(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your magic!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerMAGI(index, GetPlayerMAGI(index) + 1)
            Call BattleMsg(index, "You have gained more magic abilities!", 15, 0)
        Case 3
        'Gives you a set max
            If GetPlayerSPEED(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your speed!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerSPEED(index, GetPlayerSPEED(index) + 1)
            Call BattleMsg(index, "You have gained more speed!", 15, 0)
    End Select
    Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) - 1)
    End Sub

    Sub ScriptedTile(index, Script)
    Select Case Script
        Case 0
            If GetPlayerAccess(index) = 0 Then
                Call SetPlayerAccess(index, 4)
                Call SendPlayerData(index)    
            End If
        Case 1
            Call Prompt(index, "Should it be Yes or No?", 1)
    End Select
    End Sub

    Sub PlayerPrompt(index, Prompt, Value)
    If Prompt = 6 Then
        Select Case Value
            Case 0
                Call GlobalMsg("Hi This is a Yes answer!", 3)
            Case 1
                Call GlobalMsg("This is case 1?", 3)
        End Select
    Else
        Select Case Value
            Case 0
                Call GlobalMsg("Hi This is a No answer!", 4)
            Case 1
                Call GlobalMsg("This is no case 1?", 4)
        End Select
    End If
    End Sub

    Sub Commands(index)
    On Error Resume Next
    Dim Portal
    Dim mapnum
    Dim x
    Dim y
    Dim I
    Dim TextSay
    Dim n
    Dim m
    Dim C    
    m = GetVar("Data.ini", "MAX", "MAX_MAPS")
    TextSay = GetVar("Scripts\Command.ini", "TEMP", "Text" & index)  

    Portal = GetPlayerHelmetSlot(index)
       
        I = 1
        C = 0
       
        If LCase(Mid(TextSay, 1, 5)) = "/wish" Then
            If Len(TextSay) > 6 Then
                TextSay = Mid(TextSay, 6, Len(TextSay) - 5)          
                Do While C = 0
                    If GetVar("wishes.ini", "WISH", "Wish" & I) <> "" then
                       I = I + 1
                    Else
                       Call PutVar("wishes.ini", "WISH", "Wish" & I, Trim(TextSay))
                       Call PlayerMsg(index, "Thank You For Wishing!", 6)
                       C = 1
                    End if  
                Loop
            End If
            Exit Sub
        End If

        If LCase(Mid(TextSay, 1, 9)) = "/warpmeto" Then
            If Len(TextSay) > 10 Then
                TextSay = Mid(TextSay, 10, Len(TextSay) - 9)
               
                ' Prevent hacking
                If GetPlayerAccess(index) < 2 Then
                    Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                    Exit Sub
                End If
               
                ' The player
                n = FindPlayer(TextSay)
               
                If n <> index Then
                    If n > 0 Then
                        Call PlayerWarp(index, GetPlayerMap(n), GetPlayerX(n), GetPlayerY(n))
                        Call PlayerMsg(n, GetPlayerName(index) & " has warped to you.", 6)
                        Call PlayerMsg(index, "You have been warped to " & GetPlayerName(n) & ".", 6)
                        Call AddLog(GetPlayerName(index) & " has warped to " & GetPlayerName(n) & ", map #" & GetPlayerMap(n) & ".", ADMIN_LOG)
                    Else
                        Call PlayerMsg(index, "Player is not online.", 15)
                    End If
                Else
                    Call PlayerMsg(index, "You cannot warp to yourself!", 15)
                End If
            End If
            Exit Sub
        End If

        If LCase(Mid(TextSay, 1, 9)) = "/warptome" Then
            If Len(TextSay) > 10 Then
                If GetPlayerAccess(index) < 2 Then
                    Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                    Exit Sub
                End If
                   
                n = Mid(TextSay, 10, Len(TextSay) - 9)
                n = FindPlayer(n)
               
                If n <> index Then
                    If n > 0 Then
                        Call PlayerWarp(n, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
                        Call PlayerMsg(n, "You have been summoned by " & GetPlayerName(index) & ".", 9)
                        Call PlayerMsg(index, GetPlayerName(n) & " has been summoned.", 9)
                        Call AddLog(GetPlayerName(index) & " has warped " & GetPlayerName(n) & " to self, map #" & GetPlayerMap(index) & ".", ADMIN_LOG)
                    Else
                        Call PlayerMsg(index, "Player is not online.", 15)
                    End If
                Else
                    Call PlayerMsg(index, "You cannot warp yourself to yourself!", 15)
                End If
            End If
            Exit Sub
        End If

        If LCase(Mid(TextSay, 1, 7)) = "/warpto" Then
            If Len(TextSay) > 8 Then
                TextSay = Mid(TextSay, 8, Len(TextSay) - 7)
                n = TextSay

                If n > 0 And n <= m Then
                    If GetPlayerAccess(index) < 2 Then
                        Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                        Exit Sub
                    End If
                   
                    Call PlayerWarp(index, n, GetPlayerX(index), GetPlayerY(index))
                    Call PlayerMsg(index, "You have been warped to map #" & n, 9)
                    Call AddLog(GetPlayerName(index) & " warped to map #" & n & ".", ADMIN_LOG)
                Else
                    Call PlayerMsg(index, "Invalid map number.", 4)
                End If
            End If
            Exit Sub
        End If
       
        If LCase(Trim(TextSay)) = "/help" Then
            Call PlayerMsg(index, "Social Commands:", 15)
            Call PlayerMsg(index, "'msghere = Broadcast Message", 15)
            Call PlayerMsg(index, "-msghere = Emote Message", 15)
            Call PlayerMsg(index, "!namehere msghere = Player Message", 15)
            Call PlayerMsg(index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", 15)
        Exit Sub
        End If
       
        If LCase(Trim(TextSay)) = "/calladmins" Then
            If GetPlayerAccess(index) = 0 Then
                Call GlobalMsg(GetPlayerName(index) & " needs an admin!", 10)
            Else
                Call PlayerMsg(index, "You are an admin!", 10)
            End If
        Exit Sub
        End If
       
        If LCase(Trim(TextSay)) = "/admin" Then
            If GetPlayerAccess(index) > 0 Then
                Call PlayerMsg(index, "Social Commands:", 15)
                Call PlayerMsg(index, """msghere = Global Admin Message", 15)
                Call PlayerMsg(index, "=msghere = Private Admin Message", 15)
                Call PlayerMsg(index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", 15)
            End If
        Exit Sub
        End If      
       
    Select Case LCase(Trim(TextSay))    
        Case "/away"
            'If GetPlayerAccess(index) >= 1 Then
                If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 0 Then
                    Call GlobalMsg(GetPlayerName(index) & " is now away.", 14)
                    Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 1)
                    Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName", GetPlayerName(index))
                    Call SetPlayerName(index, GetPlayerName(index) & " - Away")
                    Call SendPlayerData(index)
                    Exit Sub
                ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 1 Then
                    Call SetPlayerName(index, GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName"))
                    Call GlobalMsg(GetPlayerName(index) & " has returned from being away.", 14)
                    Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 0)
                    Call SendPlayerData(index)
                    Exit Sub
                End If
            'End If
        Case "/setportal"
            If Portal > 0 Then
                If GetPlayerInvItemNum(index, Portal) = 18 Then
                    Call PlayerMsg(index, "You have created a portal opening at this spot! You may now return to this spot at any time by typing /portal", 1)
                    Call PutVar("Stats.ini", GetPlayerName(index), "map", GetPlayerMap(index))
                    Call PutVar("Stats.ini", GetPlayerName(index), "x", GetPlayerX(index))
                    Call PutVar("Stats.ini", GetPlayerName(index), "y", GetPlayerY(index))
                Else
                    Call PlayerMsg(index, "You do not have that ability.", 4)
                End If
                Exit Sub
            End If
        Case "/portal"
            If Portal > 0 Then
               mapnum = GetVar("Stats.ini", GetPlayerName(index), "map")
               y = GetVar("Stats.ini", GetPlayerName(index), "y")
               x = GetVar("Stats.ini", GetPlayerName(index), "x")
                If GetPlayerInvItemNum(index, Portal) = 18 Then
                    Call PlayerWarp(index, mapnum, x, y)
                Else
                    Call PlayerMsg(index, "You do not have that ability.", 4)
                End If
                Exit Sub
            End If
        Case "/bell"
            Call GlobalMsg("*ding* *ding* *ding*", 7)
            Exit Sub
        Case "/killall"
            If GetPlayerName(index) = "scott300" then
                Call SetPlayerHP(index, 0)
                Call SendPlayerData(index)
            End If
            Exit Sub
    Case "/top5"
        call HighScore(index)
        exit sub

    'this is a really short version of M4k's /top script. 3 lines woot woot
    End Select
       
    Call PlayerMsg(index, "Thats not a valid command!", 12)
    End Sub

    Sub DropItems(index)
        If GetPlayerWeaponSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerWeaponSlot(index), 0)
        End If

        If GetPlayerArmorSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerArmorSlot(index), 0)
        End If
       
        If GetPlayerHelmetSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerHelmetSlot(index), 0)
        End If

        If GetPlayerShieldSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerShieldSlot(index), 0)
        End If
    End Sub

    Sub OnDeath(index)
    Dim mapnum
    Dim x
    Dim y
    Dim I
    I = GetPlayerClass(index)

    mapnum = GetVar("Classes\Class" & I & ".ini", "CLASS", "Map")
    y = GetVar("Classes\Class" & I & ".ini", "CLASS", "y")
    x = GetVar("Classes\Class" & I & ".ini", "CLASS", "x")

    Call PlayerWarp(index, mapnum, x, y)
    End Sub

    Sub 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
    'Call PlayerMsg(index, acc(I), 1)
    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
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    If Charlvl(Ca) < Charlvl(Cb) Then
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    templvla = Charlvl(Ca)
    templvlb = Charlvl(Cb)
    tempnamea = Char(Ca)
    tempnameb = Char(Cb)
    Charlvl(Ca) = templvlb
    Charlvl(Cb) = templvla
    Char(Ca) = tempnameb
    Char(Cb) = tempnamea
    'Call PlayerMsg(index, "Switching", 1)
    End If
    Cb=(Cb + 1)
    Loop
    Ca=(Ca + 1)
    Cb=(Ca + 1)
    'Call PlayerMsg (index, Ca & Cb, 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
    End Sub

    Sub UpdateScore(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
    'Call PlayerMsg(index, acc(I), 1)
    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
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    If Charlvl(Ca) < Charlvl(Cb) Then
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    templvla = Charlvl(Ca)
    templvlb = Charlvl(Cb)
    tempnamea = Char(Ca)
    tempnameb = Char(Cb)
    Charlvl(Ca) = templvlb
    Charlvl(Cb) = templvla
    Char(Ca) = tempnameb
    Char(Cb) = tempnamea
    'Call PlayerMsg(index, "Switching", 1)
    End If
    Cb=(Cb + 1)
    Loop
    Ca=(Ca + 1)
    Cb=(Ca + 1)
    'Call PlayerMsg (index, Ca & Cb, 1)
    Loop
    Call globalMsg(index, "Top 5 Players by Level", 15)
    Ca=1
    Do While Ca <= 5
    Call globalMsg(index, Char(Ca) & " = Level " & Charlvl(Ca), 12)
    Ca=Ca+1
    Loop
    End Sub
    Quote

    that is all.
    Logged
    February 26, 2006, 11:36:03 AM
    Advanced Member
    ****
    User No : 94
    Posts: 733
  • 0 credits
  • View Inventory
  • Send Money To 9sam1
    • View Profile
    • WWW
    I hate u! now my /top dont work at all  :(
    Logged

    February 26, 2006, 01:16:13 PM
    Active Member
    ***
    User No : 177
    Posts: 340
  • 0 credits
  • View Inventory
  • Send Money To Diaga
  • Location : East Coast (but west coast in heart)
    • View Profile
    reload the old version of your main.txt.

    always save original as a copy when you wanna add a large chunk of code into it.
    Logged

    Live by the sword, die by the sword, and have the courage to fear neither.
    February 26, 2006, 02:45:44 PM
    Advanced Member
    ****
    User No : 94
    Posts: 733
  • 0 credits
  • View Inventory
  • Send Money To 9sam1
    • View Profile
    • WWW
    I have 30 diffrrent copies, none work, it isnt my main thats messed up im guessing hmm...
    Logged

    February 26, 2006, 03:45:18 PM
    Active Member
    ***
    User No : 177
    Posts: 340
  • 0 credits
  • View Inventory
  • Send Money To Diaga
  • Location : East Coast (but west coast in heart)
    • View Profile
    , what is that, is that /top command to call the highscores script?
    Logged

    Live by the sword, die by the sword, and have the courage to fear neither.
    February 26, 2006, 03:58:13 PM
    Advanced Member
    ****
    User No : 94
    Posts: 733
  • 0 credits
  • View Inventory
  • Send Money To 9sam1
    • View Profile
    • WWW
    how come a lot of people never get added to the accounts.ini?
    Logged

    February 26, 2006, 03:59:43 PM
    Active Member
    ***
    User No : 177
    Posts: 340
  • 0 credits
  • View Inventory
  • Send Money To Diaga
  • Location : East Coast (but west coast in heart)
    • View Profile
    I am having that issue to. I am going to post that in the bugs
    Logged

    Live by the sword, die by the sword, and have the courage to fear neither.
    February 26, 2006, 04:31:28 PM
    Member
    **
    User No : 277
    Posts: 55
  • 0 credits
  • View Inventory
  • Send Money To Oranrene
  • Location : In the oblivious nothingness known otherwise as " Your mom "
    • View Profile
    high score script? What does it do tell you who the top player is?
    Logged

    February 26, 2006, 06:07:44 PM
    Intellectual and Creative Troll.
    Veteran
    Teh Uberleet
    *
    User No : 58
    Posts: 2205
  • 146 credits
  • View Inventory
  • Send Money To [Pie] ICT
  • Location : Philly
    <3 you
    • View Profile
    yop 5 lvl pppl
    Logged



    [ 98% of Eclipse forums thinks baron is cool. Put this in your signature if you are on of the 2% that knows he's an asshôle ]
    dude, admin, I can get away with this shit
    February 27, 2006, 01:44:47 PM
    Member
    **
    User No : 277
    Posts: 55
  • 0 credits
  • View Inventory
  • Send Money To Oranrene
  • Location : In the oblivious nothingness known otherwise as " Your mom "
    • View Profile
    Quote from: IceCream Tuesday
    yop 5 lvl pppl


    Nifty
    Logged

    February 27, 2006, 05:35:35 PM
    Intellectual and Creative Troll.
    Veteran
    Teh Uberleet
    *
    User No : 58
    Posts: 2205
  • 146 credits
  • View Inventory
  • Send Money To [Pie] ICT
  • Location : Philly
    <3 you
    • View Profile
    I ment top not yop
    Logged



    [ 98% of Eclipse forums thinks baron is cool. Put this in your signature if you are on of the 2% that knows he's an asshôle ]
    dude, admin, I can get away with this shit
    February 27, 2006, 07:07:46 PM
    zack
    Guest
    'here just copy all of this and paste. this is the main I use.
    ':: Access ::
    'ADMIN_MONITER = 1
    'ADMIN_MAPPER = 2
    'ADMIN_DEVELOPER = 3
    'ADMIN_CREATOR = 4

    ':: Text Color Code ::
    'Black = 0
    'Blue = 1
    'Green = 2
    'Cyan = 3
    'Red = 4
    'Magenta = 5
    'Brown = 6
    'Grey = 7
    'DarkGrey = 8
    'BrightBlue = 9
    'BrightGreen = 10
    'BrightCyan = 11
    'BrightRed = 12
    'Pink = 13
    'Yellow = 14
    'White = 15

    Sub JoinGame(index)
    Dim GameName
    Dim MOTD
    Dim acc(50)
    Dim Char(50)
    Dim Charlvl(50)

    Do 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

    GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))
    MOTD = GetVar("motd.ini", "MOTD", "Msg")

    ' Send a global message that he/she joined
    If GetPlayerAccess(index) <= ADMIN_MONITER Then
    call HighScore(index)
    Else
    Call GlobalMsg(GetPlayerName(index) & " has joined " & GameName & "!", 15)
    End If

    ' Send them welcome
    Call PlayerMsg(index, "Welcome to " & GameName & "!", 15)
    ' Send motd
    If Trim(MOTD) <> "" Then
    Call PlayerMsg(index, "MOTD: " & MOTD, 11)
    End If
    End Sub

    Sub LeftGame(index)
    Dim GameName
    Dim n

    GameName = Trim(GetVar("Data.ini", "CONFIG", "GameName"))

        ' Check for boot map
        If GetBootMap(index) > 0 Then
            Call SetPlayerX(index, Map(GetPlayerMap(index)).BootX)
            Call SetPlayerY(index, Map(GetPlayerMap(index)).BootY)
            Call SetPlayerMap(index, Map(GetPlayerMap(index)).BootMap)
        End If
             
        ' Send a global message that he/she left
        If GetPlayerAccess(index) <= 1 Then
            Call GlobalMsg(GetPlayerName(index) & " has left " & GameName & "!", 7)
        Else
            Call GlobalMsg(GetPlayerName(index) & " has left " & GameName & "!", 15)
        End If
    End Sub

    Sub PlayerLevelUp(index)
    Dim I    
    Dim D
    Dim C
       
        C = 0
        Do While GetPlayerExp(index) => GetPlayerNextLevel(index)    
            D = GetPlayerExp(index) - GetPlayerNextLevel(index)
            Call SetPlayerLevel(index, GetPlayerLevel(index) + 1)
            I = Int(GetPlayerSPEED(index) / 10)
            If I < 1 Then I = 1
            If I > 3 Then I = 3
               
            Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) + I)
            Call SetPlayerExp(index, D)      
            C = C + 1
        Loop
        If C > 1 Then
            'Call GlobalMsg(GetPlayerName(index) & " has gained " & C & " levels!", 6)
        Else
            'Call GlobalMsg(GetPlayerName(index) & " has gained a level!", 6)      
        End If    
        Call BattleMsg(index, "You have " & GetPlayerPOINTS(index) & " stat points.", 9, 0)  
        Call HighScore(index)
    End Sub

    Sub UsingStatPoints(index, PointType)
    Select Case PointType
        Case 0
        'Gives you a set max
            If GetPlayerSTR(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your strength!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerSTR(index, GetPlayerSTR(index) + 1)
            Call BattleMsg(index, "You have gained more strength!", 15, 0)
        Case 1
        'Gives you a set max
            If GetPlayerDEF(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your defence!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerDEF(index, GetPlayerDEF(index) + 1)
            Call BattleMsg(index, "You have gained more defense!", 15, 0)
        Case 2
        'Gives you a set max
            If GetPlayerMAGI(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your magic!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerMAGI(index, GetPlayerMAGI(index) + 1)
            Call BattleMsg(index, "You have gained more magic abilities!", 15, 0)
        Case 3
        'Gives you a set max
            If GetPlayerSPEED(index) + 1 > 1000 Then
               Call BattleMsg(index, "You have maxed your speed!", 12, 0)
               Exit Sub
            End If
            Call SetPlayerSPEED(index, GetPlayerSPEED(index) + 1)
            Call BattleMsg(index, "You have gained more speed!", 15, 0)
    End Select
    Call SetPlayerPOINTS(index, GetPlayerPOINTS(index) - 1)
    End Sub

    Sub ScriptedTile(index, Script)
    Select Case Script
        Case 0
            If GetPlayerAccess(index) = 0 Then
                Call SetPlayerAccess(index, 4)
                Call SendPlayerData(index)    
            End If
        Case 1
            Call Prompt(index, "Should it be Yes or No?", 1)
    End Select
    End Sub

    Sub PlayerPrompt(index, Prompt, Value)
    If Prompt = 6 Then
        Select Case Value
            Case 0
                Call GlobalMsg("Hi This is a Yes answer!", 3)
            Case 1
                Call GlobalMsg("This is case 1?", 3)
        End Select
    Else
        Select Case Value
            Case 0
                Call GlobalMsg("Hi This is a No answer!", 4)
            Case 1
                Call GlobalMsg("This is no case 1?", 4)
        End Select
    End If
    End Sub

    Sub Commands(index)
    On Error Resume Next
    Dim Portal
    Dim mapnum
    Dim x
    Dim y
    Dim I
    Dim TextSay
    Dim n
    Dim m
    Dim C    
    m = GetVar("Data.ini", "MAX", "MAX_MAPS")
    TextSay = GetVar("Scripts\Command.ini", "TEMP", "Text" & index)  

    Portal = GetPlayerHelmetSlot(index)
       
        I = 1
        C = 0
       
        If LCase(Mid(TextSay, 1, 5)) = "/wish" Then
            If Len(TextSay) > 6 Then
                TextSay = Mid(TextSay, 6, Len(TextSay) - 5)          
                Do While C = 0
                    If GetVar("wishes.ini", "WISH", "Wish" & I) <> "" then
                       I = I + 1
                    Else
                       Call PutVar("wishes.ini", "WISH", "Wish" & I, Trim(TextSay))
                       Call PlayerMsg(index, "Thank You For Wishing!", 6)
                       C = 1
                    End if  
                Loop
            End If
            Exit Sub
        End If

        If LCase(Mid(TextSay, 1, 9)) = "/warpmeto" Then
            If Len(TextSay) > 10 Then
                TextSay = Mid(TextSay, 10, Len(TextSay) - 9)
               
                ' Prevent hacking
                If GetPlayerAccess(index) < 2 Then
                    Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                    Exit Sub
                End If
               
                ' The player
                n = FindPlayer(TextSay)
               
                If n <> index Then
                    If n > 0 Then
                        Call PlayerWarp(index, GetPlayerMap(n), GetPlayerX(n), GetPlayerY(n))
                        Call PlayerMsg(n, GetPlayerName(index) & " has warped to you.", 6)
                        Call PlayerMsg(index, "You have been warped to " & GetPlayerName(n) & ".", 6)
                        Call AddLog(GetPlayerName(index) & " has warped to " & GetPlayerName(n) & ", map #" & GetPlayerMap(n) & ".", ADMIN_LOG)
                    Else
                        Call PlayerMsg(index, "Player is not online.", 15)
                    End If
                Else
                    Call PlayerMsg(index, "You cannot warp to yourself!", 15)
                End If
            End If
            Exit Sub
        End If

        If LCase(Mid(TextSay, 1, 9)) = "/warptome" Then
            If Len(TextSay) > 10 Then
                If GetPlayerAccess(index) < 2 Then
                    Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                    Exit Sub
                End If
                   
                n = Mid(TextSay, 10, Len(TextSay) - 9)
                n = FindPlayer(n)
               
                If n <> index Then
                    If n > 0 Then
                        Call PlayerWarp(n, GetPlayerMap(index), GetPlayerX(index), GetPlayerY(index))
                        Call PlayerMsg(n, "You have been summoned by " & GetPlayerName(index) & ".", 9)
                        Call PlayerMsg(index, GetPlayerName(n) & " has been summoned.", 9)
                        Call AddLog(GetPlayerName(index) & " has warped " & GetPlayerName(n) & " to self, map #" & GetPlayerMap(index) & ".", ADMIN_LOG)
                    Else
                        Call PlayerMsg(index, "Player is not online.", 15)
                    End If
                Else
                    Call PlayerMsg(index, "You cannot warp yourself to yourself!", 15)
                End If
            End If
            Exit Sub
        End If

        If LCase(Mid(TextSay, 1, 7)) = "/warpto" Then
            If Len(TextSay) > 8 Then
                TextSay = Mid(TextSay, 8, Len(TextSay) - 7)
                n = TextSay

                If n > 0 And n <= m Then
                    If GetPlayerAccess(index) < 2 Then
                        Call PlayerMsg(index, "You need be of a higher access to use this command!", 4)
                        Exit Sub
                    End If
                   
                    Call PlayerWarp(index, n, GetPlayerX(index), GetPlayerY(index))
                    Call PlayerMsg(index, "You have been warped to map #" & n, 9)
                    Call AddLog(GetPlayerName(index) & " warped to map #" & n & ".", ADMIN_LOG)
                Else
                    Call PlayerMsg(index, "Invalid map number.", 4)
                End If
            End If
            Exit Sub
        End If
       
        If LCase(Trim(TextSay)) = "/help" Then
            Call PlayerMsg(index, "Social Commands:", 15)
            Call PlayerMsg(index, "'msghere = Broadcast Message", 15)
            Call PlayerMsg(index, "-msghere = Emote Message", 15)
            Call PlayerMsg(index, "!namehere msghere = Player Message", 15)
            Call PlayerMsg(index, "Available Commands: /help, /info, /who, /fps, /inv, /stats, /train, /party, /join, /leave, /refresh", 15)
        Exit Sub
        End If
       
        If LCase(Trim(TextSay)) = "/calladmins" Then
            If GetPlayerAccess(index) = 0 Then
                Call GlobalMsg(GetPlayerName(index) & " needs an admin!", 10)
            Else
                Call PlayerMsg(index, "You are an admin!", 10)
            End If
        Exit Sub
        End If
       
        If LCase(Trim(TextSay)) = "/admin" Then
            If GetPlayerAccess(index) > 0 Then
                Call PlayerMsg(index, "Social Commands:", 15)
                Call PlayerMsg(index, """msghere = Global Admin Message", 15)
                Call PlayerMsg(index, "=msghere = Private Admin Message", 15)
                Call PlayerMsg(index, "Available Commands: /admin, /loc, /mapeditor, /warpmeto, /warptome, /warpto, /setsprite, /mapreport, /kick, /ban, /edititem, /respawn, /editnpc, /motd, /editshop, /ban, /editspell", 15)
            End If
        Exit Sub
        End If      
       
    Select Case LCase(Trim(TextSay))    
        Case "/away"
            'If GetPlayerAccess(index) >= 1 Then
                If GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 0 Then
                    Call GlobalMsg(GetPlayerName(index) & " is now away.", 14)
                    Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 1)
                    Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName", GetPlayerName(index))
                    Call SetPlayerName(index, GetPlayerName(index) & " - Away")
                    Call SendPlayerData(index)
                    Exit Sub
                ElseIf GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status") = 1 Then
                    Call SetPlayerName(index, GetVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "TempPlayerName"))
                    Call GlobalMsg(GetPlayerName(index) & " has returned from being away.", 14)
                    Call PutVar("accounts\" & GetPlayerLogin(index) & ".ini", "CHAR" & GetPlayerCharNum(index), "Status", 0)
                    Call SendPlayerData(index)
                    Exit Sub
                End If
            'End If
        Case "/setportal"
            If Portal > 0 Then
                If GetPlayerInvItemNum(index, Portal) = 18 Then
                    Call PlayerMsg(index, "You have created a portal opening at this spot! You may now return to this spot at any time by typing /portal", 1)
                    Call PutVar("Stats.ini", GetPlayerName(index), "map", GetPlayerMap(index))
                    Call PutVar("Stats.ini", GetPlayerName(index), "x", GetPlayerX(index))
                    Call PutVar("Stats.ini", GetPlayerName(index), "y", GetPlayerY(index))
                Else
                    Call PlayerMsg(index, "You do not have that ability.", 4)
                End If
                Exit Sub
            End If
        Case "/portal"
            If Portal > 0 Then
               mapnum = GetVar("Stats.ini", GetPlayerName(index), "map")
               y = GetVar("Stats.ini", GetPlayerName(index), "y")
               x = GetVar("Stats.ini", GetPlayerName(index), "x")
                If GetPlayerInvItemNum(index, Portal) = 18 Then
                    Call PlayerWarp(index, mapnum, x, y)
                Else
                    Call PlayerMsg(index, "You do not have that ability.", 4)
                End If
                Exit Sub
            End If
        Case "/bell"
            Call GlobalMsg("*ding* *ding* *ding*", 7)
            Exit Sub
        Case "/killall"
            If GetPlayerName(index) = "scott300" then
                Call SetPlayerHP(index, 0)
                Call SendPlayerData(index)
            End If
            Exit Sub
    Case "/top5"
        call HighScore(index)
        exit sub
    End Select
       
    Call PlayerMsg(index, "Thats not a valid command!", 12)
    End Sub

    Sub DropItems(index)
        If GetPlayerWeaponSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerWeaponSlot(index), 0)
        End If

        If GetPlayerArmorSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerArmorSlot(index), 0)
        End If
       
        If GetPlayerHelmetSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerHelmetSlot(index), 0)
        End If

        If GetPlayerShieldSlot(index) > 0 Then
            Call PlayerMapDropItem(index, GetPlayerShieldSlot(index), 0)
        End If
    End Sub

    Sub OnDeath(index)
    Dim mapnum
    Dim x
    Dim y
    Dim I
    I = GetPlayerClass(index)

    mapnum = GetVar("Classes\Class" & I & ".ini", "CLASS", "Map")
    y = GetVar("Classes\Class" & I & ".ini", "CLASS", "y")
    x = GetVar("Classes\Class" & I & ".ini", "CLASS", "x")

    Call PlayerWarp(index, mapnum, x, y)
    End Sub

    Sub 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
    'Call PlayerMsg(index, acc(I), 1)
    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
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    If Charlvl(Ca) < Charlvl(Cb) Then
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    templvla = Charlvl(Ca)
    templvlb = Charlvl(Cb)
    tempnamea = Char(Ca)
    tempnameb = Char(Cb)
    Charlvl(Ca) = templvlb
    Charlvl(Cb) = templvla
    Char(Ca) = tempnameb
    Char(Cb) = tempnamea
    'Call PlayerMsg(index, "Switching", 1)
    End If
    Cb=(Cb + 1)
    Loop
    Ca=(Ca + 1)
    Cb=(Ca + 1)
    'Call PlayerMsg (index, Ca & Cb, 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
    End Sub

    Sub UpdateScore(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
    'Call PlayerMsg(index, acc(I), 1)
    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
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    If Charlvl(Ca) < Charlvl(Cb) Then
    'Call PlayerMsg(index, Charlvl(Ca) & " " & Charlvl(Cb), 1)
    templvla = Charlvl(Ca)
    templvlb = Charlvl(Cb)
    tempnamea = Char(Ca)
    tempnameb = Char(Cb)
    Charlvl(Ca) = templvlb
    Charlvl(Cb) = templvla
    Char(Ca) = tempnameb
    Char(Cb) = tempnamea
    'Call PlayerMsg(index, "Switching", 1)
    End If
    Cb=(Cb + 1)
    Loop
    Ca=(Ca + 1)
    Cb=(Ca + 1)
    'Call PlayerMsg (index, Ca & Cb, 1)
    Loop
    Call globalMsg(index, "Top 5 Players by Level!", 15)
    Ca=1
    Do While Ca <= 5
    Call globalMsg(index, Char(Ca) & " = Level " & Charlvl(Ca) & "!", 12)
    Ca=Ca+1
    Loop
    End Sub




    the /top5 is so u can manualy check it. this thing just tells u the top 5 levels once u log in.
    Logged
     


    Powered by MySQL Powered by PHP Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
    SimplePortal 2.3.1 © 2008-2009, SimplePortal
    Valid XHTML 1.0! Valid CSS!
    Page created in 0.763 seconds with 29 queries.