need help with teams - 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: need help with teams (
/showthread.php?tid=161059)
need help with teams -
OmarEco - 18.07.2010
i use TDM team deathmatch
and need max players in team 15
how


??

?
Re: need help with teams -
Kitten - 18.07.2010
so your meaning a team balancer?
Re: need help with teams -
selten98 - 18.07.2010
well you can try it with this:
#define MAX_PLAYERS_IN_TEAM (15)
Re: need help with teams -
OmarEco - 18.07.2010
team = team name ok
Re: need help with teams -
OmarEco - 18.07.2010
no that not i needed
it's in team full send message this team is full choose other team
Re: need help with teams -
Kitten - 18.07.2010
Thats a team balancer wow-.-
ill find one for u wait couple of min
Re: need help with teams -
Kitten - 18.07.2010
i got this from grim_
since your to lazy to search
playerid - the player
team_1 - the team that is being calculated by the ratio
team_2 - the other team
ratio - the ratio of which to balance team 1 from team 2
teamvar - the variable to hold the player's team
Код:
OnPlayerSpawn(playerid)
{
TeamBalance(playerid, TEAM_NAME, TEAM_NAME, 1, Team); // Sets the balance of the teams equal
}
Код:
TeamBalance(playerid, team_1, team_2, ratio, teamvar[]) {
new result_var = (Players() / ratio);
for(new x = 0; x < MAX_PLAYERS; x++) {
if(teamvar[x] == team_1) {
count++;
}
}
if(count < result_var) {
teamvar[playerid] = team_1;
} else {
teamvar[playerid] = team_2;
}
}
Re: need help with teams -
OmarEco - 18.07.2010
can you learn me wherre i paste it
Re: need help with teams -
Kitten - 18.07.2010
just read this
http://forum.sa-mp.com/showthread.ph...t=Team+balance