[Script] Simple Co-op Strike example script [Mapping]

#1
Numele Script-ului: Simple Co-op Strike example script [Mapping]
Descriere: E pentru a face misiunile co-op strike.
Download:

Cod: Selectaţi tot

// --------------------------
// Coop Example by Whazaaaaa
// --------------------------

//Place this file somewhere in your csgo scripts folder so you can easily find it for your logic_script
//For example: Steam\steamapps\common\Counter-Strike Global Offensive\csgo\scripts\vscripts\custom

//To call script function from ingame place a logic_script name is somthing like 'script' and then you need an output
//on something like a button. For example: "OnPressed - script - RunScriptCode - SpawnWave(4)"

wave <- 0;
hardmode <- false;

function RoundInit()
{
        //Will do this everytime you start the map/round because we call it in the OnLevelReset
        ScriptCoopSetBotQuotaAndRefreshSpawns( 0 );
        wave = 0;
        
        //Reset the difficulty to normal at start of the round
        SendToConsoleServer( "mp_coopmission_bot_difficulty_offset 5" );
        hardmode = false;
        
        //enabled/disabled the correct spawns for the start. * means every group going from enemygroup_01 to infinite enemygroup_example
        EntFire( "enemygroup_*", "SetDisabled", "", 0 );
        EntFire( "enemygroup_01", "SetEnabled", "", 0 );
}

function OnMissionSucceeded()
{
        //what will happen once you've completed the mission (you could play a sound)
        
}

function OnRoundLostKilled()
{
        //what will happen if you loose the round because you died (you could tell the players that your grandma is better than them)
        
}

function OnRoundLostTime()
{
        //what will happen if you loose the round because the time runs out (you could tell the player that they are like turtles)
        
}

function OnReesetSpawns()
{
        //called right before the round resets (usually used for correcting stuff when on a new round other stuff is immediately called)
        
}

function OnLevelReset() 
{
        //called when the round resets
        // IMPORTANT: you need a coop_game_manager that has the output 'OnLevelReset' when this is called you NEED to call this function
        // in order for the level to work properly every round!
        RoundInit();
}

function OnWaveCompleted()
{
        //respawn players that are dead
        ScriptCoopMissionRespawnDeadPlayers();
        
        //Check which wave the player is and do stuff
        if ( wave == 1 )
        {
                EntFire( "enemygroup_*", "SetDisabled", "", 0 );
                EntFire( "enemygroup_02", "SetEnabled", "", 0 );
                EntFire( "door_02", "Unlock", "", 1 );
                EntFire( "door_02", "SetGlowEnabled", "", 1 );
        }
        else if ( wave == 2)
        {
                EntFire( "enemygroup_*", "SetDisabled", "", 0 );
                EntFire( "enemygroup_03", "SetEnabled", "", 0 );
                EntFire( "door_03", "Unlock", "", 1 );
                EntFire( "door_03", "SetGlowEnabled", "", 1 );
        }
        else if ( wave == 3)
        {
                EntFire( "enemygroup_*", "SetDisabled", "", 0 );
                EntFire( "enemygroup_04", "SetEnabled", "", 0 );
                EntFire( "door_04", "Unlock", "", 1 );
                EntFire( "door_04", "SetGlowEnabled", "", 1 );
        }
        else if ( wave == 4)
        {
                EntFire( "enemygroup_*", "SetDisabled", "", 0 );
                EntFire( "enemygroup_05", "SetEnabled", "", 0 );
                EntFire( "ladderbreak", "break", "", 1 );
        }
        //EntFire( "game_round_end", "EndRound_CounterTerroristsWin", "0", 0.0 );
}

function SpawnFirstWave( amount )
{
        //spawns the very first wave
        ScriptCoopMissionSpawnFirstEnemies( amount );
        wave++;
}

function SpawnWave( amount )
{
        //spawn the next wave
        ScriptCoopMissionSpawnNextWave( amount );
        wave++;
}

function CollectCoin()
{
        //collect a coin. For manually collecting a coin call this function if thats somehow important to you otherwise just use the item_coop_coin (3 is max)
        ScriptCoopCollectBonusCoin();
}

function ToggleMode()
{
        //Simple toggle to change the mode from ingame hard or normal
        //A point_servercommand named 'server' is needed in the map for the message 'Hardmode Enabled/Disabled' to work
        if ( hardmode == false )
        {
                SendToConsoleServer( "mp_coopmission_bot_difficulty_offset 5" );
                EntFire( "server", "Command", "say Hardmode Enabled", 0 );
                hardmode = true;
        }
        else
        {
                SendToConsoleServer( "mp_coopmission_bot_difficulty_offset 1" );
                EntFire( "server", "Command", "say Hardmode Disabled", 0 );
                hardmode = false;
        }
}
Autor: Anonim
Sursa (Link-ul oficial):
GameBanana
Propria parere: Fain.
Imagine
"Uh, sama lamaa duma lamaa you
assuming I'm a human
What I gotta do to get it through
to you I'm superhuman
Innovative and I'm made of rubber
So that anything you say is ricocheting off of me and it'll glue to you
I'm never stating, more than ever demonstrating
How to give a motherf---in' audience a feeling like it's levitating
Never fading, and I know the haters are forever waiting
For the day that they can say I fell off, they'd be celebrating
Cause I know the way to get 'em motivated
I make elevating music …" - Eminem

Înapoi la “Script-uri”

Cine este conectat

Utilizatori răsfoind acest forum: Niciun utilizator înregistrat și 2 vizitatori