Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Func GetNumberOfFoesInRangeOfAgent2($aMaxDistance = 4000, $ModelID1 = 0, $ModelID2 = 0)
- Local $lCount = 0
- Local $lTargetTypeArray = MemoryReadAgentPtrStruct(3)
- For $i = 1 To $lTargetTypeArray[0]
- Switch(MemoryRead($lTargetTypeArray[$i] + 244, 'word'))
- Case $ModelID1, $ModelID2
- ContinueLoop
- Case Else
- If GetDistance($lTargetTypeArray[$i], $GMePtr) < $aMaxDistance Then $lCount += 1
- Endswitch
- Next
- Return $lCount
- EndFunc
- Func GetNumberOfFoesInRangeOfAgent2($aMaxDistance = 4000, $ModelID1 = 0, $ModelID2 = 0)
- Local $__ModelID = 0, $lCount = 0
- Local $lTargetTypeArray = MemoryReadAgentPtrStruct(3)
- For $i = 1 To $lTargetTypeArray[0]
- $__ModelID = MemoryRead($lTargetTypeArray[$i] + 244, 'word')
- If $__ModelID = $ModelID1 Then ContinueLoop ;Spirit 1
- If $__ModelID = $ModelID2 Then ContinueLoop ;Spirit 2
- If GetDistance($lTargetTypeArray[$i], $GMePtr) < $aMaxDistance Then $lCount += 1
- Next
- Return $lCount
- EndFunc
Advertisement