Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help again. D:
#1
Alright, well I'm trying to make a better /delete command in my game. >_> And I seem to have gotten everything but this last part to work.

I keep getting the error "Compile Error: Argument not optional" and I have no clue why. I keep getting it on the "Call DelChar(Index" part. :/ Could someone please help me out? (tell me if you need more information)

Code:
' ::::::::::::::::::::::::::
    ' :: Delete Player Packet ::
    ' ::::::::::::::::::::::::::
    If LCase(Parse(0)) = "senddelchar" Then
            If GetPlayerAccess(GetPlayerAccess(Index)) >= 5 Then
                Call DelChar(Index)
                Call AlertMsg("Character data has been saved!")
            Else
                Call PlayerMsg(Index, "Failed to delete player!", Yellow)
        End If
    Exit Sub
    End If
End Sub

Oh, and I also keep getting the same error "Compile Error: Argument not optional" on this part of my code as well...I keep getting it on the "Call SendDelChar" part...

Code:
' Delete player
        If LCase(Mid(MyText, 1, 8)) = "/delchar (PlayerName)" Then
            Call SendDelChar
            MyText = ""
            Exit Sub
        End If

I think I would do better on my code if I actually knew what that error meant lol. I searched the error on google, but I didn't find anything to help me. :/

*EDIT*

Oh, and I have yet another problem...v.v I tried adding guilds to MS, and now I'm getting "RTE 9: Subscript Out of Range". When I run it in debug mode, it highlights "Npc(n).Name = Parse(2)" for the RTE 9...The strange thing is, I never messed with the Update npc packet...lol

Code:
' :::::::::::::::::::::::
    ' :: Update npc packet ::
    ' :::::::::::::::::::::::
    If (LCase(Parse(0)) = "updatenpc") Then
        n = Val(Parse(1))
        
        ' Update the item
        Npc(n).Name = Parse(2)
        Npc(n).AttackSay = ""
        Npc(n).Sprite = Val(Parse(3))
        Npc(n).SpawnSecs = 0
        Npc(n).Behavior = 0
        Npc(n).Range = 0
        Npc(n).DropChance = 0
        Npc(n).DropItem = 0
        Npc(n).DropItemValue = 0
        Npc(n).STR = 0
        Npc(n).DEF = 0
        Npc(n).SPEED = 0
        Npc(n).MAGI = 0
        Exit Sub
    End If
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)