Checking which team has higher score.
#1

Creating a TDM server as you can see.

But how do i check which team has higher score?

I got this

pawn Код:
new
     team1=0,
     team2=0
;
And some increasing var when team mate kills a enemy, but how do i check for a high score? Higher one.
Reply
#2

pawn Код:
if(team1 > team2) {
    //t1 has the lead
} else if(team2 > team1) {
    //t2 has the lead
} else {
    //draw
}
Add points OnPlayerDeath
Reply
#3

Loop thru all the teams and compare which score is the higher?

pawn Код:
new higher;
for(new i = 0; i < TEAMS; i ++)
     if(team[i] > higher)
           higher = team[i];
I recommend having teams stored in arrays on this case.

Alternatively you'd have to do single manual checks (if team1 > team 2 && team1 > team3) ...

If you only have two teams then refeer to the code posted above.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)