Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.
Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.

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

Adm pode ir pvp !

Ir para baixo  Mensagem [Página 1 de 1]

1Adm pode ir pvp ! Empty Adm pode ir pvp ! Dom Fev 19, 2012 1:23 am

Sakuray

Sakuray
Colaborador
Colaborador

Primeiramente, abra o Server.vbp, muito conhecido como "Server~Side".

Após abrir o mesmo, procure pela Function:

Código:
Function CanAttackPlayer(ByVal Attacker As Long, ByVal Victim As Long) As Boolean

E substitua ela toda por:

Código:
Function CanAttackPlayer(ByVal Attacker As Long, ByVal Victim As Long) As Boolean
    Dim AttackSpeed As Long
    Dim x As Long
    Dim y As Long

    If GetPlayerWeaponSlot(Attacker) > 0 Then
        AttackSpeed = Item(GetPlayerInvItemNum(Attacker, GetPlayerWeaponSlot(Attacker))).AttackSpeed
    Else
        AttackSpeed = 0
    End If

    CanAttackPlayer = False

    ' Checar por Subscript out of range
    If IsPlaying(Attacker) = False Or IsPlaying(Victim) = False Then
        Exit Function
    End If

    ' Ter certeza que não tem 0 de HP
    If GetPlayerHP(Victim) <= 0 Then
        Exit Function
    End If

    ' Ter certeza que não estamos atacando enquanto ele troca de mapa
    If Player(Victim).GettingMap = YES Then
        Exit Function
    End If

    ' Ter certeza que estão no mesmo mapa
    If (GetPlayerMap(Attacker) = GetPlayerMap(Victim)) And (GetTickCount > Player(Attacker).AttackTimer + AttackSpeed) Then
        x = DirToX(GetPlayerX(Attacker), GetPlayerDir(Attacker))
        y = DirToY(GetPlayerY(Attacker), GetPlayerDir(Attacker))

        If (GetPlayerY(Victim) = y) And (GetPlayerX(Victim) = x) Then
            If Map(GetPlayerMap(Victim)).Tile(x, y).Type <> TILE_TYPE_ARENA And Map(GetPlayerMap(Attacker)).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).Type <> TILE_TYPE_ARENA Then

                        ' Checar se o mapa é atacavel
                        If Map(GetPlayerMap(Attacker)).Moral = MAP_MORAL_NONE Or Map(GetPlayerMap(Attacker)).Moral = MAP_MORAL_NO_PENALTY Or GetPlayerPK(Victim) = YES Then

                            ' Ter certeza que se possui level suficiente
                            If GetPlayerLevel(Attacker) < 10 Then
                                Call PlayerMsg(Attacker, "Você está abaixo do nível 10, portanto, você não pode atacar um jogador!", BrightRed)
                            Else

                                If GetPlayerLevel(Victim) < 10 Then
                                    Call PlayerMsg(Attacker, GetPlayerName(Victim) & " está abaixo do nível 10, portanto não pode ser atacado!", BrightRed)
                                Else

                                    If Trim$(GetPlayerGuild(Attacker)) <> vbNullString And GetPlayerGuild(Victim) <> vbNullString Then
                                        If Trim$(GetPlayerGuild(Attacker)) <> Trim$(GetPlayerGuild(Victim)) Then
                                            CanAttackPlayer = True
                                        Else
                                            Call PlayerMsg(Attacker, "Você não pode atacar um jogador do seu clã!", BrightRed)
                                        End If

                                    Else
                                        CanAttackPlayer = True
                                    End If
                                End If
                            End If

                        Else
                            Call PlayerMsg(Attacker, "Esta é uma zona segura!", BrightRed)
                        End If
                    End If
                End If

            ElseIf Map(GetPlayerMap(Victim)).Tile(x, y).Type = TILE_TYPE_ARENA And Map(GetPlayerMap(Attacker)).Tile(GetPlayerX(Attacker), GetPlayerY(Attacker)).Type = TILE_TYPE_ARENA Then
                CanAttackPlayer = True
            End If
       
   

End Function


Créditos:
- RenanR por fazer
- Sakuray por postar

http://narutoghostonline.blogspot.com

Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos