05.04.2010, 11:26
pawn Код:
new
AdminsOnline = 0, //variable to save the number of admins online
i = 0,
m = GetMaxPlayers(); //getting the max number of players
for (; i < m, i++) if (IsPlayerAdmin) AdminsOnline++; //getting the number of admins online
new rand = random(AdminsOnline); //getting a random number
for (; i < m, i++)
{
if(IsPlayerAdmin(playerid))
{
if (AdminsOnline <= 0)
{
//random admin code
break;
}
AdminsOnline--;
}
}
//if the random number is 3, the third admin you meet in the loop will be the random admin

