team balance - 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: team balance (
/showthread.php?tid=155558)
team balance -
oOhossamOo - 19.06.2010
hi i need team balance to my server only for 2 teams
![Cheesy](images/smilies/biggrin.png)
i saw too many codes before all not work.
Re: team balance -
oOhossamOo - 19.06.2010
any help?
Re: team balance -
KDlivest954 - 19.06.2010
U mean, balance the amount of players on each team?
Re: team balance -
oOhossamOo - 19.06.2010
Quote:
Originally Posted by KDlivest954
U mean, balance the amount of players on each team?
|
yeah thats i meant
please help me
Re: team balance -
oOhossamOo - 19.06.2010
any help?
Re: team balance -
ViruZZzZ_ChiLLL - 19.06.2010
First : You can only bump per 12 hour if nobody
has replied to your help. Please do so refer here :
http://forum.sa-mp.com/index.php?topic=67900.0
Second : Try this :
pawn Код:
new Team1, Team2; // On top
public OnPlayerSpawn(playerid)
{
if(Team1 == 5) return ForceClassSelection(playerid); // It means that if there is 5 players in the team he will be forced to select class again
if(Team2 == 5) return ForceClassSelection(playerid);
if(gTeam[playerid] == BlueTeam){
Team1 ++;}
if(gTeam[playerid] == RedTeam){
Team2 ++;}
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(gTeam[playerid] == BlueTeam){
Team1 --;}
if(gTeam[playerid] == RedTeam){
Team2 --;}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
if(gTeam[playerid] == BlueTeam){
Team1 --;}
if(gTeam[playerid] == RedTeam){
Team2 --;}
return 1;
}
Note : This is just an example.
I don't know either if this will work.
Re: team balance -
oOhossamOo - 19.06.2010
Quote:
Originally Posted by ViruZZzZ_ChiLLL
First : You can only bump per 12 hour if nobody
has replied to your help. Please do so refer here :
http://forum.sa-mp.com/index.php?topic=67900.0
Second : Try this :
pawn Код:
new Team1, Team2; // On top
public OnPlayerSpawn(playerid) { if(Team1 == 5) return ForceClassSelection(playerid); // It means that if there is 5 players in the team he will be forced to select class again if(Team2 == 5) return ForceClassSelection(playerid);
if(gTeam[playerid] == BlueTeam){ Team1 ++;} if(gTeam[playerid] == RedTeam){ Team2 ++;} return 1; }
public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[playerid] == BlueTeam){ Team1 --;} if(gTeam[playerid] == RedTeam){ Team2 --;} return 1; }
public OnPlayerDisconnect(playerid, reason) { if(gTeam[playerid] == BlueTeam){ Team1 --;} if(gTeam[playerid] == RedTeam){ Team2 --;} return 1; }
Note : This is just an example.
I don't know either if this will work.
|
thanks i will try and tell you and sory for break section rules
Re: team balance -
oOhossamOo - 20.06.2010
Quote:
Originally Posted by ViruZZzZ_ChiLLL
First : You can only bump per 12 hour if nobody
has replied to your help. Please do so refer here :
http://forum.sa-mp.com/index.php?topic=67900.0
Second : Try this :
pawn Код:
new Team1, Team2; // On top
public OnPlayerSpawn(playerid) { if(Team1 == 5) return ForceClassSelection(playerid); // It means that if there is 5 players in the team he will be forced to select class again if(Team2 == 5) return ForceClassSelection(playerid);
if(gTeam[playerid] == BlueTeam){ Team1 ++;} if(gTeam[playerid] == RedTeam){ Team2 ++;} return 1; }
public OnPlayerDeath(playerid, killerid, reason) { if(gTeam[playerid] == BlueTeam){ Team1 --;} if(gTeam[playerid] == RedTeam){ Team2 --;} return 1; }
public OnPlayerDisconnect(playerid, reason) { if(gTeam[playerid] == BlueTeam){ Team1 --;} if(gTeam[playerid] == RedTeam){ Team2 --;} return 1; }
Note : This is just an example.
I don't know either if this will work.
|
may be should edit OnPlayerSpawn to OnPlayerRequestSpawn?