#if defined _colorchat_included #endinput #endif #define _colorchat_included /* ColorChat Support */ #define NORMAL DontChange #define GREEN DontChange #define TEAM_COLOR DontChange #define RED Red #define BLUE Blue #define GREY Grey #define ColorChat client_print_color /* ColorChat Support */ enum _:Colors { DontChange, Red, Blue, Grey } stock const g_szTeamName[Colors][] = { "UNASSIGNED", "TERRORIST", "CT", "SPECTATOR" } stock client_print_color(id, iColor=DontChange, const szMsg[], any:...) { // check if id is different from 0 if( id && !is_user_connected(id) ) { return 0; } if( iColor > Grey ) { iColor = DontChange; } new szMessage[192]; if( iColor == DontChange ) { szMessage[0] = 0x04; } else { szMessage[0] = 0x03; } new iParams = numargs(); // Specific player code if(id) { if( iParams == 3 ) { copy(szMessage[1], charsmax(szMessage)-1, szMsg); } else { vformat(szMessage[1], charsmax(szMessage)-1, szMsg, 4); } if( iColor ) { new szTeam[11]; // store current team so we can restore it get_user_team(id, szTeam, charsmax(szTeam)); // set id TeamInfo in consequence // so SayText msg gonna show the right color Send_TeamInfo(id, id, g_szTeamName[iColor]); // Send the message Send_SayText(id, id, szMessage); // restore TeamInfo Send_TeamInfo(id, id, szTeam); } else { Send_SayText(id, id, szMessage); } } // Send message to all players else { // Figure out if at least 1 player is connected // so we don't send useless message if not // and we gonna use that player as team reference (aka SayText message sender) for color change new iPlayers[32], iNum; get_players(iPlayers, iNum, "ch"); if( !iNum ) { return 0; } new iFool = iPlayers[0]; new iMlNumber, i, j; new Array:aStoreML = ArrayCreate(); if( iParams >= 5 ) // ML can be used { for(j=4; j