axel37

coop_tenmen Vscript

Jan 16th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. wave <- 0;
  2.  
  3. function RoundInit(){
  4. //Will do this everytime you start the map/round because we call it in the OnLevelReset
  5. wave = 0;
  6. //Reset the difficulty to normal at start of the round
  7. SendToConsoleServer( "mp_coopmission_bot_difficulty_offset 1" );
  8. ScriptCoopSetBotQuotaAndRefreshSpawns( 0 );
  9. }
  10.  
  11. function ChangeGameModeToCoopIfNotCorrect()
  12. {
  13. // This will change the game mode and game type if the player has not initialized this before starting the map.
  14. local game_mode = ScriptGetGameMode();
  15. local game_type = ScriptGetGameType();
  16. local map = GetMapName();
  17.  
  18. if (game_mode != 1 || game_type != 4)
  19. {
  20. SendToConsole("game_mode 1; game_type 4; changelevel " + map);
  21. }
  22. }
  23.  
  24. function SpawnFirstEnemies( amount )
  25. {
  26. ScriptCoopMissionSpawnFirstEnemies( amount );
  27. ScriptCoopResetRoundStartTime();
  28. wave++;
  29. }
  30.  
  31. function SpawnNextWave( amount ){
  32. ScriptCoopMissionSpawnNextWave( amount );
  33. wave++;
  34. }
  35.  
  36. function OnMissionCompleted()
  37. {
  38. //what will happen once you've completed the mission (you could play a sound)
  39.  
  40. }
  41.  
  42. function OnRoundLostKilled()
  43. {
  44. //what will happen if you loose the round because you died (you could tell the players that your grandma is better than them)
  45.  
  46. }
  47.  
  48. function OnRoundLostTime()
  49. {
  50. //what will happen if you loose the round because the time runs out (you could tell the player that they are like turtles)
  51.  
  52. }
  53.  
  54. function OnRoundReset()
  55. {
  56. //called when the round resets
  57. // IMPORTANT: you need a game_coopmission_manager that has the output 'OnLevelReset' when this is called you NEED to call this function
  58. // in order for the level to work properly every round!
  59. RoundInit();
  60. }
  61.  
  62. function OnSpawnsReset()
  63. {
  64. //called right before the round resets (usually used for correcting stuff when on a new round other stuff is immediately called)
  65. //enabled/disabled the correct spawns for the start. * means every group going from Terrorist_00 to infinite enemygroup_example
  66. EntFire( "wave_*", "SetDisabled", "", 0 );
  67. EntFire( "wave_01", "SetEnabled", "", 0 );
  68. EntFire( "CT_*", "SetDisabled", "", 0 );
  69. EntFire( "CT_1", "SetEnabled", "", 0 );
  70. }
  71.  
  72. function OnWaveCompleted()
  73. {
  74. //Check which wave the player is and do stuff
  75. if ( wave == 1 )
  76. {
  77. EntFire( "wave_*", "SetDisabled", "", 0 );
  78. EntFire( "wave_02", "SetEnabled", "", 0 );
  79. EntFire( "door2", "Unlock", "", 1 );
  80. EntFire( "door2", "SetGlowEnabled", "", 1 );
  81. }
  82. else if ( wave == 2 )
  83. {
  84. EntFire( "wave_*", "SetDisabled", "", 0 );
  85. EntFire( "wave_03", "SetEnabled", "", 0 );
  86. EntFire( "door3", "Unlock", "", 1 );
  87. EntFire( "door3", "SetGlowEnabled", "", 1 );
  88. }
  89.  
  90. }
Add Comment
Please, Sign In to add comment