AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Round End (https://forums.alliedmods.net/showthread.php?t=102422)

Twelve-60 09-02-2009 08:33

Round End
 
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

BOYSplayCS 09-02-2009 08:54

Re: Round End
 
Do you mean CT's, T's or an individual person?

Twelve-60 09-02-2009 08:56

Re: Round End
 
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

Twelve-60 09-02-2009 10:41

Re: Round End
 
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


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

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