native cs_create_entity(const classname);
Entity class name
Creates an entity using Counter-Strike's custom CreateNamedEntity wrapper.
Unlike other mods CS keeps track of entities using a custom hashtable.
This function adds entities to this hashtable, providing benefits over
the default CreateNamedEntity (used by create_entity() for example):
- Storing entities in a hashtable allows CS to improve classname lookup
performance compared to functions like FindEntityByString (used by
find_ent_by_class() for example) that usually have to loop
through all entities incrementally.
- As CS exclusively uses the hashtable for classname lookup, entities
created using the default engine functions will not be found by the
game. For example "weaponbox" entities are supposed to be
automatically cleaned up on round restart but are not considered if
they have not been added to the hashtable.
The faster hashtable lookup can be utilized with cs_find_ent_by_class()
Index of the created entity (> 0), 0 otherwise