Checking which team has higher score. - 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: Checking which team has higher score. (
/showthread.php?tid=491334)
Checking which team has higher score. -
JaKe Elite - 30.01.2014
Creating a TDM server as you can see.
But how do i check which team has higher score?
I got this
And some increasing var when team mate kills a enemy, but how do i check for a high score? Higher one.
Re: Checking which team has higher score. -
Misiur - 30.01.2014
pawn Код:
if(team1 > team2) {
//t1 has the lead
} else if(team2 > team1) {
//t2 has the lead
} else {
//draw
}
Add points OnPlayerDeath
Re: Checking which team has higher score. -
CuervO - 30.01.2014
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.