08.01.2015, 16:13
Hi guys. I have this command to look at the online admins, but I want to know how to when the player is RCON not appear in the list of admins. I need your help please!
pawn Code:
dcmd_admins( playerid, params[] )
{
#pragma unused params
new
szString[ 128 ] = "* ",
szName [ MAX_PLAYER_NAME ],
iCnt, iAdminCnt;
SendClientMessage( playerid, COLOR_RED, "Administradores:" );
loopPlayers( i )
{
if ( IsPlayerAdmin( playerid ) || pData[ playerid ][ P_LEVEL ] >= _:P_LEVEL_ADMIN )
{
iCnt ++;
iAdminCnt ++;
GetPlayerName( i, szName, MAX_PLAYER_NAME );
format( szString, sizeof( szString ), "%s%s (%d), ", szString, szName, i );
if ( iCnt >= 4 )
{
SendClientMessage( playerid, COLOR_ORANGE, szString );
szString= "* ";
iCnt = 0;
}
}
}
if ( iCnt )
SendClientMessage( playerid, COLOR_ORANGE, szString );
if ( iAdminCnt != 1 )
format( szString, sizeof( szString ), "Hay %d administradores conectados.", iAdminCnt );
else
szString = "Hay un administrador conectado.";
SendClientMessage( playerid, COLOR_WHITE, szString );
return 1;
}