FindEntityByClassname Function

Searches for an entity by classname.

int FindEntityByClassname(int startEnt, const char[] classname)


int startEnt

A valid entity's index after which to begin searching from. Use -1 to start from the first entity.

const char[] classname

Classname of the entity to find.

Return Value

Entity index >= 0 if found, -1 otherwise.


Invalid start entity or lack of mod support.