Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # >> IMPORTS
- # =============================================================================
- # EventScripts
- import es
- # binutils
- import custom_types
- from custom_types import utils
- # =============================================================================
- # >> TESTS
- # =============================================================================
- # Get the IServerTools interface
- server_tools = custom_types.IServerTools(utils.CreateInterface('VSERVERTOOLS002', 0))
- # Get the factory dictionary
- factory_dict = server_tools.GetEntityFactoryDictionary()
- # Loop through all entities on the map
- entity = server_tools.FirstEntity()
- while entity:
- # Get its classname. E.g. player or func_button
- classname = entity.m_iClassname
- # Get the name of the C++ class. E.g. CCSPlayer or CFuncButton
- cppclassname = entity.GetDataDescMap().dataClassName
- # Get the entity's handle and convert it to an index
- index = es.getindexfromhandle(entity.GetRefHandle().m_Index)
- # Get the entity's size. E.g. sizeof(CCSPlayer)
- size = factory_dict.FindFactory(classname).GetEntitySize()
- # Now print all the information
- print index, cppclassname, classname, size
- # Get next entity
- entity = server_tools.NextEntity(entity)
Advertisement
Add Comment
Please, Sign In to add comment