Syntax: Select all
from filters.entities import EntityIter
# Loop through all entities and get their index, Pointer instance, and classname
for index, pointer, classname in EntityIter(return_types=['index', 'pointer', 'classname']):
print(index, pointer, classname)
# Loop through all weapon entities on the server and get their inthandles
# Notice the use of "False" as the second argument to allow all entity classnames with weapon_ to be iterated over
for handle in EntityIter('weapon_', False, 'inthandle'):
print(handle)
# Loop through all players
# Note the use of "True" as the second argument. "player" can also be found in other entity
# classnames, so using True makes sure only entities with the "player" classname are iterated over
for index in EntityIter('player', True, 'index'):
print(index)
Current return types are:
- index
- edict
- basehandle
- inthandle
- pointer
- classname