10.02.2011, 18:02
pawn Код:
new szTemp[ MAX_PLAYER_NAME + 4 ],
szOut[ 128 ],
iIndex;
for( new i; i < MAX_PLAYERS; i++ ) { // I prefer using ******' foreach
if( !IsPlayerConnected( i ) ) {
continue;
}
if( playerArray[ i ][ iAdminLevel ] == 0 ) {
continue;
}
if( iIndex == 0 ) {
format( szOut, 128, "Online administrators: " );
}
if( strlen( szOut ) >= ( 128 - sizeof( szTemp ) ) ) {
SendClientMessage( playerid, 0xFFFFFFFF, szOut );
strdel( szOut, 0, strlen( szOut ) );
}
format( szTemp, sizeof( szTemp ), "%s (%d)", playerArray[ i ][ szName ], playerArray[ i ][ iAdminLevel ] );
format( szOut, 128, "%s%s, ", szOut, szTemp );
iIndex++;
}
strdel( szOut, strlen( szOut ) - 2, strlen( szOut ) );
SendClientMessage( playerid, 0xFFFFFFFF, szOut );
Код:
Online administrators: Me (1337), You (1), He_She_It(3), We_You_They(2)