TeamScore is always sent twice, the first time CT Score is passed, the second time Ts.
So you have to wait for Ts score in order to perform your checks.
Also, don't return PLUGIN_HANDLED in an event callback, it has no effect.
just use return with no value, or use return PLUGIN_CONTINUE, in your code, no return was needed, i've added one because of the first thing i told you.
PHP Code:
public Event_TeamScore()
{
new szTeam[2];
read_argv(1, szTeam, charsmax(szTeam));
if (szTeam[0] == 'T')
{
g_iTsScore = read_data(2);
}
else
{
g_iCTsScore = read_data(2);
return; // CT score comes before T score
}
if(g_iCTsScore == 8)
{
match_over(1);
}
else if (g_iTsScore == 8)
{
match_over(2);
}
}
__________________