Creates a new edict (the basis of a networkable entity).
| Return type: | Entity object |
|---|---|
| Returns: | A valid Entity object on success, None otherwise |
Returns the number of entities in the server.
Returns the maximum number of entities.
To retrieve an Entity object for an entity index, pass the index to the constructor:
>>> myent = Entity(42)
<Entity 42: 'clownshoes' at 0xDEADBEEF>
This edict’s classname.
An array-like object to access the datamaps of this entity:
>>> my_entity = my_client.entity
<Entity 2: 'player' at: 0xB00B5>
>>> my_entity.datamaps["a_datamap_key"]
"Valid datamap response!"
The flags of the edict. These are not the same as entity flags.
This entity’s networkable serverclass name. This is not the same as the classname and is used for networkable state changes.
The send props of the entity in a nice array-like object. Viper is able to determine the type of the sendprop, and thus needs only the name of the property. For example, we can go back and forth between a gun and his owner over and over:
>>> weap = my_client.entity.sendprops["m_hActiveWeapon"]
<Entity 632: 'weapon_ak47' at: 0xBADD06>
>>> if my_client.entity == weap.sendprops["m_hOwner"]: print True
True
Snazzy, eh? It even supports arrays inside sendprops, so you can do:
>>> my_client.entity.sendprops["m_hMyWeapons"][3]
<Entity 897: 'weapon_knife' at: 0xBADBADBA>
Returns whether or not the entity is networkable.
Returns whether or not the entity is valid.
Removes the edict from the world