FindEntityByClassname Function

Searches for an entity by classname.

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

Parameters

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.

Errors

Invalid start entity or lack of mod support.