[HELP]Team Balancer 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: [HELP]Team Balancer Help (
/showthread.php?tid=183376)
[HELP]Team Balancer Help -
<Weponz> - 15.10.2010
Will this balancer work will it simple not allow them to spawn and keep sending message when thay try to spawn?
Код:
public OnPlayerRequestSpawn(playerid)
{
new teamcount[2];
for(new i, m = GetMaxPlayers(); i < m; i++)
if(IsPlayerConnected(i))
teamcount[gTeam[playerid]]++;
if(teamcount[gTeam[playerid]] > teamcount[!gTeam[playerid]])
return SendClientMessage(playerid, RED, "Please Balance The Teams And Pick The Weaker Side!(Press TAB)"), 0;
return 0;
}
Re: [HELP]Team Balancer Help -
Retardedwolf - 15.10.2010
Eh why is there two returns? btw indentation please.
Re: [HELP]Team Balancer Help -
<Weponz> - 15.10.2010
Quote:
Originally Posted by Retardedwolf
Eh why is there two returns? btw indentation please.
|
Код:
public OnPlayerRequestSpawn(playerid)
{
new teamcount[2];
for(new i, m = GetMaxPlayers(); i < m; i++)
if(IsPlayerConnected(i))
teamcount[gTeam[playerid]]++;
if(teamcount[gTeam[playerid]] > teamcount[!gTeam[playerid]])
SendClientMessage(playerid, RED, "Please Balance The Teams And Pick The Weaker Side!(Press TAB)");
return 0;
}
Better?