Thread: Events: Teams?
View Single Post
  #3  
Old 01-16-2011, 08:35 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
The easiest way is to use modulus (the % sign, think of it as "remainder" of division)

PHP Code:
temp.teams = {"Red Team""Blue Team"}; // array of teams
temp.0;

for (
temp.pl players) { // loop through the players
  
if (pl.guild == "Events Team") {
    continue; 
// if they have an ET tag, skip them
  
}
  
  
pl.guild teams[teams.size()];
  
++;

To add/remove teams just add them to the list at the top.

edit:


Quote:
Originally Posted by Switch View Post
PHP Code:
  team 1
You should always prefix your variables unless you intend for them to be global.
Quote:
PHP Code:
  for (player players in the level) { 
Uhm...what?
Quote:
PHP Code:
    player.guild team
Never use player as a variable name except to refer to the active player; it's reserved.
Quote:
PHP Code:
team = (team=1); //(arg ? true : false) 
Use == for comparison, like so:
PHP Code:
team = (team == 1); 
__________________

Last edited by cbk1994; 01-16-2011 at 08:55 AM..
Reply With Quote