SA-MP Forums Archive
Ends round with no one alive - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Ends round with no one alive (/showthread.php?tid=360987)



Ends round with no one alive - (_AcE_) - 19.07.2012

I am making a tdm script and I have the command where I use

/start and it will add both teams to the arena, and they can fight.

But how do I make it say, "BLUE TEAM WINS!" when they kill all the red team in the arena?


pawn Код:
if(!strcmp(cmdtext, "/start", true, 8))
    {
        if(isclanwarstarted == 0)
        {
            new string[128];
            format(string, sizeof(string), "** Prepare yourself, a round is about to start!");
            SendClientMessageToAll(COLOR_MESSAGE, string);
            SetTimer("startcw", 5000, false);
            isclanwarstarted = 1;
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                PlayerPlaySound(i, 1139, 0.0, 0.0, 0.0);
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_ERROR, "ERROR: A round is currently running active!");
            PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
        }
        return 1;
    }



Re: Ends round with no one alive - Benjo - 19.07.2012

I would suggest adding an IF statement inside your OnPlayerDeath callback. Within this IF statement, you can check whether the player who died was the last alive on his team and respond accordingly if so.


Re: Ends round with no one alive - (_AcE_) - 20.07.2012

Ok, could you give me some code to help me do that?


Re: Ends round with no one alive - [KHK]Khalid - 20.07.2012

Why a new topic when you already made one? Looks like my last reply in your old topic didn't help ya, did it?