Bugged Commands
#1

PHP код:
CMD:admins(playeridparams[])
{
    new 
count;
    new 
admtext[128];
    new 
string[128],stringz[128];
    for( new 
0MAX_PLAYERSi++ )
    {
        if ( 
IsPlayerConnected) )
        {
            if( 
pData[i][Admin] >= )
            {
                switch( 
pData[i][Admin] )
                {
                    case 
10admtext "Server Owner";
                    case 
9admtext "Management";
                    case 
8admtext "xMs Special Admin";
                    case 
7admtext "head admin";
                    case 
6admtext "lead admin";
                    case 
5admtext "ubber admin";
                    case 
4admtext "Admin";
                    case 
3admtext "Admin";
                    case 
2admtext "Admin";
                    case 
1admtext "Admin";
                }
                
count++;
                
formatstringz 128,"Total Admins Online ");
                
formatstring128"%s (ID:%d) Level:%d (%s)\n\nTotal XtremeX admins %d"GetNameplayerid ), playerid pData[i][Admin] , admtextcount);
                
ShowPlayerDialogplayerid 190 DIALOG_STYLE_MSGBOX stringz string"Ok" "Close" );
            }
        }
        if (
count == 0)
        {
            
formatstringz 128 ,"No Admins Online ");
            
formatstring 128 ,"Currently NO admin online\nAdmins Watching from IRC\nand Admins Eyes always on you" );
            
ShowPlayerDialogplayerid,191,DIALOG_STYLE_MSGBOX stringz string "Ok" "Close" );
        }
        if(
count >= 0)
        {
            
ShowPlayerDialogplayerid 190 DIALOG_STYLE_MSGBOX stringz string"Ok" "Close" );
        }
    }
    return 
1;
}
IRCCMD:admins(botidchannel[], user[], host[], params[])
{
    new 
count;
    new 
admtext[128];
    new 
stringz[128];
    for( new 
0MAX_PLAYERSi++ )
    {
            if( 
pData[i][Admin] >= )
            {
                switch( 
pData[i][Admin] )
                {
                    case 
10admtext "Server Owner";
                    case 
9admtext "Management";
                    case 
8admtext "xMs Special Admin";
                    case 
7admtext "head admin";
                    case 
6admtext "lead admin";
                    case 
5admtext "ubber admin";
                    case 
4admtext "Admin";
                    case 
3admtext "Admin";
                    case 
2admtext "Admin";
                    case 
1admtext "Admin";
                }
                
count++;
                
format(stringz,sizeof(stringz),"0,10 Admin %s (ID: %d) [Level %d] (%s)",GetName(i),i,pData[i][Admin],admtext);
                
IRC_GroupSay(groupIDIRC_CHANNELstringz);
            }
       }
        if (
count == 0)
        {
        
IRC_GroupSay(groupIDIRC_CHANNEL"No admins are online!");
        }
        else
         {
        
format(stringzsizeof(stringz), "0,10 %d XtremeX Admin Online",count);
          
IRC_GroupSay(groupIDIRC_CHANNELstringz);
          new 
msg[134],msg1[1323];
            
format(msgsizeof(msg), "*Online Admins Player List Requested by %s ~ Total %d"usercount);
            
SendClientMessageToAll(0xFFB400FFmsg);
        
format(msg1sizeof(msg1), "0,10 *Online Admins List Requested by %s ~ Total %d",user,count);
          
IRC_GroupSay(groupIDIRC_CHANNELmsg1);
   }
    return 
1;

The ingame command problem is when i type /admins it show only 1 admin

and in irc

there is 2 admins and it say

Код:
<~xMs-01> 0,10 Admin  (ID: 1) [Level 9] (Management)
<~xMs-01> 0,10 *Online Admins List Requested by Martex ~ Total 2
Reply
#2

PHP код:
CMD:admins(playeridparams[]) 

    new 
count
    new 
admtext[128]; 
    new 
string[128],stringz[128]; 
    for( new 
0MAX_PLAYERSi++ ) 
    { 
        if ( 
IsPlayerConnected) ) 
        { 
            if( 
pData[i][Admin] >= 
            { 
                switch( 
pData[i][Admin] ) 
                { 
                    case 
10admtext "Server Owner"
                    case 
9admtext "Management"
                    case 
8admtext "xMs Special Admin"
                    case 
7admtext "head admin"
                    case 
6admtext "lead admin"
                    case 
5admtext "ubber admin"
                    case 
4admtext "Admin"
                    case 
3admtext "Admin"
                    case 
2admtext "Admin"
                    case 
1admtext "Admin"
                } 
                
count++; 
                
formatstringz 128,"Total Admins Online "); 
                
formatstring128"%s (ID:%d) Level:%d (%s)\n\nTotal XtremeX admins %d"GetName), pData[i][Admin] , admtextcount); 
                
ShowPlayerDialogplayerid 190 DIALOG_STYLE_MSGBOX stringz string"Ok" "Close" ); 
            } 
        } 
        if (
count == 0
        { 
            
formatstringz 128 ,"No Admins Online "); 
            
formatstring 128 ,"Currently NO admin online\nAdmins Watching from IRC\nand Admins Eyes always on you" ); 
            
ShowPlayerDialogplayerid,191,DIALOG_STYLE_MSGBOX stringz string "Ok" "Close" ); 
        } 
        if(
count >= 0
        { 
            
ShowPlayerDialogplayerid 190 DIALOG_STYLE_MSGBOX stringz string"Ok" "Close" ); 
        } 
    } 
    return 
1

Reply
#3

Quote:
Originally Posted by Yaa
Посмотреть сообщение
PHP код:
CMD:admins(playeridparams[]) 

    new 
count
    new 
admtext[128]; 
    new 
string[128],stringz[128]; 
    for( new 
0MAX_PLAYERSi++ ) 
    { 
        if ( 
IsPlayerConnected) ) 
        { 
            if( 
pData[i][Admin] >= 
            { 
                switch( 
pData[i][Admin] ) 
                { 
                    case 
10admtext "Server Owner"
                    case 
9admtext "Management"
                    case 
8admtext "xMs Special Admin"
                    case 
7admtext "head admin"
                    case 
6admtext "lead admin"
                    case 
5admtext "ubber admin"
                    case 
4admtext "Admin"
                    case 
3admtext "Admin"
                    case 
2admtext "Admin"
                    case 
1admtext "Admin"
                } 
                
count++; 
                
formatstringz 128,"Total Admins Online "); 
                
formatstring128"%s (ID:%d) Level:%d (%s)\n\nTotal XtremeX admins %d"GetName), pData[i][Admin] , admtextcount); 
                
ShowPlayerDialogplayerid 190 DIALOG_STYLE_MSGBOX stringz string"Ok" "Close" ); 
            } 
        } 
        if (
count == 0
        { 
            
formatstringz 128 ,"No Admins Online "); 
            
formatstring 128 ,"Currently NO admin online\nAdmins Watching from IRC\nand Admins Eyes always on you" ); 
            
ShowPlayerDialogplayerid,191,DIALOG_STYLE_MSGBOX stringz string "Ok" "Close" ); 
        } 
        if(
count >= 0
        { 
            
ShowPlayerDialogplayerid 190 DIALOG_STYLE_MSGBOX stringz string"Ok" "Close" ); 
        } 
    } 
    return 
1

Ok , and irc command? btw "Come irc iam searching for you from the morning "!
Reply
#4

PHP код:
IRCCMD:admins(botidchannel[], user[], host[], params[]) 

    new 
count
    new 
admtext[128]; 
    new 
stringz[128]; 
    for( new 
0MAX_PLAYERSi++ ) 
    { 
        if( 
pData[i][Admin] >= 
        { 
            switch( 
pData[i][Admin] ) 
            { 
                case 
10admtext "Server Owner"
                case 
9admtext "Management"
                case 
8admtext "xMs Special Admin"
                case 
7admtext "head admin"
                case 
6admtext "lead admin"
                case 
5admtext "ubber admin"
                case 
4admtext "Admin"
                case 
3admtext "Admin"
                case 
2admtext "Admin"
                case 
1admtext "Admin"
            } 
            
count++; 
            
format(stringzsizeof(stringz), "0,10 %d XtremeX Admin Online",count); 
            
IRC_GroupSay(groupIDIRC_CHANNELstringz); 
                
            
format(stringz,sizeof(stringz),"0,10 Admin %s (ID: %d) [Level %d] (%s)",GetName(i),i,pData[i][Admin],admtext); 
            
IRC_GroupSay(groupIDIRC_CHANNELstringz); 
                
            
format(stringzsizeof(stringz), "*Online Admins Player List Requested by %s ~ Total %d"usercount); 
            
SendClientMessageToAll(0xFFB400FFstringz); 
                
            
format(stringzsizeof(stringz), "0,10 *Online Admins List Requested by %s ~ Total %d",user,count); 
            
IRC_GroupSay(groupIDIRC_CHANNELstringz); 
        } 
    } 
    if (
count == 0
    { 
        
IRC_GroupSay(groupIDIRC_CHANNEL"No admins are online!"); 
    } 
    return 
1

Reply
#5

You actually don't need to have the 'stringz" variable formatted.
Reply
#6

It only shows one admin because in the loop that checks for the admins, you have it display your dialog.

When it hits the first, it simply shows that one dialog. The dialog should be shown out of the loop, rather than under count++...
Reply
#7

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
It only shows one admin because in the loop that checks for the admins, you have it display your dialog.

When it hits the first, it simply shows that one dialog. The dialog should be shown out of the loop, rather than under count++...
True, formatted messages and dialogs and etc.. should be outside the loop(s).
Reply
#8

Quote:
Originally Posted by saffierr
Посмотреть сообщение
True, formatted messages and dialogs and etc.. should be outside the loop(s).
Oh, Thanks
Reply
#9

And you are Martex ...........................
Reply
#10

Quote:
Originally Posted by PaRking
Посмотреть сообщение
And you are Martex ...........................
No he's Patrick!



But seriously, why'd you even post? What does that even mean?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)