SA-MP Forums Archive
COMMAND /admins in Dialog Please - 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: COMMAND /admins in Dialog Please (/showthread.php?tid=608084)



COMMAND /admins in Dialog Please - Twiix - 27.05.2016

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



Re: COMMAND /admins in Dialog Please - SyS - 27.05.2016

Put that string variable In the explanation arguement of showplayerdialog


Re: COMMAND /admins in Dialog Please - Twiix - 27.05.2016

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



Re: COMMAND /admins in Dialog Please - SyS - 27.05.2016

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


Re: COMMAND /admins in Dialog Please - Twiix - 27.05.2016

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



Re: COMMAND /admins in Dialog Please - luke49 - 27.05.2016

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;




Re: COMMAND /admins in Dialog Please - Sew_Sumi - 27.05.2016

This is not what this section is for...

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


Re: COMMAND /admins in Dialog Please - Twiix - 27.05.2016

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.


Re: COMMAND /admins in Dialog Please - jlalt - 27.05.2016

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;




Re: COMMAND /admins in Dialog Please - Twiix - 27.05.2016

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.