Universo Games
Ola , Convidado



Você ainda não e cadastrado então cadastre-se e veja todas as atualizações no mundo rpg!!!
Universo Games

Suporte e Desenvolvimento só no Universo Games

Ola Convidado, Seja Bem vindo a equipe lhe deseja boa sorte no seu projeto!

Você não está conectado. Conecte-se ou registre-se

Servidor Estável ( Acabando com os Bug que Reiniciam seu jogo )

Ver o tópico anterior Ver o tópico seguinte Ir em baixo  Mensagem [Página 1 de 1]

Takezo Kenzei


Membro
Membro
Bom hoje vamos a tirar toudos aquelos Runtimes Error que xingam muito no servidor cuando
ja tenemos pronto o servidor com toudo o que vamos a fazer hoje toudo aquelhso runtimes vai
ser fechado Smile mais so vai ver um Runtime que e imposible levar cuando seu pc esta muito lento ai
vai a cair mais sim voce tem um bom pc adeus ja pode tener um servidor igual que Dbz Forces,Dbz Fusion
de Estable =) e sempre Online

Començamos

Vai para o Source do Servidor e abra o com o visual basic 6.0

Vamos procure por Modtypes procure isso:

Código:
Function GetPlayerName(ByVal Index As Long) As String



de Um enter e Adicione isso:

Código:
On Error Resume Next

Procure isso no modGameLogic:

Código:
Case ITEM_TYPE_ARMOR

                    If InvNum = GetPlayerArmorSlot(Index) Then
                        Call SetPlayerArmorSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If

                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)

                Case ITEM_TYPE_WEAPON

                    If InvNum = GetPlayerWeaponSlot(Index) Then
                        Call SetPlayerWeaponSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If

                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)

                Case ITEM_TYPE_HELMET

                    If InvNum = GetPlayerHelmetSlot(Index) Then
                        Call SetPlayerHelmetSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If

                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)

                Case ITEM_TYPE_SHIELD

                    If InvNum = GetPlayerShieldSlot(Index) Then
                        Call SetPlayerShieldSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If

                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)
            End Select

            MapItem(GetPlayerMap(Index), i).num = GetPlayerInvItemNum(Index, InvNum)
            MapItem(GetPlayerMap(Index), i).x = GetPlayerX(Index)
            MapItem(GetPlayerMap(Index), i).y = GetPlayerY(Index)

            If Item(GetPlayerInvItemNum(Index, InvNum)).Type = ITEM_TYPE_CURRENCY Then

                ' Checar se há mais e então dropar
                If Amount >= GetPlayerInvItemValue(Index, InvNum) Then
                    MapItem(GetPlayerMap(Index), i).Value = GetPlayerInvItemValue(Index, InvNum)
                    Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " deixou " & GetPlayerInvItemValue(Index, InvNum) & " " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & ".", Yellow)
                    Call SetPlayerInvItemNum(Index, InvNum, 0)
                    Call SetPlayerInvItemValue(Index, InvNum, 0)
                    Call SetPlayerInvItemDur(Index, InvNum, 0)
                Else
                    MapItem(GetPlayerMap(Index), i).Value = Amount
                    Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " deixou " & Amount & " " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & ".", Yellow)
                    Call SetPlayerInvItemValue(Index, InvNum, GetPlayerInvItemValue(Index, InvNum) - Amount)
                End If

            Else

                ' Não é um objeto, então é fácil
                MapItem(GetPlayerMap(Index), i).Value = 0

                If Item(GetPlayerInvItemNum(Index, InvNum)).Type >= ITEM_TYPE_WEAPON And Item(GetPlayerInvItemNum(Index, InvNum)).Type <= ITEM_TYPE_SHIELD Then
                    If Item(GetPlayerInvItemNum(Index, InvNum)).Data1 <= -1 Then
                        Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " deixou um(a) " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & " - Ind.", Yellow)
                    Else

                        If Item(GetPlayerInvItemNum(Index, InvNum)).Data1 > 0 Then
                            Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " deixou um(a) " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & " - " & GetPlayerInvItemDur(Index, InvNum) & "/" & Item(GetPlayerInvItemNum(Index, InvNum)).Data1 & ".", Yellow)
                        Else
                            Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " deixou um(a) " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & " - " & GetPlayerInvItemDur(Index, InvNum) & "/" & Item(GetPlayerInvItemNum(Index, InvNum)).Data1 * -1 & ".", Yellow)
                        End If
                    End If

                Else
                    Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " deixou um(a) " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & ".", Yellow)
                End If

                Call SetPlayerInvItemNum(Index, InvNum, 0)
                Call SetPlayerInvItemValue(Index, InvNum, 0)
                Call SetPlayerInvItemDur(Index, InvNum, 0)
            End If
E Substituia toudo por isso:
Código:

Case ITEM_TYPE_WEAPON

                    If InvNum = GetPlayerWeaponSlot(Index) Then
                        Call SetPlayerWeaponSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If
                    On Error Resume Next
                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)

                Case ITEM_TYPE_HELMET

                    If InvNum = GetPlayerHelmetSlot(Index) Then
                        Call SetPlayerHelmetSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If
                    On Error Resume Next
                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)

                Case ITEM_TYPE_SHIELD

                    If InvNum = GetPlayerShieldSlot(Index) Then
                        Call SetPlayerShieldSlot(Index, 0)
                        Call SendWornEquipment(Index)
                    End If
                    On Error Resume Next
                    MapItem(GetPlayerMap(Index), i).Dur = GetPlayerInvItemDur(Index, InvNum)
            End Select
            MapItem(GetPlayerMap(Index), i).num = GetPlayerInvItemNum(Index, InvNum)
            MapItem(GetPlayerMap(Index), i).x = GetPlayerX(Index)
            MapItem(GetPlayerMap(Index), i).y = GetPlayerY(Index)

            If Item(GetPlayerInvItemNum(Index, InvNum)).Type = ITEM_TYPE_CURRENCY Then
On Error Resume Next
                ' Check if its more then they have and if so drop it all
                If Amount >= GetPlayerInvItemValue(Index, InvNum) Then
                    MapItem(GetPlayerMap(Index), i).Value = GetPlayerInvItemValue(Index, InvNum)
                    Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops " & GetPlayerInvItemValue(Index, InvNum) & " " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & ".", Yellow)
                    Call SetPlayerInvItemNum(Index, InvNum, 0)
                    Call SetPlayerInvItemValue(Index, InvNum, 0)
                    Call SetPlayerInvItemDur(Index, InvNum, 0)
                Else
                On Error Resume Next
                    MapItem(GetPlayerMap(Index), i).Value = Amount
                    Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops " & Amount & " " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & ".", Yellow)
                    Call SetPlayerInvItemValue(Index, InvNum, GetPlayerInvItemValue(Index, InvNum) - Amount)
                End If
            Else

                ' Its not a currency object so this is easy
                On Error Resume Next
                MapItem(GetPlayerMap(Index), i).Value = 0

                If Item(GetPlayerInvItemNum(Index, InvNum)).Type >= ITEM_TYPE_WEAPON And Item(GetPlayerInvItemNum(Index, InvNum)).Type <= ITEM_TYPE_SHIELD Then
                    If Item(GetPlayerInvItemNum(Index, InvNum)).Data1 <= -1 Then
                        Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops a " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & " - Ind.", Yellow)
                    Else
On Error Resume Next
                        If Item(GetPlayerInvItemNum(Index, InvNum)).Data1 > 0 Then
                            Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops a " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & " - " & GetPlayerInvItemDur(Index, InvNum) & "/" & Item(GetPlayerInvItemNum(Index, InvNum)).Data1 & ".", Yellow)
                        Else
                            Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops a " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & " - " & GetPlayerInvItemDur(Index, InvNum) & "/" & Item(GetPlayerInvItemNum(Index, InvNum)).Data1 * -1 & ".", Yellow)
                        End If
                    End If
                Else
                On Error Resume Next
                    Call MapMsg(GetPlayerMap(Index), GetPlayerName(Index) & " drops a " & Trim$(Item(GetPlayerInvItemNum(Index, InvNum)).Name) & ".", Yellow)
                End If
                Call SetPlayerInvItemNum(Index, InvNum, 0)
                Call SetPlayerInvItemValue(Index, InvNum, 0)
                Call SetPlayerInvItemDur(Index, InvNum, 0)
            End If
Procure aghora por isso:
Código:

Sub PlayerMapGetItem(ByVal Index As Long)
    Dim i As Long
    Dim N As Long
    Dim MapNum As Long
    Dim Msg As String

    If IsPlaying(Index) = False Then
        Exit Sub
    End If

de um enter e Adicione isso:
Código:
On Error Resume Next
procure aghora por isso:
Código:
If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_KILL Then
Cima disso adicione:
Código:
On Error Resume Next

Procure por isso:
Código:
Sub IncomingData(ByVal Index As Long, ByVal DataLength As Long)
    Dim Buffer As String
    Dim Packet As String
    Dim top As String * 3
    Dim Start As Long

    If Index > 0 Then
        frmServer.Socket(Index).GetData Buffer, vbString, DataLength

        If Buffer = "top" Then
            top = STR(TotalOnlinePlayers)
            Call SendDataTo(Index, top)
            Call CloseSocket(Index)
        End If

        Player(Index).Buffer = Player(Index).Buffer & Buffer
        Start = InStr(Player(Index).Buffer, END_CHAR)

        Do While Start > 0
            Packet = Mid$(Player(Index).Buffer, 1, Start - 1)
            Player(Index).Buffer = Mid$(Player(Index).Buffer, Start + 1, Len(Player(Index).Buffer))
            Player(Index).DataPackets = Player(Index).DataPackets + 1
            Start = InStr(Player(Index).Buffer, END_CHAR)

            If Len(Packet) > 0 Then


e Abaixo adione:
Código:

On Error Resume Next

Procure isso:
Código:
Sub SendDataTo(ByVal Index As Long, ByVal Data As String)

    If IsConnected(Index) Then

de um enter e Adione isso:
Código:
On Error Resume Next
Procure isso:
Código:
Function GetPlayerNextLevel(ByVal Index As Long) As Long
    GetPlayerNextLevel = Experience(GetPlayerLevel(Index))
End Function
e Mude para asim:
Código:
Function GetPlayerNextLevel(ByVal Index As Long) As Long
On Error Resume Next
    GetPlayerNextLevel = Experience(GetPlayerLevel(Index))
End Function
procure isso:
Código:
Sub SetPlayerX(ByVal Index As Long, ByVal x As Long)
    Player(Index).Char(Player(Index).CharNum).x = x
End Sub
e mude para asim:
Código:

Sub SetPlayerX(ByVal Index As Long, ByVal x As Long)
On Error Resume Next
    Player(Index).Char(Player(Index).CharNum).x = x
End Sub
procure isso:
Código:
Sub SetPlayerY(ByVal Index As Long, ByVal y As Long)
    Player(Index).Char(Player(Index).CharNum).y = y
End Sub
e deixe Asim:
Código:

Sub SetPlayerY(ByVal Index As Long, ByVal y As Long)
On Error Resume Next
    Player(Index).Char(Player(Index).CharNum).y = y
End Sub

procure por isso no sub
Código:

Function GetPlayerNextLevel(ByVal Index As Long) As Long
    GetPlayerNextLevel = Experience(GetPlayerLevel(Index))
End Function
e Substituia tudo por isso:
Código:

Function GetPlayerNextLevel(ByVal Index As Long) As Long
On Error GoTo Erro_no_level
    GetPlayerNextLevel = Experience(GetPlayerLevel(Index))
Erro_no_level:
    If Err.Number = 9 Then
    Resume Next
    End If
End Function



procure isso:
Código:

Sub AddToGrid(ByVal NewMap, _
  ByVal NewX, _
  ByVal NewY)
    Grid(NewMap).Loc(NewX, NewY).Blocked = True
End Sub

e Substituia por isso:
Código:
Sub AddToGrid(ByVal NewMap, _
  ByVal NewX, _
  ByVal NewY)
  On Error GoTo erro_no_grid
    Grid(NewMap).Loc(NewX, NewY).Blocked = True
erro_no_grid:
    If Err.Number = 9 Then
    Resume Next
    End If
End Sub

procure isso:
Código:
' Check if they have enough MP
    If GetPlayerMP(Index) < Spell(SpellNum).MPCost Then
        Call BattleMsg(Index, "Sem mana para usar a magia!", BrightRed, 0)
        Exit Sub
    End If
e Substiuia toudo por isso:

Código:
 ' Check if they have enough MP
    On Error GoTo Erro_no_mp
    If GetPlayerMP(Index) < Spell(SpellNum).MPCost Then
        Call BattleMsg(Index, "Not enough mana!", BrightRed, 0)
        Exit Sub
    End If
Erro_no_mp:
    If Err.Number = 9 Then
    Resume Next
    End If


Aghora procure:

Código:
Function GetSpellReqLevel(ByVal SpellNum As Long)
    GetSpellReqLevel = Spell(SpellNum).LevelReq ' - Int(GetClassMAGI(GetPlayerClass(index)) / 4)
End Function

E Subtituia toudo por isso:
Código:

Function GetSpellReqLevel(ByVal SpellNum As Long)
On Error GoTo erro_spell
    GetSpellReqLevel = Spell(SpellNum).LevelReq ' - Int(GetClassMAGI(GetPlayerClass(index)) / 4)
erro_spell:
    If Err.Number = 9 Then
    Resume Next
    End If
End Function


Aghora procure isso:

Código:
 ' Spawn the item before we set the num or we'll get a different free map item slot
            Call SpawnItemSlot(i, MapItem(GetPlayerMap(Index), i).num, Amount, MapItem(GetPlayerMap(Index), i).Dur, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
        Else
            Call PlayerMsg(Index, "Já há muitos itens no chão.", BrightRed)
        End If
    End If

End Sub

e substiuia e deixe asim:

Código:
 ' Spawn the item before we set the num or we'll get a different free map item slot
          On Error GoTo erro_slot
            Call SpawnItemSlot(i, MapItem(GetPlayerMap(Index), i).num, Amount, MapItem(GetPlayerMap(Index), i).Dur, GetPlayerMap(Index), GetPlayerX(Index), GetPlayerY(Index))
        Else
            Call PlayerMsg(Index, "To many items already on the ground.", BrightRed)
        End If
    End If
erro_slot:
    If Err.Number = 9 Then
    Resume Next
    End If
End Sub

procure isso:

Código:
 ' Checar para ver se podemos move-la para outro mapa
        If Map(GetPlayerMap(Index)).Up > 0 And Dir = DIR_UP Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY)
            Moved = YES
        End If

        If Map(GetPlayerMap(Index)).Down > 0 And Dir = DIR_DOWN Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Down, GetPlayerX(Index), 0)
            Moved = YES
        End If

        If Map(GetPlayerMap(Index)).Left > 0 And Dir = DIR_LEFT Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Left, MAX_MAPX, GetPlayerY(Index))
            Moved = YES
        End If

        If Map(GetPlayerMap(Index)).Right > 0 And Dir = DIR_RIGHT Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Right, 0, GetPlayerY(Index))
            Moved = YES
        End If
    End If

e Substituia toudo por isso:
Código:

 ' Check to see if we can move them to the another map
        On Error GoTo Erro_na_direcao
        If Map(GetPlayerMap(Index)).Up > 0 And Dir = DIR_UP Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Up, GetPlayerX(Index), MAX_MAPY)
            Moved = YES
        End If
On Error GoTo Erro_na_direcao
        If Map(GetPlayerMap(Index)).Down > 0 And Dir = DIR_DOWN Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Down, GetPlayerX(Index), 0)
            Moved = YES
        End If
        On Error GoTo Erro_na_direcao
        If Map(GetPlayerMap(Index)).Left > 0 And Dir = DIR_LEFT Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Left, MAX_MAPX, GetPlayerY(Index))
            Moved = YES
        End If
Erro_na_direcao:
        If Err.Number = 9 Then
        Resume Next
        End If
       
On Error GoTo Erro_na_direcao
        If Map(GetPlayerMap(Index)).Right > 0 And Dir = DIR_RIGHT Then
            Call PlayerWarp(Index, Map(GetPlayerMap(Index)).Right, 0, GetPlayerY(Index))
            Moved = YES
        End If
    End If

procure isso:

Código:
 ' Checar se o jogador pisou nas tiles de mudança de sprite
    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_SPRITE_CHANGE Then
        If GetPlayerSprite(Index) = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data1 Then
            Call PlayerMsg(Index, "Você já usa essa sprite!", BrightRed)
            Exit Sub
        Else

            If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2 = 0 Then
                Call SendDataTo(Index, "spritechange" & SEP_CHAR & 0 & END_CHAR)
            Else

                If Item(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2).Type = ITEM_TYPE_CURRENCY Then
                    Call PlayerMsg(Index, "Essa sprite irá custar " & Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data3 & " " & Trim$(Item(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2).Name) & "!", Yellow)
                Else
                    Call PlayerMsg(Index, "Essa sprite irá custar um(a) " & Trim$(Item(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2).Name) & "!", Yellow)
                End If

                Call SendDataTo(Index, "spritechange" & SEP_CHAR & 1 & END_CHAR)
            End If
        End If
    End If



e deixe asim substituia tudo:

Código:
' Check if player stepped on sprite changing tile
    On Error GoTo Erro_no_sprite
    If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Type = TILE_TYPE_SPRITE_CHANGE Then
        If GetPlayerSprite(Index) = Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data1 Then
            Call PlayerMsg(Index, "You already have this sprite!", BrightRed)
            Exit Sub
        Else
On Error GoTo Erro_no_sprite
            If Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2 = 0 Then
                Call SendDataTo(Index, "spritechange" & SEP_CHAR & 0 & SEP_CHAR & END_CHAR)
            Else
On Error GoTo Erro_no_sprite
                If Item(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2).Type = ITEM_TYPE_CURRENCY Then
                    Call PlayerMsg(Index, "This sprite will cost you " & Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data3 & " " & Trim$(Item(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2).Name) & "!", Yellow)
                Else
                    Call PlayerMsg(Index, "This sprite will cost you a " & Trim$(Item(Map(GetPlayerMap(Index)).Tile(GetPlayerX(Index), GetPlayerY(Index)).Data2).Name) & "!", Yellow)
                End If
                Call SendDataTo(Index, "spritechange" & SEP_CHAR & 1 & SEP_CHAR & END_CHAR)
            End If
        End If
    End If
Erro_no_sprite:
    If Err.Number = 9 Then
    Resume Next
    End If

Procure isso:
Código:
Sub TakeFromGrid(ByVal OldMap, _
  ByVal oldx, _
  ByVal oldy)
    Grid(OldMap).Loc(oldx, oldy).Blocked = False

    If Map(OldMap).Tile(oldx, oldy).Type = TILE_TYPE_BLOCKED Then Grid(OldMap).Loc(oldx, oldy).Blocked = True
End Sub

Substituia toudo por isso:

Código:
Sub TakeFromGrid(ByVal OldMap, _
  ByVal oldx, _
  ByVal oldy)
  On Error GoTo erro_grid
    Grid(OldMap).Loc(oldx, oldy).Blocked = False

    If Map(OldMap).Tile(oldx, oldy).Type = TILE_TYPE_BLOCKED Then Grid(OldMap).Loc(oldx, oldy).Blocked = True
erro_grid:
If Err.Number = 9 Then
Resume Next
End If
End Sub

Procure isso:
Código:
Sub UpdateGrid(ByVal OldMap, _
e Substituia por isso:
Código:
Sub UpdateGrid(ByVal OldMap, _
  ByVal oldx, _
  ByVal oldy, _
  ByVal NewMap, _
  ByVal NewX, _
  ByVal NewY)
    Grid(OldMap).Loc(oldx, oldy).Blocked = False
    On Error GoTo erro_grid
    Grid(NewMap).Loc(NewX, NewY).Blocked = True

    If Map(OldMap).Tile(oldx, oldy).Type = TILE_TYPE_BLOCKED Then Grid(OldMap).Loc(oldx, oldy).Blocked = True
erro_grid:
If Err.Number = 9 Then
Resume Next
End If
End Sub
procure isso:
Código:
Case "swapitems"
e Substituia tudo por isso:

Código:
 Case "swapitems"
            N = Player(Index).TradePlayer

            If Player(Index).TradeOk = 0 Then
                Player(Index).TradeOk = 1
                Call SendDataTo(N, "trading" & SEP_CHAR & 1 & SEP_CHAR & END_CHAR)
            ElseIf Player(Index).TradeOk = 1 Then
                Player(Index).TradeOk = 0
                Call SendDataTo(N, "trading" & SEP_CHAR & 0 & SEP_CHAR & END_CHAR)
            End If
On Error GoTo errotrade
            If Player(Index).TradeOk = 1 And Player(N).TradeOk = 1 Then
                Player(Index).TradeItemMax2 = 0
                Player(N).TradeItemMax2 = 0
                For i = 1 To MAX_INV

                    If Player(Index).TradeItemMax = Player(Index).TradeItemMax2 Then
                        Exit For
                    End If

                    If GetPlayerInvItemNum(N, i) < 1 Then
                        Player(Index).TradeItemMax2 = Player(Index).TradeItemMax2 + 1
                    End If
                Next
                For i = 1 To MAX_INV

                    If Player(N).TradeItemMax = Player(N).TradeItemMax2 Then
                        Exit For
                    End If

                    If GetPlayerInvItemNum(Index, i) < 1 Then
                        Player(N).TradeItemMax2 = Player(N).TradeItemMax2 + 1
                    End If
                Next

                If Player(Index).TradeItemMax2 = Player(Index).TradeItemMax And Player(N).TradeItemMax2 = Player(N).TradeItemMax Then
                    For i = 1 To MAX_PLAYER_TRADES
                        For x = 1 To MAX_INV

                            If GetPlayerInvItemNum(N, x) < 1 Then
                                If Player(Index).Trading(i).InvNum > 0 Then
                                    Call GiveItem(N, GetPlayerInvItemNum(Index, Player(Index).Trading(i).InvNum), 1)
                                    Call TakeItem(Index, GetPlayerInvItemNum(Index, Player(Index).Trading(i).InvNum), 1)
                                    Exit For
                                End If
                            End If
                        Next
                    Next
                    For i = 1 To MAX_PLAYER_TRADES
                        For x = 1 To MAX_INV

                            If GetPlayerInvItemNum(Index, x) < 1 Then
                                If Player(N).Trading(i).InvNum > 0 Then
                                    Call GiveItem(Index, GetPlayerInvItemNum(N, Player(N).Trading(i).InvNum), 1)
                                    Call TakeItem(N, GetPlayerInvItemNum(N, Player(N).Trading(i).InvNum), 1)
                                    Exit For
                                End If
                            End If
                        Next
                    Next
                    Call PlayerMsg(N, "Trade Successfull!", BrightGreen)
                    Call PlayerMsg(Index, "Trade Successfull!", BrightGreen)
                    Call SendInventory(N)
                    Call SendInventory(Index)
                Else

                    If Player(Index).TradeItemMax2 < Player(Index).TradeItemMax Then
                        Call PlayerMsg(Index, "Your inventory is full!", BrightRed)
                        Call PlayerMsg(N, GetPlayerName(Index) & "'s inventory is full!", BrightRed)
                    End If

                    If Player(N).TradeItemMax2 < Player(N).TradeItemMax Then
                        Call PlayerMsg(N, "Your inventory is full!", BrightRed)
                        Call PlayerMsg(Index, GetPlayerName(N) & "'s inventory is full!", BrightRed)
                    End If
                End If
                Player(Index).TradePlayer = 0
                Player(Index).InTrade = 0
                Player(Index).TradeOk = 0
                Player(N).TradePlayer = 0
                Player(N).InTrade = 0
                Player(N).TradeOk = 0
                Call SendDataTo(Index, "qtrade" & SEP_CHAR & END_CHAR)
                Call SendDataTo(N, "qtrade" & SEP_CHAR & END_CHAR)
            End If
errotrade:
            If Err.Number = 9 Then
            Resume Next
            End If
            Exit Sub

Procure isso:
Código:
Case "leaveparty"
e Substituia tudo por isso:
Código:
Case "leaveparty"

            If Player(Index).PartyID > 0 Then
                Call PlayerMsg(Index, "You have left the party.", Pink)
                N = 0
                For i = 1 To MAX_PARTY_MEMBERS

                    If Party(Player(Index).PartyID).Member(i) = Index Then N = i
                Next
                For i = N To MAX_PARTY_MEMBERS - 1
                    Party(Player(Index).PartyID).Member(i) = Party(Player(Index).PartyID).Member(i + 1)
                Next
                Party(Player(Index).PartyID).Member(MAX_PARTY_MEMBERS) = 0
                N = 0
                For i = 1 To MAX_PARTY_MEMBERS

                    If Party(Player(Index).PartyID).Member(i) <> 0 And Party(Player(Index).PartyID).Member(i) <> Index Then
                        N = N + 1
                        Call PlayerMsg(Party(Player(Index).PartyID).Member(i), GetPlayerName(Index) & " has left the party.", Pink)
                    End If
                Next

                If N < 2 Then
                    Call PlayerMsg(Party(Player(Index).PartyID).Member(1), "The party has disbanded.", Pink)
                    On Error GoTo erro_party
                    Player(Party(Player(Index).PartyID).Member(1)).InParty = NO
                    Player(Party(Player(Index).PartyID).Member(1)).PartyID = 0
                    Party(Player(Index).PartyID).Member(1) = 0
                End If
                Player(Index).InParty = NO
                Player(Index).PartyID = 0
            Else

                If Player(Index).Invited <> 0 Then
                    For i = 1 To MAX_PARTY_MEMBERS

                        If Party(Player(Index).Invited).Member(i) <> 0 And Party(Player(Index).Invited).Member(i) <> Index Then Call PlayerMsg(Index, GetPlayerName(Index) & " has declined the invitation.", Pink)
                    Next
                    Player(Index).Invited = 0
                    Call PlayerMsg(Index, "You have declined the invitation.", Pink)
                Else
                    Call PlayerMsg(Index, "You have not been invited into a party!", Pink)
                End If
            End If
erro_party:
            If Err.Number = 9 Then
            Resume Next
            End If
            Exit Sub
procure isso:
Código:
Function GetBootMap(ByVal Index As Long) As Long
    GetBootMap = Map(GetPlayerMap(Index)).BootMap
End Function
e Substituia isso por:
Código:
Function GetBootMap(ByVal Index As Long) As Long
On Error GoTo Erro_no_mapa
    GetBootMap = Map(GetPlayerMap(Index)).BootMap
Erro_no_mapa:
    If Err.Number = 9 Then
    Resume Next
    End If
End Function

Testado & Aprovado & Recomendado .
Credito : -[ Shaka ]-& Bastista
@Edit.


Luucas Robeerto


Fundador
Fundador
Muito Bom

http://universogamesmmo.forumeiros.com

Éden Rodrigues


Membro
Membro
Fiz tudinho agora só esperar pra ver se vai funcionar, enfin, créditos ai : )

Conteúdo patrocinado


Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo  Mensagem [Página 1 de 1]

Permissão deste fórum:
Você não pode responder aos tópicos neste fórum