You can do something like this, which will make it only fire your code once. Just be aware that you will not get the other teams score info. Whichever team the message is sent for first is the only one you will get.
PHP Code:
new g_LastTeamScoreCall;
public EventTeamScore()
{
new iSysTime;
if ( ( ( iSysTime = get_systime() ) - g_LastTeamScoreCall ) < 2 )
return;
new szTeam[ 2 ];
read_data( 1 , szTeam , charsmax( szTeam ) );
//Code goes here
g_LastTeamScoreCall = iSysTime;
}
I imagine that is not what you want since you are using both teams scores.
Try something like this. In this case, the code where you see '//Code for CT ' and '//Code for T' will only be fired one time. Anything outside of the switch statement will run twice.
PHP Code:
public EventTeamScore()
{
new szTeam[ 2 ] , iScore;
read_data( 1 , szTeam , charsmax( szTeam ) );
iScore = read_data( 2 );
switch ( szTeam[ 0 ] )
{
case 'C':
{
//Code for CT
}
case 'T':
{
//Code for T
}
}
}
__________________