Raised This Month: $ Target: $400
 0% 

[Help] Teamscore event


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2013 , 01:25   Re: [Help] Teamscore event
Reply With Quote #8

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(1szTeamcharsmax(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);
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:51.


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