Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.