Help me for admins cmd
#1

Код:
CMD:admins(playerid, params[])
{
	 if(AccountInfo[playerid][pAdmin] > 0)
	{
	    new adminstring[128];
	    if(IsPlayerConnected(playerid))
	    {
	        for (new i = 0; i < MAX_PLAYERS; i++)
	        {
	            if(IsPlayerConnected(i))
	            {
	                	 if(AccountInfo[playerid][pAdmin] > 0)
	                {
	                    format(adminstring, sizeof(adminstring),"%s%s: %s\n", adminstring, GetAdminName(i), PlayerName(i));
	                }
	            }
	        }
	        ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"Online admins",adminstring,"Close","");
		}
 		else return SendClientMessage(playerid,-1,"*"COL_LGREEN" No admins online");
Reply
#2

Can you post the ERRORS/Warrings?
Reply
#3

Try
PHP код:
CMD:admins(playeridparams[])
{
    new 
infDialogo[256], fTexto[126];
    if(
AccountInfo[playerid][pAdmin] > 0)
    {
        for(new 
0GetPlayerPoolSize(); i++)
        {
            if(
IsPlayerConnected(i))
            {
                if(
AccountInfo[i][pAdmin] > 0)
                {
                    
format(fTextosizeof(fTexto), "%s: %s\n"GetAdminName(i), PlayerName(i));
                    
strcat(infDialogofTexto);
                }
            }
            if(
== GetPlayerPoolSize()-1)
            {
                    if(
strlen(fInfDialogo) == 0)
                        return 
SendClientMessage(playerid, -1"*"COL_LGREEN" No admins online");
            }
        }
        
ShowPlayerDialog(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"Online admins",infDialogo,"Close","");
    }
    return 
true;

Reply
#4

bump bump
Reply
#5

What is your problem? Do you get errors? Is some part of the function not doing what it should do?
Reply
#6

Maybe try this code:
PHP код:
CMD:admins(playeridparams[])
{
    new 
countstring[144];
    for(new 
0GetPlayerPoolSize(); i++)
    {
        if(
AccountInfo[playerid][pAdmin] > 0)
        {
            
format(stringsizeof(string), "%s: %s\n"GetAdminName(i), PlayerName(i));
            
count++;
        }
    }
    if(!
count)
        return 
SendClientMessage(playerid, -1"*"COLOR_LGREEN" No admins online");
    
ShowPlayerDialog(playeridDIALOG_ADMINSDIALOG_STYLE_MSGBOX"Online admins"string"Close""");
        return 
1;

Reply
#7

*Rubs magic ball* Please find me what is wrong with TOS's command

ERROR 102: You are not a wizard harry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)