08.01.2012, 16:53
You'll need to loop through all the players a few times.
This will take alot longer than a singular loop, keep that in mind.
This will take alot longer than a singular loop, keep that in mind.
pawn Код:
for(new one=0; one<MAX_PLAYERS; one++)
{
if(PlayerData[one][AdminLevel] == 1)
{
GetPlayerName(one,Nam,MAX_PLAYER_NAME);
format(str, sizeof(str), "| %s > Moderator (Level 1)",Nam);
SCM(playerid,COLOR_YELLOW,str);
}
}
for(new two=0; two<MAX_PLAYERS; two++)
{
if(PlayerData[two][AdminLevel] == 2)
{
GetPlayerName(two,Nam,MAX_PLAYER_NAME);
format(str, sizeof(str), "| %s > Basic Admin (Level 2)",Nam);
SCM(playerid,COLOR_YELLOW,str);
}
}
for(new three=0; three<MAX_PLAYERS; three++)
{
if(PlayerData[three][AdminLevel] == 3)
{
GetPlayerName(three,Nam,MAX_PLAYER_NAME);
format(str, sizeof(str), "| %s > Standard Admin (Level 3)",Nam);
SCM(playerid,COLOR_YELLOW,str);
}
}
for(new four=0; four<MAX_PLAYERS; four++)
{
if(PlayerData[four][AdminLevel] == 4)
{
GetPlayerName(four,Nam,MAX_PLAYER_NAME);
format(str, sizeof(str), "| %s > Full Admin (Level 4)",Nam);
SCM(playerid,COLOR_YELLOW,str);
}
}
for(new five=0; five<MAX_PLAYERS; five++)
{
if(PlayerData[five][AdminLevel] == 5)
{
GetPlayerName(five,Nam,MAX_PLAYER_NAME);
format(str, sizeof(str), "| %s > Head Admin (Level 5)",Nam);
SCM(playerid,COLOR_YELLOW,str);
}
}