05-08-2008, 04:04 PM
Try this:
[code]
Function CanAttackNpc(ByVal Attacker As Long, ByVal MapNpcNum As Long) As Boolean
Dim MapNum As Long, npcnum As Long
CanAttackNpc = False
' Check for subscript out of range
If IsPlaying(Attacker) = False Or MapNpcNum MAX_MAP_NPCS Then
Exit Function
End If
' Check for subscript out of range
If MapNpc(GetPlayerMap(Attacker), MapNpcNum).Num
[code]
Function CanAttackNpc(ByVal Attacker As Long, ByVal MapNpcNum As Long) As Boolean
Dim MapNum As Long, npcnum As Long
CanAttackNpc = False
' Check for subscript out of range
If IsPlaying(Attacker) = False Or MapNpcNum MAX_MAP_NPCS Then
Exit Function
End If
' Check for subscript out of range
If MapNpc(GetPlayerMap(Attacker), MapNpcNum).Num