[ + rep ] guys i need help with this command
#4

*Sigh*
I still don't know why you even did it in such a complicated way? Why the hell you switchin' around? Make it easier, look how mine's done:

PHP код:
COMMAND:admins(playerid,params[])
{
    new 
count 0;
    new 
string[128];
    
SendClientMessage(playerid,COLOR_RED,"");
    
SendClientMessage(playerid,TEAM_GROVE_COLOR,"______________________|ONLINE ADMINS|______________________");
    
SendClientMessage(playerid,COLOR_RED,"");
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PlayerInfo[i][pAdmin] > 0)
            {
                if(
PlayerInfo[i][pAdmin] == 1)
                {
                    
AdminRank "Helper";
                }
                else if(
PlayerInfo[i][pAdmin] == 2)
                {
                    
AdminRank "Basic Moderator";
                }
                else if(
PlayerInfo[i][pAdmin] == 3)
                {
                    
AdminRank "Professional Moderator";
                }
                else if(
PlayerInfo[i][pAdmin] == 4)
                {
                    
AdminRank "Master Moderator";
                }
                else if(
PlayerInfo[i][pAdmin] == 5)
                {
                    
AdminRank "Basic Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 6)
                {
                    
AdminRank "Advanced Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 7)
                {
                    
AdminRank "Professional Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 8)
                {
                    
AdminRank "Master Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 9)
                {
                    
AdminRank "RCON Helper";
                }
                else if(
PlayerInfo[i][pAdmin] >= 10)
                {
                    
AdminRank "RCON Master Administrator";
                }
                new 
aName[MAX_PLAYER_NAME];
                
GetPlayerName(i,aName,sizeof(aName));
                
format(stringsizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s "PlayerInfo[i][pAdmin], aName,i,AdminRank);
                
SendClientMessage(playerid,COLOR_ORANGE,string);
                
count++;
            }
        }
    }
    if(
count == 0)
    
SendClientMessage(playerid,COLOR_RED,"No Admins online!");
    
SendClientMessage(playerid,TEAM_GROVE_COLOR,"____________________________________________________________");
    return 
1;

NO, don't copy-paste everything now, and don't steal! (^^)
What I meant was, why don't you just take the info from the enum? It's easier, and also the "else if"-statement reduces your work!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)