new Array:g_Triggers
const trigger_name[256] = "name_here"
public plugin_precache() {
getTriggers( trigger_name )
}
public getTriggers( const szTrigger[] ) {
new iEnt = NULLENT; // init
new szTarget[256]; // max size of target name possible
g_Triggers = ArrayCreate(1);
while( ( iEnt = rg_find_ent_by_class( iEnt, szTrigger ) ) ) {
get_entvar( iEnt, var_targetname, szTarget, charsmax( szTarget ) );
if( szTarget[ 0 ] == EOS )
continue;
ArrayPushCell( g_Triggers , iEnt );
}
}
public useTriggers() {
for( new i, iEnt; i < ArraySize( g_Triggers ); i++) {
iEnt = ArrayGetCell( g_Triggers, i);
dllfunc( DLLFunc_Touch, iEnt, 0);
}
}