Sign in to follow this  
codmania

Help Adding endround music

Recommended Posts

Posted (edited)

I use Open Warfare 2 mod, the final killcam works fine, but impossible to have the sound during the final killcam

I'm looking for help to fix it, thanks in advance :)

 

#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
#include common_scripts\utility;
#include openwarfare\_utils;
#include maps\mp\gametypes\_roundmusic;


init()
{
    level.killcam_style = 0;
    level.fk = false;
    level.showFinalKillcam = false;
    level.waypoint = false;
    level.doFK["axis"] = false;
    level.doFK["allies"] = false;
        
    OnPlayerConnect();
}

OnPlayerConnect()
{
    for(;;)
    {
        level waittill("connected", player);

        player thread beginFK();
    }
}    
        
beginFK()
{
    self endon("disconnect");
    
    for(;;)
    {
        self waittill("beginFK", winner);

        self notify ( "reset_outcome" );
        
        if(level.TeamBased)
        {
            self finalkillcam(level.KillInfo[winner]["attacker"], level.KillInfo[winner]["attackerNumber"], level.KillInfo[winner]["deathTime"], level.KillInfo[winner]["victim"]);
        }
        else
        {
            self finalkillcam(winner.KillInfo["attacker"], winner.KillInfo["attackerNumber"], winner.KillInfo["deathTime"], winner.KillInfo["victim"]);
        }
    }
}

finalkillcam( attacker, attackerNum, deathtime, victim)
{
    self endon("disconnect");
    level endon("end_killcam");
    
    self SetClientDvar("ui_ShowMenuOnly", "none");

    camtime = 6;
    predelay = getTime()/1000 - deathTime;
    postdelay = 3;
    killcamlength = camtime + postdelay;
    killcamoffset = camtime + predelay;
    
    visionSetNaked( getdvar("mapname") );
    
    self notify ( "begin_killcam", getTime() );
    
    self allowSpectateTeam("allies", true);
    self allowSpectateTeam("axis", true);
    self allowSpectateTeam("freelook", true);
    self allowSpectateTeam("none", true);
    
    self.sessionstate = "spectator";
    self.spectatorclient = attackerNum;
    self.killcamentity = -1;
    self.archivetime = killcamoffset;
    self.killcamlength = killcamlength;
    self.psoffsettime = 0;
    
    if(!isDefined(level.slowmostart))
        level.slowmostart = killcamlength - 2.5;
    
    self.killcam = true;
    
    wait 0.05;
    
    if(!isDefined(self.top_fk_shader))
    {
        self CreateFKMenu(victim , attacker);
    }
    else
    {
        self.fk_title.alpha = 1;
        self.fk_title_low.alpha = 1;
        self.top_fk_shader.alpha = 0.5;
        self.bottom_fk_shader.alpha = 0.5;
        self.credits.alpha = 0.2;
    }
    
    self thread WaitEnd(killcamlength);
    
    wait 0.05;
    
    self waittill("end_killcam");
    
    self thread CleanFK();
    
    self.killcamentity = -1;
    self.archivetime = 0;
    self.psoffsettime = 0;
    
    wait 0.05;
    
    self.sessionstate = "spectator";
    spawnpointname = "mp_global_intermission";
    spawnpoints = getentarray(spawnpointname, "classname");
    assert( spawnpoints.size );
    spawnpoint = maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

    self spawn(spawnpoint.origin, spawnpoint.angles);
    self notify("never_joined_team");
    wait 0.05;
    
    self.killcam = undefined;
    self thread maps\mp\gametypes\_spectating::setSpectatePermissions();

    level notify("end_killcam");

    level.fk = false;  
}

CleanFK()
{
    self.fk_title.alpha = 0;
    self.top_fk_shader.alpha = 0;
    self.bottom_fk_shader.alpha = 0;
    self.credits.alpha = 0;
    
    self SetClientDvar("ui_ShowMenuOnly", "");
    
    visionSetNaked( "mpOutro", 1.0 );
}

WaitEnd( killcamlength )
{
    self endon("disconnect");
    self endon("end_killcam");
    
    wait killcamlength;
    
    self notify("end_killcam");
}

CreateFKMenu( victim , attacker)
{

    color=((randomint(100)+1)/100,(randomint(100)+1)/100,(randomint(100)+1)/100);
 
    self.top_fk_shader = newClientHudElem(self);
    self.top_fk_shader.elemType = "shader";
    self.top_fk_shader.archived = false;
    self.top_fk_shader.horzAlign = "fullscreen";
    self.top_fk_shader.vertAlign = "fullscreen";
    self.top_fk_shader.sort = 0;
    self.top_fk_shader.foreground = true;
    self.top_fk_shader.color    = (.15, .15, .15);
    self.top_fk_shader setShader("white",640,112);
    
    self.bottom_fk_shader = newClientHudElem(self);
    self.bottom_fk_shader.elemType = "shader";
    self.bottom_fk_shader.y = 368;
    self.bottom_fk_shader.archived = false;
    self.bottom_fk_shader.horzAlign = "fullscreen";
    self.bottom_fk_shader.vertAlign = "fullscreen";
    self.bottom_fk_shader.sort = 0;
    self.bottom_fk_shader.foreground = true;
    self.bottom_fk_shader.color    = (.15, .15, .15);
    self.bottom_fk_shader setShader("white",640,112);
    
    self.fk_title = newClientHudElem(self);
    self.fk_title.archived = false;
    self.fk_title.y = 45;
    self.fk_title.alignX = "center";
    self.fk_title.alignY = "middle";
    self.fk_title.horzAlign = "center";
    self.fk_title.vertAlign = "top";
    self.fk_title.sort = 1; // force to draw after the bars
    self.fk_title.font = "objective";
    self.fk_title.fontscale = 3.5;
    self.fk_title.foreground = true;
    self.fk_title.shadown = 1;
    self.fk_title.alpha = 1;     
    self.fk_title.glowalpha = 1;
    self.fk_title.glowColor = color;
    
    self.credits = newClientHudElem(self);
    self.credits.archived = false;
    self.credits.x = 0;
    self.credits.y = 0;
    self.credits.alignX = "left";
    self.credits.alignY = "bottom";
    self.credits.horzAlign = "left";
    self.credits.vertAlign = "bottom";
    self.credits.sort = 1; // force to draw after the bars
    self.credits.font = "default";
    self.credits.fontscale = 1.4;
    self.credits.foreground = true;
        
    self.fk_title.alpha = 1;
    self.top_fk_shader.alpha = 0.5;
    self.bottom_fk_shader.alpha = 0.5;
    self.credits.alpha = 0.2;

    self.credits setText("^1Created by:^2FzBr.^3d4rk ^7- ^1Edited for Openwarfare by:^AK|^3KABOOM");
    
    if( !level.killcam_style )
        self.fk_title setText("GAME WINNING KILL");
    else
        self.fk_title setText("ROUND WINNING KILL");        
        
    if(!isdefined(attacker) || !isdefined(victim)) return;
      self.villain = createFontString( "default", level.lowerTextFontSize );
     self.villain setPoint( "CENTER", "BOTTOM", -500, -125 );
      self.villain.alignX = "right";     
    self.villain.archived = false;
    self.villain setPlayerNameString( attacker );
     self.villain.alpha = 1;     
    self.villain.glowalpha = 1;
    self.villain.glowColor = color;  
    self.villain moveOverTime( 4 );
     self.villain.x = -20;        
    self.versus = createFontString( "default", level.lowerTextFontSize );
     self.versus.alpha = 0;     
    self.versus setPoint( "CENTER", "BOTTOM", 0, -125 );
       self.versus.archived = false;     
    self.versus setText( "^7vs" );
    self.versus.glowColor = color;     
    self.versus fadeOverTime( 4 );
     self.versus.alpha = 1;        
    self.victim = createFontString( "default", level.lowerTextFontSize );
     self.victim setPoint( "CENTER", "BOTTOM", 500, -125 );
     self.victim.alignX = "left";       
    self.victim.archived = false;
    self.victim setText( "^2" );    
    self.victim setPlayerNameString( victim );
     self.victim.glowalpha = 1;  
    self.victim.glowColor = color;  
    self.victim moveOverTime( 4 );
     self.victim.x = 20;           
    if ( isDefined( self.carryIcon ) )         self.carryIcon destroy();    
    
        
}

onPlayerKilled(eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration)
{
    if(attacker != self)
    {
        level.showFinalKillcam = true;
        
        team = attacker.team;
        
        level.doFK[team] = true;
        
        if(level.teamBased)
        {
            level.KillInfo[team]["attacker"] = attacker;
            level.KillInfo[team]["attackerNumber"] = attacker getEntityNumber();
            level.KillInfo[team]["victim"] = self;
            level.KillInfo[team]["deathTime"] = GetTime()/1000;
        }
        else
        {
            attacker.KillInfo["attacker"] = attacker;
            attacker.KillInfo["attackerNumber"] = attacker getEntityNumber();
            attacker.KillInfo["victim"] = self;
            attacker.KillInfo["deathTime"] = GetTime()/1000;
        }
    }
}

endGame( winner, endReasonText )
{
    // return if already ending via host quit or victory
    if ( game["state"] == "postgame" || level.gameEnded )
        return;

    if ( isDefined( level.onEndGame ) )
        [[level.onEndGame]]( winner );

    visionSetNaked( "mpOutro", 2.0 );
    
    game["state"] = "postgame";
    level.gameEndTime = getTime();
    level.gameEnded = true;
    level.inGracePeriod = false;
    level notify ( "game_ended" );
    
    if ( isdefined( winner ) && level.gametype == "sd" )
        [[level._setTeamScore]]( winner, [[level._getTeamScore]]( winner ) + 1 );
    
    
    if ( isdefined( winner ) && level.gametype == "sr" )
        [[level._setTeamScore]]( winner, [[level._getTeamScore]]( winner ) + 1 );
    
    
    if ( isdefined( winner ) && level.gametype == "toitc" )
        [[level._setTeamScore]]( winner, [[level._getTeamScore]]( winner ) + 1 );

    if ( isdefined( winner ) && level.gametype == "oitc" )
        [[level._setTeamScore]]( winner, [[level._getTeamScore]]( winner ) + 1 );    

    if ( isdefined( winner ) && level.gametype == "ass" )
        [[level._setTeamScore]]( winner, [[level._getTeamScore]]( winner ) + 1 );
    
    setGameEndTime( 0 ); // stop/hide the timers
    
    if ( level.rankedMatch || level.scr_server_rank_type == 2 )
    {
        maps\mp\gametypes\_globallogic::setXenonRanks();
        
        if ( maps\mp\gametypes\_globallogic::hostIdledOut() )
        {
            level.hostForcedEnd = true;
            logString( "host idled out" );
            endLobby();
        }
    }
    
    maps\mp\gametypes\_globallogic::updatePlacement();
    maps\mp\gametypes\_globallogic::updateMatchBonusScores( winner );
    maps\mp\gametypes\_globallogic::updateWinLossStats( winner );
    
    setdvar( "g_deadChat", 1 );
    
    serverHideHUD();

    // freeze players
    players = level.players;
    for ( index = 0; index < players.size; index++ )
    {
        player = players[index];
        
        player maps\mp\gametypes\_globallogic::freezePlayerForRoundEnd();
        player thread maps\mp\gametypes\_globallogic::roundEndDoF( 4.0 );
        
        player maps\mp\gametypes\_globallogic::freeGameplayHudElems();
        
        player setClientDvars(
              "cg_everyoneHearsEveryone", 1,
              "cg_drawhealth", 0
        );

        if( level.rankedMatch || level.scr_server_rank_type == 2 )
        
        {
            if ( isDefined( player.setPromotion ) )
                player setClientDvar( "ui_lobbypopup", "promotion" );
            else
                player setClientDvar( "ui_lobbypopup", "summary" );
        }
    }

    // end round

    
    // See if we need to perform a check for the game
    if ( level.scr_overtime_enable == 1 && !isDefined( game["_overtime"] ) ) {
        openwarfare\_overtime::checkGameState();
    }

    if ( (level.roundLimit > 1 || (!level.roundLimit && level.scoreLimit != 1)) && !level.forcedEnd )
    {
        if ( level.displayRoundEndText )
        {
            players = level.players;
            for ( index = 0; index < players.size; index++ )
            {
                player = players[index];
                
                if ( level.teamBased && level.gametype != "bel" )
                    player thread maps\mp\gametypes\_hud_message::teamOutcomeNotify( winner, true, endReasonText );
                else
                    player thread maps\mp\gametypes\_hud_message::outcomeNotify( winner, endReasonText );
        
                player setClientDvars( "ui_hud_hardcore", 1,
                                       "cg_drawSpectatorMessages", 0,
                                       "g_compassShowEnemies", 0 );
            }

            if ( ( level.teamBased && level.gametype != "bel" ) && !(maps\mp\gametypes\_globallogic::hitRoundLimit() || maps\mp\gametypes\_globallogic::hitScoreLimit()) )
                thread maps\mp\gametypes\_globallogic::announceRoundWinner( winner, level.roundEndDelay / 4 );
            
            if ( maps\mp\gametypes\_globallogic::hitRoundLimit() || maps\mp\gametypes\_globallogic::hitScoreLimit() )
                maps\mp\gametypes\_globallogic::roundEndWait( level.roundEndDelay / 2, false );
            else
                maps\mp\gametypes\_globallogic::roundEndWait( level.roundEndDelay, true );
        }
        
        game["roundsplayed"]++;
        roundSwitching = false;
        if ( !maps\mp\gametypes\_globallogic::hitRoundLimit() && !maps\mp\gametypes\_globallogic::hitScoreLimit() )
            roundSwitching = maps\mp\gametypes\_globallogic::checkRoundSwitch();

        if ( isDefined( game["_overtime"] ) ) {
            level.halftimeType = "overtime";
            level.halftimeSubCaption = &"OW_LAST_ROUND";            
        }

        if ( roundSwitching && level.teamBased )
        {
            players = level.players;
            for ( index = 0; index < players.size; index++ )
            {
                player = players[index];
                
                if ( !isdefined(level.scr_showscore_spectator) || isdefined(level.scr_showscore_spectator) && level.scr_showscore_spectator == 0 )
                {
                if ( !isDefined( player.pers["team"] ) || player.pers["team"] == "spectator" )
                {
                    player [[level.spawnIntermission]]();
                    player closeMenu();
                    player closeInGameMenu();
                    continue;
                }
                }
                
                switchType = level.halftimeType;
                if ( switchType == "halftime" )
                {
                    if ( level.roundLimit )
                    {
                        if ( (game["roundsplayed"] * 2) == level.roundLimit )
                            switchType = "halftime";
                        else
                            switchType = "intermission";
                    }
                    else if ( level.scoreLimit )
                    {
                        if ( game["roundsplayed"] == (level.scoreLimit - 1) )
                            switchType = "halftime";
                        else
                            switchType = "intermission";
                    }
                    else
                    {
                        switchType = "intermission";
                    }
                }
                switch( switchType )
                {
                    case "halftime":
                        player maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "halftime" );
                        break;
                    case "overtime":
                        player maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "overtime" );
                        break;
                    default:
                        player maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "side_switch" );
                        break;
                }
                player thread maps\mp\gametypes\_hud_message::teamOutcomeNotify( switchType, true, level.halftimeSubCaption );
                player setClientDvar( "ui_hud_hardcore", 1 );
            }
            
            maps\mp\gametypes\_globallogic::roundEndWait( level.halftimeRoundEndDelay, false );
        }
        else if ( !maps\mp\gametypes\_globallogic::hitRoundLimit() && !maps\mp\gametypes\_globallogic::hitScoreLimit() && !level.displayRoundEndText && level.teamBased )
        {
            players = level.players;
            for ( index = 0; index < players.size; index++ )
            {
                player = players[index];

                if ( !isdefined(level.scr_showscore_spectator) || isdefined(level.scr_showscore_spectator) && level.scr_showscore_spectator == 0 )
                {
                if ( !isDefined( player.pers["team"] ) || player.pers["team"] == "spectator" )
                {
                    player [[level.spawnIntermission]]();
                    player closeMenu();
                    player closeInGameMenu();
                    continue;
                    }
                }
                
                switchType = level.halftimeType;
                if ( switchType == "halftime" )
                {
                    if ( level.roundLimit )
                    {
                        if ( (game["roundsplayed"] * 2) == level.roundLimit )
                            switchType = "halftime";
                        else
                            switchType = "roundend";
                    }
                    else if ( level.scoreLimit )
                    {
                        if ( game["roundsplayed"] == (level.scoreLimit - 1) )
                            switchType = "halftime";
                        else
                            switchTime = "roundend";
                    }
                }
                switch( switchType )
                {
                    case "halftime":
                        player maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "halftime" );
                        break;
                    case "overtime":
                        player maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "overtime" );
                        break;
                }
                player thread maps\mp\gametypes\_hud_message::teamOutcomeNotify( switchType, true, endReasonText );
                player setClientDvar( "ui_hud_hardcore", 1 );
            }            

            maps\mp\gametypes\_globallogic::roundEndWait( level.halftimeRoundEndDelay, !(maps\mp\gametypes\_globallogic::hitRoundLimit() || maps\mp\gametypes\_globallogic::hitScoreLimit()) );
        }

      

        
        if(level.players.size > 0 && level.gametype == "sd" && !maps\mp\gametypes\_globallogic::hitScoreLimit())
        {
            level.killcam_style = 1;
            thread startFK( winner );
        }
        
    if(level.players.size > 0 && level.gametype == "sr" && !maps\mp\gametypes\_globallogic::hitScoreLimit())
        {
            level.killcam_style = 1;
            thread startFK( winner );
        }
        
    if(level.players.size > 0 && level.gametype == "toitc" && !maps\mp\gametypes\_globallogic::hitScoreLimit())
        {
            level.killcam_style = 1;
            thread startFK( winner );
        }

    if(level.players.size > 0 && level.gametype == "oitc" && !maps\mp\gametypes\_globallogic::hitScoreLimit())
        {
            level.killcam_style = 1;
            thread startFK( winner );
        }

    if(level.players.size > 0 && level.gametype == "ass" && !maps\mp\gametypes\_globallogic::hitScoreLimit())
        {
            level.killcam_style = 1;
            thread startFK( winner );
        }
        
        if(level.fk)
            level waittill("end_killcam");


        if ( !maps\mp\gametypes\_globallogic::hitRoundLimit() && !maps\mp\gametypes\_globallogic::hitScoreLimit() )
        {
            level notify ( "restarting" );
            game["state"] = "playing";
            map_restart( true );
            return;
        }
        
        if ( maps\mp\gametypes\_globallogic::hitRoundLimit() )
            endReasonText = game["strings"]["round_limit_reached"];
        else if ( maps\mp\gametypes\_globallogic::hitScoreLimit() )
            endReasonText = game["strings"]["score_limit_reached"];
        else
            endReasonText = game["strings"]["time_limit_reached"];
    }
    
    thread maps\mp\gametypes\_missions::roundEnd( winner );

    if ( ( level.teamBased && level.gametype != "bel" ) && maps\mp\gametypes\_globallogic::hitRoundLimit() ) {
        if ( game["teamScores"]["allies"] == game["teamScores"]["axis"] )
            winner = "tie";
        else if ( game["teamScores"]["axis"] > game["teamScores"]["allies"] )
            winner = "axis";
        else
            winner = "allies";
    }

    // catching gametype, since DM forceEnd sends winner as player entity, instead of string
    players = level.players;
    for ( index = 0; index < players.size; index++ )
    {
        player = players[index];

        if ( !isdefined(level.scr_showscore_spectator) || isdefined(level.scr_showscore_spectator) && level.scr_showscore_spectator == 0 )
        {
        if ( !isDefined( player.pers["team"] ) || player.pers["team"] == "spectator" )
        {
            player [[level.spawnIntermission]]();
            player closeMenu();
            player closeInGameMenu();
            continue;
        }
        }
        
        if ( level.teamBased && level.gametype != "bel" ) {
            player thread maps\mp\gametypes\_hud_message::teamOutcomeNotify( winner, false, endReasonText );
        }
        else
        {
            player thread maps\mp\gametypes\_hud_message::outcomeNotify( winner, endReasonText );
            
            if ( isDefined( winner ) && player == winner )
                player playLocalSound( game["music"]["victory_" + player.pers["team"] ] );
            else if ( !level.splitScreen )
                player playLocalSound( game["music"]["defeat"] );
        }
        
        player setClientDvars( "ui_hud_hardcore", 1,
                               "cg_drawSpectatorMessages", 0,
                               "g_compassShowEnemies", 0 );
    }
    
    if ( level.teamBased && level.gametype != "bel" )
    {
        thread maps\mp\gametypes\_globallogic::announceGameWinner( winner, level.postRoundTime / 2 );
        
        if ( level.splitscreen )
        {
            if ( winner == "allies" )
                playSoundOnPlayers( game["music"]["victory_allies"], "allies" );
            else if ( winner == "axis" )
                playSoundOnPlayers( game["music"]["victory_axis"], "axis" );
            else
                playSoundOnPlayers( game["music"]["defeat"] );
        }
        else
        {
            if ( winner == "allies" )
            {
                playSoundOnPlayers( game["music"]["victory_allies"], "allies" );
                playSoundOnPlayers( game["music"]["defeat"], "axis" );
            }
            else if ( winner == "axis" )
            {
                playSoundOnPlayers( game["music"]["victory_axis"], "axis" );
                playSoundOnPlayers( game["music"]["defeat"], "allies" );
            }
            else
            {
                playSoundOnPlayers( game["music"]["defeat"] );
            }
        }
    }
    
    wait 9;
    
    if(level.players.size > 0 && level.gametype != "sd")
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }
    
    if(level.gametype == "sd" && maps\mp\gametypes\_globallogic::hitScoreLimit() && level.players.size > 0)
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }
    
    if(level.players.size > 0 && level.gametype != "sr")
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }
    
    if(level.gametype == "sr" && maps\mp\gametypes\_globallogic::hitScoreLimit() && level.players.size > 0)
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }
    
    if(level.players.size > 0 && level.gametype != "toitc")
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }

    if(level.gametype == "toitc" && maps\mp\gametypes\_globallogic::hitScoreLimit() && level.players.size > 0)
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }

    if(level.players.size > 0 && level.gametype != "oitc")
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }

     if(level.gametype == "oitc" && maps\mp\gametypes\_globallogic::hitScoreLimit() && level.players.size > 0)
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }


    if(level.players.size > 0 && level.gametype != "ass")
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }

    if(level.gametype == "ass" && maps\mp\gametypes\_globallogic::hitScoreLimit() && level.players.size > 0)
    {
        level.killcam_style = 0;
        thread startFK( winner );
    }    
    
    if(level.fk)
        level waittill("end_killcam");
    else
        maps\mp\gametypes\_globallogic::roundEndWait( level.postRoundTime, true );
    
    level.intermission = true;
    level notify("intermission");
    
    //regain players array since some might've disconnected during the wait above
    players = level.players;
    for ( index = 0; index < players.size; index++ )
    {
        player = players[index];
        
        player closeMenu();
        player closeInGameMenu();
        player notify ( "reset_outcome" );
        player thread maps\mp\gametypes\_globallogic::spawnIntermission();
        player setClientDvar( "ui_hud_hardcore", 0 );
        if ( isDefined( game["menu_eog_main"] ) )
            player setClientDvar( "g_scriptMainMenu", game["menu_eog_main"] );
        
    }
    
    logString( "game ended" );
    wait getDvarFloat( "scr_show_unlock_wait" );
    
    if( level.console )
    {
        exitLevel( false );
        return;
    }
    
    if ( ( level.rankedMatch || level.scr_server_rank_type == 2 ) || level.scr_endofgame_stats_enable == 1 ) {
        if ( level.scr_endofgame_stats_enable == 1 ) {
            wait (1.0);
        }
        
    // popup for game summary
        players = level.players;
        for ( index = 0; index < players.size; index++ )
        {
            player = players[index];
            
            if ( level.scr_endofgame_stats_enable == 1 ) {
                player openMenu( game["menu_eog_stats"] );
            } else {
                player openMenu( game["menu_eog_unlock"] );
            }
        }
    }
    
    thread timeLimitClock_Intermission( level.scr_intermission_time, ( level.scr_amvs_enable == 0 || game["amvs_skip_voting"] ) );
    wait (level.scr_intermission_time);

    if ( level.scr_eog_fastrestart != 0 ) {    
        fastRestarts = getDvarInt( "ow_fastrestarts" );
        
        if ( fastRestarts == level.scr_eog_fastrestart ) {
            setDvar("ow_fastrestarts", 0 );
        } else {
            setDvar("ow_fastrestarts", fastRestarts+1 );
            map_restart( false );
        }
    }
    
    openwarfare\_advancedmvs::mapVoting_Intermission();
    
    players = level.players;
    for ( index = 0; index < players.size; index++ )
    {
        player = players[index];
        //iPrintLnBold( "closing eog summary!" );
        player closeMenu();
        player closeInGameMenu();
    }

    exitLevel( false );
}

timeLimitClock_Intermission( waitTime, playSound )
{
    setGameEndTime( getTime() + int(waitTime*1000) );
    clockObject = spawn( "script_origin", (0,0,0) );

    while ( waitTime > 0 ) {
        if ( playSound && waitTime <= 11 ) {
            clockObject playSound( "ui_mp_timer_countdown" );            
        }
        wait ( 1.0 );
        waitTime -= 1.0;
    }
    
    clockObject delete();
}

startFK( winner )
{
    song = (1+randomInt(7));
    level thread playSoundOnAllPlayers( "endround" + song );
    level thread displaysName_hud( "endround" + song );
    level endon("end_killcam");
    
    if(!level.showFinalKillcam)
        return;
        

        
    if(!isPlayer(Winner) && !level.doFK[winner])
        return;
    
    level.fk = true;

    for( i = 0; i < level.players.size; i ++)
    {
        player = level.players;
        player notify("beginFK", winner);

    }

}


displaysName_hud( song )
{
players = level.players;
for ( index = 0; index < players.size; index++ ){
        player = players[index];
        player thread displayone(song);
    }

}

displayone( song )
{
        notifyData = spawnstruct();
        notifyData.notifyText =  "^1Song Name"; //Title
        notifyData.notifyText2 = (getS_name(song));; //Name Song
        notifyData.glowColor = (0, 0, 1); //RGB Color array divided by 100
        notifyData.duration = 6.0;
        self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
}

getS_name(song)
{
    switch( song )
    {

        case "endround1":
            return "Grandtheft & Delaney Jane - Eazy Go"; //Change These as your music on the server
            
        case "endround2":
            return "Calvin Harrid - How Deep is your love";
            
        case "endround3":
            return "Cartoon - On & On";
            
        case "endround4":
            return "Radioactive";
            
        case "endround5":
            return "Jonas Blue - Mama ft. William Singe";

        case "endround6":
            return "Eminem - The Monster ft. Rihanna";

        case "endround7":
            return "OneRepublic - Counting Stars";

        case "endround8":
            return "Unknown";
            
        case "endround9":
            return "Krewella - Alive";
            
        case "endround10":
            return "Sia - Cheap Thrills Ft. Sean Paul";
            
        case "endround11":
            return "Pitbull & J Balvin - Hey Ma ft Camila Cabello";
            
        case "endround12":
            return "Sia - Never Give Up";
            
        case "endround13":
            return "Sia - The Greatest ft. Kendrick Lamar";

        case "endround14":
            return "ItaloBrothers - Summer Air";

        case "endround15":
            return "Linkin Park - Numb";

        case "endround16":
            return "Kanye West - Stronger";
            
        case "endround17":
        return "Linkin Park - In The End";
            
        case "endround18":
        return "Axwell - Ingrosso - More Than You Knowr";
        
        case "endround19":
        return "Fort Minor - Remember The Name";
            
        case "endround20":
        return "Kelly Clarkson - Stronger";
            
        case "endround21":
        return "Pitbull & J Balvin - Hey Ma ft Camila Cabello";
        
        case "endround22":
        return "Macklemore & Ryan Lewis - Thrift Shop";
            
        case "endround23":
        return "The Script - Superheroes";

        case "endround24":
        return "Rihanna feat Drake - Work";        
                        
        case "endround25":
            return "Clean Bandit - Rockabye ft. Sean Paul & Anne-Marie";
            
        default:
            return "";
    }
}

Edited by codmania

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this