COMMAND /admins in Dialog Please
#1

Hello, I'm using JakAdmin and Command /admins is SendClientMessage so i want it in dialog.
Who can help me?

This is the command:


Код:
CMD:admins(playerid, params[])
{
	new string[128], count = 0;
	
	SendClientMessage(playerid, -1, "** "orange"Online Administrators "white"**");
	foreach(new i : Player)
	{
	    if(User[i][accountLogged] == 1)
	    {
	        if(User[i][accountAdmin] >= 1)
	        {
	            format(string, sizeof(string), "(%d) %s - Level %d Admin", i, pName(i), User[i][accountAdmin]);
	            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
	            count++;
	        }
	    }
	}
	if(count == 0) return SendClientMessage(playerid, -1, "No administrators online at the server.");
	return 1;
}
I tried but it's shows the last admin logged in
Reply
#2

Put that string variable In the explanation arguement of showplayerdialog
Reply
#3

You means this?
Код:
ShowPlayerDialog(playerid, 0 , DIALOG_STYLE_MSGBOX, "Online Administrators", string, "OK", "");
Reply
#4

Yeah but as u r using a loop that not going to give the desired output using strcat is one way
Reply
#5

Maybe, i can't understand you, can you post the command after you fix? And Thank You!
Reply
#6

Try this one:
PHP код:
CMD:admins(playeridparams[])
{
    new
        
string2 200 ],
        
string  200 ],
        
admincount 0;
    foreach(new 
Player)
    {
        if(
User[i][accountLogged] == 1)
        {
            if(
User[i][accountAdmin] >= 1)
            {
                
admincount++;
                
format(string2sizeof(string2), "(%d). %s - [%d level]"admincountpName(i), User[i][accountAdmin]);
                
strcat(stringstring2);
            }
        }
    }
    
    if(
admincount == 0) return SendClientMessage(playerid, -1"There are no Administrators online at the moment.");
    return 
1;

Reply
#7

This is not what this section is for...

There is a "Looking for Scripters/Helpers" thread for a reason.
Reply
#8

Quote:
Originally Posted by luke49
Посмотреть сообщение
Try this one:
PHP код:
CMD:admins(playeridparams[])
{
    new
        
string2 200 ],
        
string  200 ],
        
admincount 0;
    foreach(new 
Player)
    {
        if(
User[i][accountLogged] == 1)
        {
            if(
User[i][accountAdmin] >= 1)
            {
                
admincount++;
                
format(string2sizeof(string2), "(%d). %s - [%d level]"admincountpName(i), User[i][accountAdmin]);
                
strcat(stringstring2);
            }
        }
    }
    
    if(
admincount == 0) return SendClientMessage(playerid, -1"There are no Administrators online at the moment.");
    return 
1;

Not working.
Reply
#9

Here you go ;_;

PHP код:
CMD:admins(playeridparams[])
{
    new 
Handle[560],string[80], count 0;
    
SendClientMessage(playerid, -1"** "orange"Online Administrators "white"**");
    foreach(new 
Player)
    {
        if(
User[i][accountLogged] == 1)
        {
            if(
User[i][accountAdmin] >= 1)
            {
                
format(stringsizeof(string), "(%d) %s - Level %d Admin"ipName(i), User[i][accountAdmin]);
                
strcat(Handlestring);
                
//SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                
count++;
            }
        }
    }
    if(
count == 0) {
        
SendClientMessage(playerid, -1"No administrators online at the server.");
    }
    else {
        
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"Online Administrators"Handle"Close""");
    }
    return 
1;

Reply
#10

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Here you go ;_;

PHP код:
CMD:admins(playeridparams[])
{
    new 
Handle[560],string[80], count 0;
    
SendClientMessage(playerid, -1"** "orange"Online Administrators "white"**");
    foreach(new 
Player)
    {
        if(
User[i][accountLogged] == 1)
        {
            if(
User[i][accountAdmin] >= 1)
            {
                
format(stringsizeof(string), "(%d) %s - Level %d Admin"ipName(i), User[i][accountAdmin]);
                
strcat(Handlestring);
                
//SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                
count++;
            }
        }
    }
    if(
count == 0) {
        
SendClientMessage(playerid, -1"No administrators online at the server.");
    }
    else {
        
ShowPlayerDialog(playerid0DIALOG_STYLE_MSGBOX"Online Administrators"Handle"Close""");
    }
    return 
1;

Thank You, It's really working.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)