SA-MP Forums Archive
i want this in box please help me !!!!!! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: i want this in box please help me !!!!!! (/showthread.php?tid=621246)



i want this in box please help me !!!!!! - Sumit4 - 08.11.2016

Код:
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


Re: i want this in box please help me !!!!!! - Sumit4 - 08.11.2016

Please help me guys please please please


Re: i want this in box please help me !!!!!! - Jelly23 - 08.11.2016

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;




Re: i want this in box please help me !!!!!! - Sumit4 - 08.11.2016

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


Re: i want this in box please help me !!!!!! - BiosMarcel - 08.11.2016

Before posting such trash again, read the rules...


Re: i want this in box please help me !!!!!! - Eoussama - 08.11.2016

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




Re: i want this in box please help me !!!!!! - Jelly23 - 08.11.2016

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




Re: i want this in box please help me !!!!!! - Eoussama - 08.11.2016

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