SA-MP Forums Archive
I need help. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need help. (/showthread.php?tid=220514)



I need help. - Baboon - 03.02.2011

gTeam[playerid] = 1 // vietnam.
gTeam[playerid[ = 2 // usa.

vietnamteam // count of the players in vietnam.
usateam // count of the players in usa.

Also TEAM1 == vietnam and TEAM2 == USA (of GetPlayerTeam)

Well can anyone, because I cant figure it out, make a balancer?
like: if(vietnamteam - usateam == 2)
then it takes a ramdom person in vietnam and sets his team to usateam.
anyway can help me? I just can't figure it out!


AW: I need help. - !Phoenix! - 03.02.2011

So something that runs in a loop?

1. Create an array for each team which contains the respective playerid's
In the loop:
2. Check if there is a difference of players greater than 1 in the Teams.
3. gTeam[ playersarray[ Random( sizeof(playersarray) ) ] ] = 1/2
4. Change the info for the teams (count of players and playerid's)

Just as an idea.

Please choose an expressive title the next time