What you want this to do:
PHP Code:
if( !gButtons[START] )
for( i = 0; i < sizeof szCounterStart; i++ )
if( equal( szTarget, szCounterStart[i] ) )
gButtons[START] = iEntity;
?
Find the first (equal( szTarget, szCounterStart[i]) or the last one? As you have it its finding the last one. If it can be the first, add a break. If you want the last one change the for to
PHP Code:
for( i = sizeof szCounterStart -1 ; i >= 0 ; i-- )
and add a break.
If you explain it more i can optimize it.
__________________