Quote:
Originally Posted by xXziroXx
Scratch that while loop, you're over complicating things. Try something like this instead:
PHP Code:
for (temp.i = NULL; temp.i < players.size(); temp.i ++) {
if (temp.i%10 < 6) {
// The top 6 spots
} else if (temp.i%10 < 10) {
// The other 4 spots
}
// Current 'player object' would be read as:
// players[temp.i]
}
|
That's going to include Events Team members, though.
For your problem, maybe something like this:
PHP Code:
function warpPlayers()
{
temp.loc_Convict = {
{ "level.nw", x, y },
{ "leve2.nw", x, y }
};
temp.loc_Guard = {
{ "level.nw", x, y },
{ "leve2.nw", x, y }
};
temp.( @ "loc_Events Team" ) = { { "level.nw", x, y } };
temp.count_Convict = 0;
temp.count_Guard = 0;
temp.( @ "count_Events Team" ) = 0;
for ( temp.pl : players )
{
temp.location = temp.( @ "loc_" @ pl.guild );
if ( location == null || pl.guild == null )
{
continue; // No location specified
}
temp.n = temp.( @ "count_" @ pl.guild );
temp.( @ "count_" @ pl.guild ) = n >= location.size() - 1 ? 0 : n + 1;
n = temp.( @ "count_" @ pl.guild );
pl.setlevel2( location[n][0], location[n][1], location[n][2] );
}
}
(sorry for the weird formatting, TextMate does that, and I can't get on RC at the moment)