Quote:
Originally Posted by MAGNAT2645
There's a lot of methods to determine entity index.
You can use FindEntityByClassname but this can find ANY entity with specified classname (you should put some additional checks to limit your searching).
You can also retrieve entity's targetname (or HammerID) and then do a loop to find specific entity:
Code:
#define TARGETNAME "PUT TARGETNAME HERE"
char sName[50];
int iEntity = MaxClients + 1;
while ( ( iEntity = FindEntityByClassname( iEntity, "func_button" ) ) != -1 ) {
GetEntPropString( iEntity, Prop_Data, "m_iName", sName, sizeof( sName) );
if ( strcmp( sName, TARGETNAME ) == 0 ) {
HookSingleEntityOutput( iEntity, "OnPressed", MyCallback );
break;
}
}
|
Sorry for my stupidity, but i don't really understand how can i find it.
For example i have the compiled map with the buttons, what should i do to find hammerid or anything of a specific button on a map?