From what I understood, it's a very simple snippet, what it does is check if an entity is a 'func_button'. If positive, loop through two string sets, checking if the target name matches. If it does, store the entity index on gButtons[START], if it's the first match, or gButtons[START2] if one was already found. Do the same with the stop buttons.
My attempt:
Code:
new iStartCount = 0, iStopCount = 0
if(equal( szClassname, "func_button"))
{
new szTarget[32], i;
pev(iEntity, pev_target, szTarget, charsmax(szTarget));
if(!iStartCount || (iStartCount == 1 && iEntity != gButtons[START]))
{
for( i = 0; i < sizeof(szCounterStart); i++)
{
if(equal(szTarget, szCounterStart[i]))
gButtons[!(iStartCount++) ? START : START2] = iEntity;
}
}
else if(!iStopCount || (iStopCount == 1 && iEntity != gButtons[STOP]))
{
for( i = 0; i < sizeof(szCounterStop); i++)
{
if(equal(szTarget, szCounterStop[i]))
gButtons[!(iStopCount++) ? STOP : STOP2] = iEntity;
}
}
}
__________________