Code: Select all
// All other cases
else
{
/*
new iRaceLimit = get_pcvar_num( CVAR_wc3_race_limit );
new bool:bAllowRace = true;
if ( iRaceLimit > 0 )
{
new iTotal[MAX_RACES];
// Get how many people are using each race
new iPlayers[32], iNumPlayers, i, iTarget;
get_players( iPlayers, iNumPlayers );
for ( i = 0; i < iNumPlayers; i++ )
{
iTarget = iPlayers[i];
if ( iTarget != id && p_data[iTarget][P_RACE] > 0 && p_data[iTarget][P_RACE] <= get_pcvar_num( CVAR_wc3_races ) )
{
iTotal[p_data[iTarget][P_RACE]]++;
}
}
// Now if we have more races selected than iRaceLimit provides us with, then we need to increase iRaceLimit
while ( HLPR_TotalUsingRaces( iTotal ) > iRaceLimit * get_playersnum() )
{
iRaceLimit++;
}
// Check to see if there was an increase that was necessary
if ( iRaceLimit > get_pcvar_num( CVAR_wc3_race_limit ) )
{
WC3_Log( true, "Error, increase wc3_race_limit to at least %d", iRaceLimit );
}
if ( iTotal[i+1] >= iRaceLimit )
{
bAllowRace = false;
}
}*/
new bool:bAllowRace = true;
// Check to see if the user can choose this race (are there too many of this race?)
if ( bAllowRace )
{
pos += formatex( szMenu[pos], 512-pos, "\w%d. %s\y\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
iKeys |= (1<<i);
}
// If not, display the race, but don't give them a key to press
else
{
pos += formatex( szMenu[pos], 512-pos, "\d%d. %s\y\R%s^n", i + 1, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
}
}
Code: Select all
// All other cases
else
{
new bool:bAllowRace = true;
if(i == 9 && !(get_user_flags( id ) & ADMIN_LEVEL_Z) )
bAllowRace = false;
// Check to see if the user can choose this race (are there too many of this race?)
if ( bAllowRace )
{
pos += formatex( szMenu[pos], 512-pos, "\w%d. %s\y\R%s^n", i + 1-z, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
iKeys |= (1<<i-z);
}
// If not, display the race, but don't give them a key to press
else
{
pos += formatex( szMenu[pos], 512-pos, "\y%d. %s\y\R%s^n", i + 1-z, szRaceName[i], ( (get_pcvar_num( CVAR_wc3_save_xp )) ? szXP : " " ) );
}
}