AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] TeamScore Event - Never says who win? (https://forums.alliedmods.net/showthread.php?t=99877)

unSeen 08-10-2009 09:25

[HELP] TeamScore Event - Never says who win?
 
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?

Arkshine 08-10-2009 10:24

Re: [HELP] TeamScore Event - Never says who win?
 
If you want to get which team wins, use TextMsg o SendAudio event. It's possible to read the log, using register_logenvent().


All times are GMT -4. The time now is 18:32.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.