Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Guild error


Zopto
 Share

Recommended Posts

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

```

Public Sub GuildLoginCheck(Index As Long)

Dim i As Long

Dim GuildSlot As Long

Dim GuildLoaded As Boolean

GuildLoaded = 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 If

End Sub

```
Link to comment
Share on other sites

So first lets look here:

```
'Not in guild

If Player(Index).Char(TempPlayer(Index).CurChar).GuildFileId = 0 Then Exit Sub

```

Now lets look at this:

```

'Check to make sure the guild file exists

If 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"

or

2\. Change all CharNum refrences to "TempPlayer(Index).CurChar"

both work the same.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...