Admin Atacando Player
:: Elysium Engine :: Tutoriais
Página 1 de 1
Admin Atacando Player
--- Server ~ Side ---
Procure pela function:
Créditos: RenanR
Procure pela function:
- Código:
Function CanAttackPlayer(ByVal Attacker As Long, ByVal Victim As Long) As Boolean
- 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
:: Elysium Engine :: Tutoriais
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|
Seg Abr 08, 2013 7:18 pm por L Mars
» PlayGame chego !!
Qua Out 17, 2012 1:59 pm por PlayGame
» Dragon Ball Z Moster Online
Ter Out 16, 2012 8:19 pm por Myke ~
» [EEB]Sistema de Guerra ninja Basic Por ComandButton
Ter Out 16, 2012 8:14 pm por Myke ~
» Meus tutorias
Dom Out 14, 2012 4:55 pm por PlayGame
» Avaliem esse's desenho
Dom Out 14, 2012 4:36 pm por PlayGame
» Tutorial Mapper - Como avaliar um mapa
Sáb Out 13, 2012 4:52 pm por NeeTo
» Movimentação Wasd e Setas V2.0
Qui Out 11, 2012 6:14 pm por Myke ~
» Level Maximo 1000
Qui Out 11, 2012 6:10 pm por Myke ~