i want this in box please help me !!!!!!
#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


Messages In This Thread
i want this in box please help me !!!!!! - by Sumit4 - 08.11.2016, 12:26
Re: i want this in box please help me !!!!!! - by Sumit4 - 08.11.2016, 14:18
Re: i want this in box please help me !!!!!! - by Jelly23 - 08.11.2016, 14:21
Re: i want this in box please help me !!!!!! - by Sumit4 - 08.11.2016, 16:46
Re: i want this in box please help me !!!!!! - by BiosMarcel - 08.11.2016, 19:02
Re: i want this in box please help me !!!!!! - by Eoussama - 08.11.2016, 19:18
Re: i want this in box please help me !!!!!! - by Jelly23 - 08.11.2016, 19:20
Re: i want this in box please help me !!!!!! - by Eoussama - 08.11.2016, 20:20

Forum Jump:


Users browsing this thread: 1 Guest(s)