
Code: Select all
public EventRoundEnd( ) { if( g_iStatus != GH_ONLINE ) return PLUGIN_CONTINUE; arrayset( g_bDefusing, false, 32 ); g_iRounds++; if( g_iHalf == LAST ) { new iScore_CT = g_iTeamScore[ SCORE_CT ][ FIRST ] + g_iTeamScore[ SCORE_CT ][ LAST ]; new iScore_TS = g_iTeamScore[ SCORE_T ][ FIRST ] + g_iTeamScore[ SCORE_T ][ LAST ]; if( iScore_CT >= GH_MATCHROUND + 1 ) { // ct win } else if( iScore_TS >= GH_MATCHROUND + 1 ) { // t win } else { // draw } } if( ++g_iRounds >= GH_MATCHROUND ) { g_iStatus = GH_FIRSTHALF; g_iHalf = LAST; g_iRounds = 0; if( g_iTeamScore[ SCORE_T ][ FIRST ] > g_iTeamScore[ SCORE_CT ][ FIRST ] ) client_print_color( 0, print_team_default, "%s^3 Terrorists^1 leading with score^4 %i:%i", g_szPrefix, g_iTeamScore[ SCORE_T ][ FIRST ], g_iTeamScore[ SCORE_CT ][ FIRST ] ); else if( g_iTeamScore[ SCORE_CT ][ FIRST ] > g_iTeamScore[ SCORE_T ][ FIRST ] ) client_print_color( 0, print_team_default, "%s^3 Counter-Terrorists^1 leading with score^4 %i:%i", g_szPrefix, g_iTeamScore[ SCORE_CT ][ FIRST ], g_iTeamScore[ SCORE_T ][ FIRST ] ); else client_print_color( 0, print_team_default, "%s^1 Teams are tied!^4 %i:%i", g_szPrefix, g_iTeamScore[ SCORE_CT ][ FIRST ], g_iTeamScore[ SCORE_T ][ FIRST ] ); new iPlayers[ 32 ], iNum, iPlayer, iPoints, iOldPoints, szSteamID[ 35 ], szData[ 6 ]; get_players( iPlayers, iNum ); for( new i; i < iNum; i++ ) { iPlayer = iPlayers[ i ]; switch( cs_get_user_team( iPlayer ) ) { case CS_TEAM_T: cs_set_user_team( iPlayer, CS_TEAM_CT ); case CS_TEAM_CT: cs_set_user_team( iPlayer, CS_TEAM_T ); default: continue; } get_user_authid( iPlayer, szSteamID, charsmax( szSteamID ) ); iOldPoints = _GetOldSkill( iPlayer ); iPoints = ( ( 9 * iOldPoints ) + ( ( 20 * g_iPoints[ iPlayer ] * 2 ) / g_iRounds ) ) / 10; g_iPoints[ iPlayer ] = iPoints; num_to_str( iPoints, szData, charsmax( szData ) ); VaultSetData( szSteamID, szData ); } server_cmd( "sv_restart 1" ); client_print( 0, print_chat, "%i rounds passed!", GH_MATCHROUND ); } return PLUGIN_CONTINUE;}