i want this in box please help me !!!!!!
#1

Код:
COMMAND:admins(playerid,params[])
{
	new count = 0;
	new string[128];
	SendClientMessage(playerid,COLOR_RED,"");
	SendClientMessage(playerid,COLOR_GREEN,"________________|ONLINE ADMINS|________________");
	SendClientMessage(playerid,COLOR_RED,"");
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
		if(IsPlayerConnected(i))
		{
			if(PlayerInfo[i][pAdmin] > 0)
			{
				if(PlayerInfo[i][pAdmin] == 1)
				{
					AdminRank = "Moderator";
				}
				else if(PlayerInfo[i][pAdmin] == 2)
				{
					AdminRank = "General Administrator";
				}
				else if(PlayerInfo[i][pAdmin] == 3)
				{
					AdminRank = "Senior Administrator";
				}
				else if(PlayerInfo[i][pAdmin] == 4)
				{
					AdminRank = "Server Owner";
				}
				new Name[MAX_PLAYER_NAME];
				GetPlayerName(i,Name,sizeof(Name));
				format(string, sizeof(string), "Level: %d | Name: %s (ID:%i) | Rank: %s ", PlayerInfo[i][pAdmin], Name,i,AdminRank);
				SendClientMessage(playerid,COLOR_CYAN,string);
				count++;
			}
		}
	}
	if(count == 0)
	SendClientMessage(playerid,COLOR_RED,"No Admins online!");
	SendClientMessage(playerid,COLOR_GREEN,"_________________________________________________");
	return 1;
}
i want /admins in Box please help me
Reply
#2

Please help me guys please please please
Reply
#3

PHP код:
COMMAND:admins(playerid,params[])
{
    new 
count 0;
    new 
string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PlayerInfo[i][pAdmin] > 0)
            {
                if(
PlayerInfo[i][pAdmin] == 1)
                {
                    
AdminRank "Moderator";
                }
                else if(
PlayerInfo[i][pAdmin] == 2)
                {
                    
AdminRank "General Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 3)
                {
                    
AdminRank "Senior Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 4)
                {
                    
AdminRank "Server Owner";
                }
                new 
Name[MAX_PLAYER_NAME];
                
GetPlayerName(i,Name,sizeof(Name));
                
format(stringsizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s "string,PlayerInfo[i][pAdmin], Name,i,AdminRank);
                
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__"string"Close""");
                
count++;
            }
        }
    }
    if(
count == 0)
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__""Theres no admins online.""Close""");
    return 
1;

Reply
#4

Quote:
Originally Posted by Jelly23
Посмотреть сообщение
PHP код:
COMMAND:admins(playerid,params[])
{
    new 
count 0;
    new 
string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PlayerInfo[i][pAdmin] > 0)
            {
                if(
PlayerInfo[i][pAdmin] == 1)
                {
                    
AdminRank "Moderator";
                }
                else if(
PlayerInfo[i][pAdmin] == 2)
                {
                    
AdminRank "General Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 3)
                {
                    
AdminRank "Senior Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 4)
                {
                    
AdminRank "Server Owner";
                }
                new 
Name[MAX_PLAYER_NAME];
                
GetPlayerName(i,Name,sizeof(Name));
                
format(stringsizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s "string,PlayerInfo[i][pAdmin], Name,i,AdminRank);
                
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__"string"Close""");
                
count++;
            }
        }
    }
    if(
count == 0)
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__""Theres no admins online.""Close""");
    return 
1;

Thx bro
Reply
#5

Before posting such trash again, read the rules...
Reply
#6

Quote:
Originally Posted by Jelly23
Посмотреть сообщение
PHP код:
COMMAND:admins(playerid,params[])
{
    new 
count 0;
    new 
string[128];
    for(new 
0MAX_PLAYERSi++)
    {
        if(
IsPlayerConnected(i))
        {
            if(
PlayerInfo[i][pAdmin] > 0)
            {
                if(
PlayerInfo[i][pAdmin] == 1)
                {
                    
AdminRank "Moderator";
                }
                else if(
PlayerInfo[i][pAdmin] == 2)
                {
                    
AdminRank "General Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 3)
                {
                    
AdminRank "Senior Administrator";
                }
                else if(
PlayerInfo[i][pAdmin] == 4)
                {
                    
AdminRank "Server Owner";
                }
                new 
Name[MAX_PLAYER_NAME];
                
GetPlayerName(i,Name,sizeof(Name));
                
format(stringsizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s "string,PlayerInfo[i][pAdmin], Name,i,AdminRank);
                
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__"string"Close""");
                
count++;
            }
        }
    }
    if(
count == 0)
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__""Theres no admins online.""Close""");
    return 
1;

this would not work, you should add the ShowPlayerDialog outside of the loop in order to smoothly make it work
like this

PHP код:

COMMAND
:admins(playerid,params[]) 

    new 
count 0
    new 
string[128]; 
    for(new 
0MAX_PLAYERSi++) 
    { 
        if(
IsPlayerConnected(i)) 
        { 
            if(
PlayerInfo[i][pAdmin] > 0
            { 
                if(
PlayerInfo[i][pAdmin] == 1
                { 
                    
AdminRank "Moderator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 2
                { 
                    
AdminRank "General Administrator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 3
                { 
                    
AdminRank "Senior Administrator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 4
                { 
                    
AdminRank "Server Owner"
                } 
                new 
Name[MAX_PLAYER_NAME]; 
                
GetPlayerName(i,Name,sizeof(Name)); 
                
format(stringsizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s \n %s"string,PlayerInfo[i][pAdmin], Name,i,AdminRankstring); 
                
count++; 
            } 
        } 
    } 
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__"string"Close"""); 
    if(
count == 0
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__""Theres no admins online.""Close"""); 
    return 
1

Reply
#7

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
this would not work, you should add the ShowPlayerDialog outside of the loop in order to smoothly make it work
like this

PHP код:

COMMAND
:admins(playerid,params[]) 

    new 
count 0
    new 
string[128]; 
    for(new 
0MAX_PLAYERSi++) 
    { 
        if(
IsPlayerConnected(i)) 
        { 
            if(
PlayerInfo[i][pAdmin] > 0
            { 
                if(
PlayerInfo[i][pAdmin] == 1
                { 
                    
AdminRank "Moderator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 2
                { 
                    
AdminRank "General Administrator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 3
                { 
                    
AdminRank "Senior Administrator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 4
                { 
                    
AdminRank "Server Owner"
                } 
                new 
Name[MAX_PLAYER_NAME]; 
                
GetPlayerName(i,Name,sizeof(Name)); 
                
format(stringsizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s \n %s"string,PlayerInfo[i][pAdmin], Name,i,AdminRankstring); 
                
count++; 
            } 
        } 
    } 
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__"string"Close"""); 
    if(
count == 0
    
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__""Theres no admins online.""Close"""); 
    return 
1

I do know that, just didn't pay attention. And speaking of which, you just made a mistake yourself. Correct way:

PHP код:
COMMAND:admins(playerid,params[]) 

    new 
count 0
    new 
string[128]; 
    for(new 
0MAX_PLAYERSi++) 
    { 
        if(
IsPlayerConnected(i)) 
        { 
            if(
PlayerInfo[i][pAdmin] > 0
            { 
                if(
PlayerInfo[i][pAdmin] == 1
                { 
                    
AdminRank "Moderator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 2
                { 
                    
AdminRank "General Administrator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 3
                { 
                    
AdminRank "Senior Administrator"
                } 
                else if(
PlayerInfo[i][pAdmin] == 4
                { 
                    
AdminRank "Server Owner"
                } 
                new 
Name[MAX_PLAYER_NAME]; 
                
GetPlayerName(i,Name,sizeof(Name)); 
                
format(stringsizeof(string), "%sLevel: %d | Name: %s (ID:%i) | Rank: %s \n %s"string,PlayerInfo[i][pAdmin], Name,i,AdminRankstring); 
                
count++; 
            } 
        } 
    }  
    if(
count == 0
    {
         
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__""Theres no admins online.""Close"""); 
    }
    else
    {
         
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"{00FF00}__|ONLINE ADMINS|__"string"Close""");
    }
    return 
1

Reply
#8

Yah, guess the human eye isn't always that sharp,
tnx anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)