hey all,
I'm using in one of my plugins the TeamScore event.
In plugin_init() it look like that:
Code:
register_event("TeamScore", "on_TeamScore", "a")
That's how my on_TeamScore() function looks:
Code:
public on_TeamScore()
{
// Variable definization.
new szTeam[LEN_TEAM + STRING_OFFSET]
// Read the team who was scored.
read_data(1, szTeam, LEN_TEAM)
server_print("onTeamScored: %s", szTeam) // debug.
// If the team is CT..
if (szTeam[0] == 'C')
{
server_print("CT WON!") // debug
}
// If the team is T..
else if (szTeam[0] == 'T')
{
server_print("T WON!") // debug
}
return PLUGIN_CONTINUE
}
The problem is, that each time team win, I mean if I'm in 1v1 in the terrorist side and I killed my enemy and it said T Win, i see in my server console:
Code:
onTeamScore: CT
CT WON!
onTeamScore: TERRORIST
T WON!
It calls 2 times the event, one time CT win, second time T win.
Anyone knows why?
__________________