CMD:admins(playerid, params[])
{
new count;
new admtext[128];
new string[128],stringz[128];
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerConnected( i ) )
{
if( pData[i][Admin] >= 1 )
{
switch( pData[i][Admin] )
{
case 10: admtext = "Server Owner";
case 9: admtext = "Management";
case 8: admtext = "xMs Special Admin";
case 7: admtext = "head admin";
case 6: admtext = "lead admin";
case 5: admtext = "ubber admin";
case 4: admtext = "Admin";
case 3: admtext = "Admin";
case 2: admtext = "Admin";
case 1: admtext = "Admin";
}
count++;
format( stringz , 128,"Total Admins Online ");
format( string, 128, "%s (ID:%d) Level:%d (%s)\n\nTotal XtremeX admins %d", GetName( playerid ), playerid , pData[i][Admin] , admtext, count);
ShowPlayerDialog( playerid , 190 , DIALOG_STYLE_MSGBOX , stringz , string, "Ok" , "Close" );
}
}
if (count == 0)
{
format( stringz , 128 ,"No Admins Online ");
format( string , 128 ,"Currently NO admin online\nAdmins Watching from IRC\nand Admins Eyes always on you" );
ShowPlayerDialog( playerid,191,DIALOG_STYLE_MSGBOX , stringz , string , "Ok" , "Close" );
}
if(count >= 0)
{
ShowPlayerDialog( playerid , 190 , DIALOG_STYLE_MSGBOX , stringz , string, "Ok" , "Close" );
}
}
return 1;
}
IRCCMD:admins(botid, channel[], user[], host[], params[])
{
new count;
new admtext[128];
new stringz[128];
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( pData[i][Admin] >= 3 )
{
switch( pData[i][Admin] )
{
case 10: admtext = "Server Owner";
case 9: admtext = "Management";
case 8: admtext = "xMs Special Admin";
case 7: admtext = "head admin";
case 6: admtext = "lead admin";
case 5: admtext = "ubber admin";
case 4: admtext = "Admin";
case 3: admtext = "Admin";
case 2: admtext = "Admin";
case 1: admtext = "Admin";
}
count++;
format(stringz,sizeof(stringz),"0,10 Admin %s (ID: %d) [Level %d] (%s)",GetName(i),i,pData[i][Admin],admtext);
IRC_GroupSay(groupID, IRC_CHANNEL, stringz);
}
}
if (count == 0)
{
IRC_GroupSay(groupID, IRC_CHANNEL, "No admins are online!");
}
else
{
format(stringz, sizeof(stringz), "0,10 %d XtremeX Admin Online",count);
IRC_GroupSay(groupID, IRC_CHANNEL, stringz);
new msg[134],msg1[1323];
format(msg, sizeof(msg), "*Online Admins Player List Requested by %s ~ Total %d", user, count);
SendClientMessageToAll(0xFFB400FF, msg);
format(msg1, sizeof(msg1), "0,10 *Online Admins List Requested by %s ~ Total %d",user,count);
IRC_GroupSay(groupID, IRC_CHANNEL, msg1);
}
return 1;
}
<~xMs-01> 0,10 Admin (ID: 1) [Level 9] (Management) <~xMs-01> 0,10 *Online Admins List Requested by Martex ~ Total 2
CMD:admins(playerid, params[])
{
new count;
new admtext[128];
new string[128],stringz[128];
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerConnected( i ) )
{
if( pData[i][Admin] >= 1 )
{
switch( pData[i][Admin] )
{
case 10: admtext = "Server Owner";
case 9: admtext = "Management";
case 8: admtext = "xMs Special Admin";
case 7: admtext = "head admin";
case 6: admtext = "lead admin";
case 5: admtext = "ubber admin";
case 4: admtext = "Admin";
case 3: admtext = "Admin";
case 2: admtext = "Admin";
case 1: admtext = "Admin";
}
count++;
format( stringz , 128,"Total Admins Online ");
format( string, 128, "%s (ID:%d) Level:%d (%s)\n\nTotal XtremeX admins %d", GetName( i ), i , pData[i][Admin] , admtext, count);
ShowPlayerDialog( playerid , 190 , DIALOG_STYLE_MSGBOX , stringz , string, "Ok" , "Close" );
}
}
if (count == 0)
{
format( stringz , 128 ,"No Admins Online ");
format( string , 128 ,"Currently NO admin online\nAdmins Watching from IRC\nand Admins Eyes always on you" );
ShowPlayerDialog( playerid,191,DIALOG_STYLE_MSGBOX , stringz , string , "Ok" , "Close" );
}
if(count >= 0)
{
ShowPlayerDialog( playerid , 190 , DIALOG_STYLE_MSGBOX , stringz , string, "Ok" , "Close" );
}
}
return 1;
}
PHP код:
|
IRCCMD:admins(botid, channel[], user[], host[], params[])
{
new count;
new admtext[128];
new stringz[128];
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if( pData[i][Admin] >= 3 )
{
switch( pData[i][Admin] )
{
case 10: admtext = "Server Owner";
case 9: admtext = "Management";
case 8: admtext = "xMs Special Admin";
case 7: admtext = "head admin";
case 6: admtext = "lead admin";
case 5: admtext = "ubber admin";
case 4: admtext = "Admin";
case 3: admtext = "Admin";
case 2: admtext = "Admin";
case 1: admtext = "Admin";
}
count++;
format(stringz, sizeof(stringz), "0,10 %d XtremeX Admin Online",count);
IRC_GroupSay(groupID, IRC_CHANNEL, stringz);
format(stringz,sizeof(stringz),"0,10 Admin %s (ID: %d) [Level %d] (%s)",GetName(i),i,pData[i][Admin],admtext);
IRC_GroupSay(groupID, IRC_CHANNEL, stringz);
format(stringz, sizeof(stringz), "*Online Admins Player List Requested by %s ~ Total %d", user, count);
SendClientMessageToAll(0xFFB400FF, stringz);
format(stringz, sizeof(stringz), "0,10 *Online Admins List Requested by %s ~ Total %d",user,count);
IRC_GroupSay(groupID, IRC_CHANNEL, stringz);
}
}
if (count == 0)
{
IRC_GroupSay(groupID, IRC_CHANNEL, "No admins are online!");
}
return 1;
}
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).
|