Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. /*
  2. Created by Andy King (treminaor) for UGX-Mods.com. © UGX-Mods 2016
  3. Please include credit if you use this script and do not distribute edited versions of it without my permission.
  4.  
  5. Instructions: https://confluence.ugx-mods.com/display/UGXMODS/BO3+%7C+Adding+Buyable+Ending+to+Zombiemode
  6.  
  7. Version 1.0 10/15/2016 12:55PM
  8. */
  9.  
  10.  
  11. #using scripts\shared\flag_shared;
  12. #using scripts\zm\_zm_score;
  13.  
  14. #define ENDGAME_WAIT_FOR_FLAG "" //if you want the ending to require a flag to be set from another script you have, enter the flag here.
  15. #define ENDGAME_WAIT_FOR_NOTIFY "" //if you want the ending to require a level notify to be sent from another script you have, enter the notify string here.
  16. #define ENDGAME_COST 100000 //how much should it cost to end the game?
  17. #define ENDGAME_CUSTOM_GAME_OVER "YOU ROCK!" //Do you want to replace the "GAME OVER" text? Set it here. If you want the default game over text from zombies, set this to blank.
  18. #define ENDGAME_CUSTOM_TRIGGER_HINT "Press &&1 to escape!" //Customize the endgame trigger hintstring here. Cost will be appended automatically.
  19.  
  20. function autoexec endgame()
  21. {
  22. if(ENDGAME_WAIT_FOR_NOTIFY != "")
  23. level.custom_game_over_hud_elem = &buyable_game_over;
  24.  
  25. ending = getEnt("ending", "targetname");
  26. ending setCursorHint("HINT_NOICON");
  27.  
  28. if(ENDGAME_WAIT_FOR_FLAG != "")
  29. {
  30. level flag::wait_till(ENDGAME_WAIT_FOR_FLAG);
  31. }
  32. else if(ENDGAME_WAIT_FOR_NOTIFY != "")
  33. {
  34. level waittill(ENDGAME_WAIT_FOR_NOTIFY);
  35. }
  36. else
  37. {
  38. ending setHintString(ENDGAME_CUSTOM_TRIGGER_HINT + " [Cost: " + ENDGAME_COST + "]");
  39. }
  40.  
  41. while(1)
  42. {
  43.  
  44. ending waittill("trigger", player);
  45. if(player.score < ENDGAME_COST)
  46. {
  47. wait 0.1;
  48. player playsound("zmb_no_cha_ching");
  49. continue;
  50. }
  51. player zm_score::minus_to_player_score(ENDGAME_COST);
  52. player playsound("zmb_cha_ching");
  53. break;
  54. }
  55.  
  56. level notify("end_game");
  57. }
  58.  
  59. function buyable_game_over(player, game_over, survived)
  60. {
  61. game_over.alignX = "center";
  62. game_over.alignY = "middle";
  63. game_over.horzAlign = "center";
  64. game_over.vertAlign = "middle";
  65. game_over.y -= 130;
  66. game_over.foreground = true;
  67. game_over.fontScale = 3;
  68. game_over.alpha = 0;
  69. game_over.color = ( 1.0, 1.0, 1.0 );
  70. game_over.hidewheninmenu = true;
  71. game_over SetText(ENDGAME_CUSTOM_GAME_OVER);
  72.  
  73. game_over FadeOverTime( 1 );
  74. game_over.alpha = 1;
  75. if ( player isSplitScreen() )
  76. {
  77. game_over.fontScale = 2;
  78. game_over.y += 40;
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement