Zopto Posted October 27, 2012 Author Share Posted October 27, 2012 so i got error when i try to log in agen on my account…subscribe out of renge 9 i tryed to delete all account and guild etc but wont work``` 'Check to make sure the guild file exists If Not FileExist("\Data\guilds\Guild" & Player(Index).Char(CharNum).GuildFileId & ".dat") Then``` Link to comment Share on other sites More sharing options...
Scott Posted October 27, 2012 Share Posted October 27, 2012 That means an array is out of range, my guess is CharNum is outside the proper range for the Char Array. Link to comment Share on other sites More sharing options...
Zopto Posted October 27, 2012 Author Share Posted October 27, 2012 i using eclipse dawn can you tell me how to i fix it? Link to comment Share on other sites More sharing options...
Scott Posted October 27, 2012 Share Posted October 27, 2012 Put the whole sub in code tags ill look. Link to comment Share on other sites More sharing options...
Zopto Posted October 27, 2012 Author Share Posted October 27, 2012 ```Public Sub GuildLoginCheck(Index As Long)Dim i As LongDim GuildSlot As LongDim GuildLoaded As BooleanGuildLoaded = False 'Not in guild If Player(Index).Char(TempPlayer(Index).CurChar).GuildFileId = 0 Then Exit Sub 'Check to make sure the guild file exists If Not FileExist("\Data\guilds\Guild" & Player(Index).Char(CharNum).GuildFileId & ".dat") Then 'If guild was deleted remove user from guild Player(Index).Char(CharNum).GuildFileId = 0 Player(Index).Char(CharNum).GuildMemberId = 0 TempPlayer(Index).tmpGuildSlot = 0 Call SavePlayer(Index) PlayerMsg Index, "Your guild has been deleted sorry!", BrightRed Exit Sub End If 'First we need to see if our guild is loaded For i = 1 To MAX_PLAYERS If GuildData(i).In_Use = True Then 'If its already loaded set true If GuildData(i).Guild_Fileid = Player(Index).Char(CharNum).GuildFileId Then GuildLoaded = True GuildSlot = i Exit For End If End If Next i 'If the guild is not loaded we need to load it If GuildLoaded = False Then 'Find open guild slot, if 0 none GuildSlot = FindOpenGuildSlot If GuildSlot > 0 Then 'LoadGuild Call LoadGuild(GuildSlot, Player(Index).Char(CharNum).GuildFileId) End If End If 'Set GuildSlot TempPlayer(Index).tmpGuildSlot = GuildSlot 'This is to prevent errors when we look for them If Player(Index).Char(CharNum).GuildMemberId = 0 Then Player(Index).Char(CharNum).GuildMemberId = 1 'Make sure user didn't get kicked or guild was replaced by a different guild, both result in removal If GuildCheckName(Index, Player(Index).Char(CharNum).GuildMemberId, True) = False Then 'unload if this user is not in this guild and it was loaded for this user If GuildLoaded = False Then Call UnloadGuildSlot(GuildSlot) Exit Sub End If End If 'Sent data and set slot if all is good If Player(Index).Char(CharNum).GuildFileId > 0 Then 'Set online flag GuildData(GuildSlot).Guild_Members(Player(Index).Char(CharNum).GuildMemberId).Online = True 'send Call SendGuild(False, Index, GuildSlot) 'Display motd If Not GuildData(GuildSlot).Guild_MOTD = vbNullString Then PlayerMsg Index, "Guild Motd: " & GuildData(GuildSlot).Guild_MOTD, Blue End If End IfEnd Sub``` Link to comment Share on other sites More sharing options...
Scott Posted October 27, 2012 Share Posted October 27, 2012 So first lets look here:```'Not in guildIf Player(Index).Char(TempPlayer(Index).CurChar).GuildFileId = 0 Then Exit Sub```Now lets look at this:```'Check to make sure the guild file existsIf Not FileExist("\Data\guilds\Guild" & Player(Index).Char(CharNum).GuildFileId & ".dat") Then```There is 1 difference between these 2 that caused the first one to work, and the second one not to.There is 2 ways you could fix this:1\. Add "Dim CharNum as Byte" under the other dims than add "CharNum = TempPlayer(Index).CurChar"or2\. Change all CharNum refrences to "TempPlayer(Index).CurChar"both work the same. Link to comment Share on other sites More sharing options...
Zopto Posted October 27, 2012 Author Share Posted October 27, 2012 aha i note that befor but i didnt went to toch to i dont make biger crap…...Edit**:It Works TNX man!!!!** Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now