PDA

View Full Version : /admins command help


FlavioCesar
08/01/2015, 04:13 PM
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!

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;
}

MohanedZzZ
08/01/2015, 04:19 PM
Remove this code from your code
if ( IsPlayerAdmin( playerid )

Larceny
08/01/2015, 04:24 PM
if(IsPlayerAdmin(playerid) == false && pData[playerid][P_LEVEL] >= _:P_LEVEL_ADMIN )
If the player is logged in rcon, won't appear in the list.

FlavioCesar
08/01/2015, 04:34 PM
Thanks!!! :)