Cstrike: Add cs_find_ent_by_owner() native

This commit is contained in:
Arkshine
2015-07-26 19:55:10 +02:00
parent 23b0450938
commit 75853dae60
3 changed files with 68 additions and 0 deletions

View File

@ -1025,6 +1025,26 @@ native cs_create_entity(const classname[]);
*/
native cs_find_ent_by_class(start_index, const classname[]);
/**
* Finds an entity in the world using Counter-Strike's custom FindEntityByString
* wrapper, matching by owner.
*
* @note Unlike other mods CS keeps track of entities using a custom hashtable.
* This function utilizes the hasthable and allows for considerably faster
* classname lookup compared to the default FindEntityByString (used by
* find_ent_by_owner() for example).
* @note This exclusively considers entities in the hashtable, created by the
* game itself or using cs_create_entity().
*
* @param start_index Entity index to start searching from. -1 to start from
* the first entity
* @param classname Classname to search for
* @param owner Entity index to search for entity's owner
*
* @return Entity index > 0 if found, 0 otherwise
*/
native cs_find_ent_by_owner(start_index, const classname[], owner);
/**
* Returns the item id associated with an item name and its aliases.
*