Need help with TDM - 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 TDM (
/showthread.php?tid=78096)
Need help with TDM -
AiVAMAN - 17.05.2009
Hello, I am working on my TDM server, and I wanted to make, that team members can't kill each other. is it possible?
P.s. can somebody explain this:
pawn Код:
stock team()
{
new count;
for(new i; i < MAX_PLAYERS; i++)
{
if(team[i] == 1) count ++;
}
return count;
}
My friend told me, that this is player count... e.g. If in Team 1 are 2 players, in Team 2 is 1 player, in Team 1 can't play 3rd player, he gets an message which sayies that he must play in other team, to make Team balanced... Please help me with these things.
Re: Need help with TDM -
[NL]Bank - 17.05.2009
Use on OnPlayerSpawn: SetPlayerTeam(playerid,TEAMID);
Код:
if(Team[playerid] == Team1)
{
SetPlayerTeam(playerid,Team1);
}
else if(Team[playerid] == Team2)
{
SetPlayerTeam(playerid,Team2)
}
Re: Need help with TDM -
Correlli - 17.05.2009
Quote:
Originally Posted by BlackBank3
Use on OnPlayerSpawn: SetPlayerTeam(playerid,TEAMID);
Код:
if(Team[playerid] == Team1)
{
SetPlayerTeam(playerid,Team1);
}
else if(Team[playerid] == Team2)
{
SetPlayerTeam(playerid,Team2)
}
|
That won't prevent players who are in the same team from killing each other.
Re: Need help with TDM -
AiVAMAN - 17.05.2009
Each other killing fixed... but how do I do with the other thing?
Re: Need help with TDM -
Weirdosport - 17.05.2009
Balancing teams? In the bit where you assign them, just do something like..
pawn Код:
if(team1 > team2) // put player on team2
else //put player on team1
team1 and team2 are variables containing the number of players on each team, that's what your little code thing does I think..
Re: Need help with TDM -
AiVAMAN - 18.05.2009
thanks! it works!