Need help regarding /admins and few other stuffs. [rep]
#2

you can try

PHP код:
COMMAND:admins(playeridparams[])
{
    new 
staffcountstring[128];
    
SendClientMessage(playeridWHITE"-------------------------");
    
SendClientMessage(playeridRED"Online Admins:");
    foreach(new 
Player)
    {
        if(!(
<= PlayerStat[i][AdminLevel] <= 3)) continue;
        
format(stringsizeof(string), "%s%i) %s (Level %i)"string, ++staffcountGetOOCName(i), PlayerStat[i][AdminLevel]);
    }
    if(!
staffcount)
    {
        
SendClientMessage(playeridRED"No admins online");
        return 
1;
    }
    else { 
SendClientMessage(playeridREDstring); }
    
SendClientMessage(playeridWHITE"-------------------------");
    return 
true;

I'm using foreach for the loop, if you don't want it use

PHP код:
COMMAND:admins(playeridparams[])
{
    new 
staffcountstring[128];
    
SendClientMessage(playeridWHITE"-------------------------");
    
SendClientMessage(playeridRED"Online Admins:");
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(!(
<= PlayerStat[i][AdminLevel] <= 3)) continue;
            
format(stringsizeof(string), "%s%i) %s (Level %i)"string, ++staffcountGetOOCName(i), PlayerStat[i][AdminLevel]);
        }
    }
    if(!
staffcount)
    {
        
SendClientMessage(playeridRED"No admins online");
        return 
1;
    }
    else { 
SendClientMessage(playeridREDstring); }
    
SendClientMessage(playeridWHITE"-------------------------");
    return 
true;

I don't know your maximum admin level so change the <= 3 to match it.
Reply


Messages In This Thread
Need help regarding /admins and few other stuffs. [rep] - by [UE]Milan - 01.11.2015, 07:30
Re: Need help regarding /admins and few other stuffs. [rep] - by itsCody - 01.11.2015, 07:40
Re: Need help regarding /admins and few other stuffs. [rep] - by jlalt - 01.11.2015, 08:04

Forum Jump:


Users browsing this thread: 1 Guest(s)