Please help?
#1

PHP код:
CMD:admins(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        new 
count 0string[196], sendername[MAX_PLAYER_NAME];
        
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------");
         foreach(
Playeri)
        {
            if(
IsPlayerConnected(i))
            {
                if(
playerVariables[i][pAdminLevel] == 1)
                {
                           
format(stringsizeof(string), "(%d) %s - admin level 1"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 2)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 3)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 4)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 5)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 6)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 7)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
            }
         }
27320    if(count == 0)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
27327        else if(count == 1)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
27334        else if (count >= 2)
        {
27336            format(stringsizeof(string), "* There are now %d admins online."count);
            
SCM(playeridCOLOR_IN2string);
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
        }
    }
    return 
1;

I get this
PHP код:
C:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27320) : error 017undefined symbol "count"
C:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27327) : error 017undefined symbol "count"
C:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27334) : error 017undefined symbol "count"
C:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27336) : error 017undefined symbol "string"
C:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27336) : error 017undefined symbol "string"
C:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27336) : error 029invalid expressionassumed zero
C
:\Users\SebyIonut\Desktop\TEST GM\gamemodes\buggedv330.pwn(27336) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase 
Reply
#2

try this

PHP код:
CMD:admins(playeridparams[]) 

    if(
IsPlayerConnected(playerid)) 
    { 
        new 
count 0string[254], sendername[MAX_PLAYER_NAME]; 
        
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------"); 
         foreach(
Playeri
        { 
            if(
IsPlayerConnected(i)) 
            { 
                if(
playerVariables[i][pAdminLevel] == 1
                { 
                           
format(stringsizeof(string), "(%d) %s - admin level 1"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 2
                { 
                    
GetPlayerName(isendernamesizeof(sendername)); 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 2"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 2"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 3
                { 
                    
GetPlayerName(isendernamesizeof(sendername)); 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 3"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 3"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 4
                { 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 4"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 4"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 5
                { 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 5"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 5"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 6
                { 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 6"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 6"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 7
                { 
                    
GetPlayerName(isendernamesizeof(sendername)); 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - Founder"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - Founder"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
            } 
         } 
       if(
count == 0
          { 
            
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
        } 
       else if(
count == 1
          { 
            
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
        } 
        else if (
count >= 2
        { 
           
format(stringsizeof(string), "* There are now %d admins online."count); 
            
SCM(playeridCOLOR_IN2string); 
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------"); 
            
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); 
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------"); 
        } 
    } 
    return 
1

Reply
#3

Not work man.
Can you create another cmd for check admins online and admin level?
i tryed this, but this show me all admins with level 6, not their real lvl..
PHP код:
CMD:admins(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        new 
count 0string[196], sendername[MAX_PLAYER_NAME];
        
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------");
         foreach(
Playeri)
        {
            if(
IsPlayerConnected(i))
            {
                if(
playerVariables[i][pAdminLevel] == 1)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 1"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 1"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 2)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 3)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 4)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 5)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 6)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 7)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
            }
         }
        if(
count == 0)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
        else if(
count == 1)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
        else if (
count >= 2)
        {
            
format(stringsizeof(string), "* There are now %d admins online."count);
            
SCM(playeridCOLOR_IN2string);
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
        }
    }
    return 
1;

Reply
#4

Код:
CMD:admins(playerid, params[])
{
	if (playerVariables[i][pScore] >= 750)
	{
	        new count = 1, string[828], sendername[MAX_PLAYER_NAME];

		for(new i = 0; i < MAX_PLAYERS; i++)
		{
                        GetPlayerName(i, sendername, sizeof(sendername));
			if(IsPlayerConnected(i) && playerVariables[i][pAdminLevel] >= 1 && playerVariables[i][pAdminLevel]  < 8)
			{
				// If admin level is higher than 1, here it goes...
				format(string, sizeof(string), "%s%s(%i) - Level: %i\n", string, playerVariables[i][pName] , i, playerVariables[i][pAdminLevel]);
				count ++;
			}
		}

		if(count != 1)
		{
			// Show admins that are presently online, along with their rank
			ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", "");
		}
		else
		{
			// No admins online - Either this or nothing, either way the user will know admins are offline...
			ShowPlayerDialog(playerid, 200, DIALOG_STYLE_MSGBOX, "Online Admins", "There are no administrators present.", "OK", "");
		}
	}
	else
	{
	    SendClientMessage(playerid, COLOR_WHITE, "{E81919}[ERROR] {FFFFFF}You must have at least 750 score to view the admin list.");
	}

	return 1;
}
this mine , maybe you can edit it
Reply
#5

PHP код:
CMD:admins(playeridparams[])
{
    new 
string[1000];
    new 
count 0;
    if(
IsPlayerConnected(playerid))
    {
        
sendername[MAX_PLAYER_NAME];
        
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------");
         foreach(
Playeri)
        {
            if(
IsPlayerConnected(i))
            {
                if(
playerVariables[i][pAdminLevel] == 1)
                {
                           
format(stringsizeof(string), "(%d) %s - admin level 1"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 2)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 3)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 4)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 5)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 6)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[playerid][pAdminLevel] == 7)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
            }
         }
27320    if(count == 0)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
27327        else if(count == 1)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
27334        else if (count >= 2)
        {
27336       format(stringsizeof(string), "* There are now %d admins online."count);
            
SCM(playeridCOLOR_IN2string);
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
        }
    }
    return 
1;

Try This,, Some furture Please reply !
If Succes +rep for me
Reply
#6

Quote:
Originally Posted by N0FeaR
Посмотреть сообщение
try this

PHP код:
CMD:admins(playeridparams[]) 

    if(
IsPlayerConnected(playerid)) 
    { 
        new 
count 0string[254], sendername[MAX_PLAYER_NAME]; 
        
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------"); 
         foreach(
Playeri
        { 
            if(
IsPlayerConnected(i)) 
            { 
                if(
playerVariables[i][pAdminLevel] == 1
                { 
                           
format(stringsizeof(string), "(%d) %s - admin level 1"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 2
                { 
                    
GetPlayerName(isendernamesizeof(sendername)); 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 2"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 2"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 3
                { 
                    
GetPlayerName(isendernamesizeof(sendername)); 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 3"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 3"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 4
                { 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 4"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 4"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 5
                { 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 5"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 5"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 6
                { 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - admin level 6"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - admin level 6"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
                if(
playerVariables[playerid][pAdminLevel] == 7
                { 
                    
GetPlayerName(isendernamesizeof(sendername)); 
                    if(
AdminDuty[i] == 0
                    { 
                        
format(stringsizeof(string), "(%d) %s - Founder"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                    else 
                    { 
                           
format(stringsizeof(string), "(%d) %s - Founder"isendername); 
                        
SendClientMessage(playeridCOLOR_WHITEstring); 
                        
count++; 
                    } 
                } 
            } 
         } 
       if(
count == 0
          { 
            
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
        } 
       else if(
count == 1
          { 
            
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); 
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------"); 
        } 
        else if (
count >= 2
        { 
           
format(stringsizeof(string), "* There are now %d admins online."count); 
            
SCM(playeridCOLOR_IN2string); 
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------"); 
            
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n."); 
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------"); 
        } 
    } 
    return 
1

PHP код:

                
if(playerVariables[playerid][pAdminLevel] == 2
You checking if playerid == 2..7 not i change player id to i
Should be:
PHP код:
                if(playerVariables[i][pAdminLevel] == 2
full code:
PHP код:
CMD:admins(playeridparams[])
{
    if(
IsPlayerConnected(playerid))
    {
        new 
count 0string[254], sendername[MAX_PLAYER_NAME];
        
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------");
         foreach(
Playeri)
        {
            if(
IsPlayerConnected(i))
            {
                if(
playerVariables[i][pAdminLevel] == 1)
                {
                           
format(stringsizeof(string), "(%d) %s - admin level 1"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[i][pAdminLevel] == 2)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 2"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[i][pAdminLevel] == 3)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 3"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[i][pAdminLevel] == 4)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[i][pAdminLevel] == 5)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[i][pAdminLevel] == 6)
                {
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
                if(
playerVariables[i][pAdminLevel] == 7)
                {
                    
GetPlayerName(isendernamesizeof(sendername));
                    if(
AdminDuty[i] == 0)
                    {
                        
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                    else
                    {
                           
format(stringsizeof(string), "(%d) %s - Founder"isendername);
                        
SendClientMessage(playeridCOLOR_WHITEstring);
                        
count++;
                    }
                }
            }
         }
       if(
count == 0)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
       else if(
count == 1)
          {
            
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
        }
        else if (
count >= 2)
        {
           
format(stringsizeof(string), "* There are now %d admins online."count);
            
SCM(playeridCOLOR_IN2string);
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
            
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
            
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
        }
    }
    return 
1;

Reply
#7

Still not work...other solutions please?
Reply
#8

Hello!

Take this version, it should work:
PHP код:
CMD:admins(playerid,params[])
{
    new 
count,string[145],sendername[MAX_PLAYER_NAME];
    
SendClientMessage(playeridCOLOR_TEAL"----Admins Online----------------------------------------------------");
    foreach(
Player,i)
    {
        if(
IsPlayerConnected(i))
        {
            if(
playerVariables[i][pAdminLevel] == 1)
            {
                
format(string,sizeof string,"(%d) %s - admin level 1",i,sendername);
                
SendClientMessage(playerid,COLOR_WHITE,string);
                
count ++;
            }
            else if(
playerVariables[i][pAdminLevel] == 2)
            {
                
format(string,sizeof string,"(%d) %s - admin level 2",i,sendername);
                
SendClientMessage(playerid,COLOR_WHITE,string);
                
count ++;
            }
            else if(
playerVariables[i][pAdminLevel] == 3)
            {
                
format(string,sizeof string,"(%d) %s - admin level 3",i,sendername);
                
SendClientMessage(playerid,COLOR_WHITE,string);
                
count ++;
            }
            else if(
playerVariables[i][pAdminLevel] == 4)
            {
                
format(stringsizeof(string), "(%d) %s - admin level 4"isendername);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
                
count++;
            }
            else if(
playerVariables[i][pAdminLevel] == 5)
            {
                
format(stringsizeof(string), "(%d) %s - admin level 5"isendername);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
                
count++;
            }
            else if(
playerVariables[i][pAdminLevel] == 6)
            {
                
format(stringsizeof(string), "(%d) %s - admin level 6"isendername);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
                  
count++;
            }
            else if(
playerVariables[i][pAdminLevel] == 7)
            {
                
format(stringsizeof(string), "(%d) %s - admin level 7"isendername);
                  
SendClientMessage(playeridCOLOR_WHITEstring);
                  
count++;
            }
        }
    }
    if(
count == 0)
    {
        
SendClientMessage(playeridCOLOR_IN2,"* No admins online on the server.");
         
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
          
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
           
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
    }
    else if(
count == 1)
    {
        
SendClientMessage(playeridCOLOR_IN2,"* Now are 1 admin online.");
         
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
          
SendClientMessage(playeridCOLOR_WHITE,"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
           
SendClientMessage(playeridCOLOR_TEAL,"----------------------------------------------------------------------------");
    }
    else if(
count >= 2)
    {
        
format(stringsizeof(string), "* There are now %d admins online."count);
         
SCM(playeridCOLOR_IN2string);
          
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
           
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
           
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
    }
    return 
1;

Reply
#9

Thanks it works.
Reply
#10

Better do something like this

PHP код:
stock GetAdminLevel(playerid) {
    new 
Rank[24];
    switch(
playerVariables[playerid][pAdminLevel]) {
        case 
1"Level 1"//change to what admin rank u want to call it
        
case 2"Level 2";
        case 
3"Level 3";
        case 
4"Level 4";
        case 
5"Level 5";
        case 
6"Level 6";
        case 
7"Level 7";
    }
    return 
Rank;
}
CMD:admins(playerid,params[])
{
    new 
string[128],sendername[MAX_PLAYER_NAME],count;
    foreach(
Player,i) {
        if(
IsPlayerConnected(i)) {
            
format(string,sizeof(string),"Name: %s -- Rank: %s",GetAdminLevel(i),sendername);
            
count++;
            
SendClientMessage(playerid,COLOR_WHITE,string);
        }
    }
    if(
count == 0) return SendClientMessage(playerid,COLOR_RED,"There are no admins online");
    else if(
count >= 1) {
        
format(string,sizeof(string),"There are %i admins online",count);
        
SendClientMessage(playerid,COLOR_RED,string);
        
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
          
SendClientMessage(playeridCOLOR_WHITE"Daca ai vreo problema, poti folosi /report. Pentru intrebari legate de joc poti folosi /n.");
        
SendClientMessage(playeridCOLOR_TEAL"----------------------------------------------------------------------------");
    }
    return 
true;

UNTESTED
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)