View Single Post
  #3  
Old 08-12-2010, 08:35 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
For Loop Explanation: http://forums.graalonline.com/forums...11&postcount=4

You also can't modify the 'players' array.

Here's a common method for placing each person a different team, by just using an alternating boolean/flag.

PHP Code:
function setupTeams() {
  
// Initialize flag so first player is added to the Red team
  
temp.red true;
  
// Loop through players in level
  
for (temp.plyrplayers) {
    
// Ignore Events Team / Admin
    
if (!temp.plyr.guild.starts("Events")) {
      
// Check if setting to Red team.
      
if (temp.red) {
        
// Set guild to Red
        
temp.plyr.guild "Red";
        
// Reset flag so next player is blue
        
temp.red false;
      } else {
        
// Set guild to Blue
        
temp.plyr.guild "Blue";
        
// Set flag so next player is red
        
temp.red true;
      }
    }
  }

__________________
Quote:
Reply With Quote