Could always do something like this:
PHP Code:
function sortPlayers()
{
temp.totalCount = 0;
for ( temp.pl : players )
{
if ( pl.guild == "Events Team" )
{
continue;
}
totalCount ++;
}
temp.needed = { getPercentOf( totalCount, .6 ), getPercentOf( totalcount, .4 ) }; // { needed convicts, needed convicts }
temp.guilds = { "Convict", "Guard" };
temp.totalCount = 0;
for ( temp.pl : players )
{
if ( pl.guild == "Events Team" )
{
continue;
}
if ( totalCount ++ > needed[ 0 ] )
{
pl.guild = guilds[0];
}
else
{
pl.guild = guilds[1];
}
}
}
function getPercentOf( totalCount, percent )
{
temp.p = int( totalCount * percent );
return p <= 0 ? 0 : p;
}
Haven't tested this, but I think it should work. I'm open to new ways to do this as well.
Formatting got messed up when I pasted it in, but I think I fixed it.