Raised This Month: $ Target: $400
 0% 

Round End


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Twelve-60
Senior Member
Join Date: Aug 2007
Old 09-02-2009 , 08:33   Round End
Reply With Quote #1

So atm I have this:

Code:
register_logevent("event_round_end", 2, "1=Round_End");

public event_round_end() {
    // stuff
}
How do I find out who won the round, and why?

- Twelve-60
__________________
Twelve-60 is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 09-02-2009 , 08:54   Re: Round End
Reply With Quote #2

Do you mean CT's, T's or an individual person?
BOYSplayCS is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 09-02-2009 , 08:56   Re: Round End
Reply With Quote #3

I need to know which team won, and why they won (Terrorists Win/Target Bombed/CTs Win etc) - it can be the numeric value like here: http://wiki.gotgames.com.au/Round_En...s_%28WarMod%29

I basically want to copy this: http://wiki.gotgames.com.au/Log_Entr...d%29#round_end

- Twelve-60
__________________

Last edited by Twelve-60; 09-02-2009 at 08:58.
Twelve-60 is offline
Twelve-60
Senior Member
Join Date: Aug 2007
Old 09-02-2009 , 10:41   Re: Round End
Reply With Quote #4

I came up with this method! Feel free to comment/improve

Code:
register_event("TextMsg", "event_round_end_winner", "a", "2=#Terrorists_Win", "2=#Target_Bombed", "2=#CTs_Win", "2=#Defused_The_Bomb", "2=#Target_Saved");

public event_round_end_winner() {
    new winner = 2;
    new reasonText[32], reason;
    read_data(2, reasonText, sizeof(reasonText));
    if (equal(reasonText, "#Target_Bombed")) {
        reason = 1;
    } else if (equal(reasonText, "#Defused_The_Bomb")) {
        reason = 7;
    } else if (equal(reasonText, "#CTs_Win")) {
        reason = 8;
    } else if (equal(reasonText, "#Terrorists_Win")) {
        reason = 9;
    } else if (equal(reasonText, "#Target_Saved")) {
        reason = 12;
    }
    log2game("\"round_end\" (winner \"%d\") (reason \"%d\")", winner, reason);
}
- Twelve-60
__________________
Twelve-60 is offline
Reply



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:14.


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