Advertisement
Guest User

Untitled

a guest
May 27th, 2018
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.78 KB | None | 0 0
  1. #using scripts\codescripts\struct; // HARRY COMMENT
  2. #using scripts\shared\system_shared; // HARRY COMMENT
  3. #using scripts\shared\array_shared; // HARRY COMMENT
  4. #using scripts\shared\vehicle_shared; // HARRY COMMENT
  5. #using scripts\zm\_zm_score;
  6. #using scripts\shared\flag_shared;
  7. #using scripts\shared\clientfield_shared;
  8. #using scripts\shared\callbacks_shared; // HARRY COMMENT
  9. #using scripts\zm\_zm_utility;
  10. #using scripts\zm\_zm_weapons;
  11. #using scripts\shared\laststand_shared;
  12. #using scripts\shared\util_shared;
  13. #using scripts\shared\flagsys_shared;
  14. #using scripts\shared\hud_util_shared;
  15. #insert scripts\shared\shared.gsh;
  16. #using scripts\zm\_zm_powerups;
  17. #using scripts\zm\_zm_spawner;
  18. #using scripts\zm\_zm_equipment;
  19. #using scripts\shared\ai\zombie_utility;
  20. #using scripts\shared\ai\zombie_death;
  21. #using scripts\zm\_zm;
  22. #using scripts\zm\_zm_audio;
  23.  
  24. thread trigger_end_game();
  25.  
  26. function trigger_end_game()
  27. {
  28. trig = GetEnt("end_game_trig", "targetname");
  29. while(1)
  30. {
  31. trig waittill("trigger", ent);
  32. if( isPlayer( ent ) )
  33. continue;
  34.  
  35. else
  36. end_game_custom();
  37. }
  38. }
  39.  
  40. function end_game_custom()
  41. {
  42.  
  43. zm::check_end_game_intermission_delay();
  44.  
  45. setmatchflag( "game_ended", 1 );
  46.  
  47. level clientfield::set("gameplay_started", 0);
  48. level clientfield::set("game_end_time", int( ( GetTime() - level.n_gameplay_start_time + 500 ) / 1000 ) );
  49.  
  50. util::clientnotify( "zesn" );
  51.  
  52. level thread zm_audio::sndMusicSystem_PlayState( "game_over" );
  53. //PlaySoundAtPosition("gameover_winid", player.origin );
  54. //AYERS: Turn off ANY last stand audio at the end of the game
  55. /*
  56. players = GetPlayers();
  57. for ( i = 0; i < players.size; i++ )
  58. {
  59. players[i] clientfield::set( "zmbLastStand", 0 );
  60. }
  61.  
  62. for ( i = 0; i < players.size; i++ )
  63. {
  64. if ( players[i] laststand::player_is_in_laststand() )
  65. {
  66. players[i] RecordPlayerDeathZombies();
  67. players[i] zm_stats::increment_player_stat( "deaths" );
  68. players[i] zm_stats::increment_client_stat( "deaths" );
  69. }
  70.  
  71. //clean up the revive text hud if it's active
  72. if( isdefined( players[i].reviveTextHud ) )
  73. {
  74. players[i].reviveTextHud destroy();
  75. }
  76. }
  77. */
  78. StopAllRumbles();
  79.  
  80. level.intermission = true;
  81. level.zombie_vars["zombie_powerup_insta_kill_time"] = 0;
  82. level.zombie_vars["zombie_powerup_fire_sale_time"] = 0;
  83. level.zombie_vars["zombie_powerup_double_points_time"] = 0;
  84. wait 0.1;
  85.  
  86. game_over = [];
  87. survived = [];
  88.  
  89. players = GetPlayers();
  90.  
  91. //disabled the ingame pause menu from opening after a game ends
  92. setMatchFlag( "disableIngameMenu", 1 );
  93. foreach( player in players )
  94. {
  95. player closeInGameMenu();
  96. player CloseMenu( "StartMenu_Main" );
  97. }
  98.  
  99.  
  100. //AAR - set stat for each player (this will show the menu)
  101. foreach( player in players )
  102. {
  103. player setDStat( "AfterActionReportStats", "lobbyPopup", "summary" );
  104. }
  105.  
  106. if(!isDefined(level._supress_survived_screen))
  107. {
  108.  
  109. for( i = 0; i < players.size; i++ )
  110. {
  111. You_win[i] = NewClientHudElem( players[i] );
  112. survived[i] = NewClientHudElem( players[i] );
  113. if ( IsDefined( level.custom_game_over_hud_elem ) )
  114. {
  115. [[ level.custom_game_over_hud_elem ]]( players[i], You_win[i], survived[i] );
  116. }
  117. else
  118. {
  119.  
  120. You_win[i].alignX = "center";
  121. You_win[i].alignY = "middle";
  122. You_win[i].horzAlign = "center";
  123. You_win[i].vertAlign = "middle";
  124. You_win[i].y -= 130;
  125. You_win[i].foreground = true;
  126. You_win[i].fontScale = 3;
  127. You_win[i].alpha = 0;
  128. You_win[i].color = ( 1.0, 1.0, 1.0 );
  129. You_win[i].hidewheninmenu = true;
  130. You_win[i] SetText( "You escaped My good Zombie Slayer");
  131.  
  132. You_win[i] FadeOverTime( 1 );
  133. You_win[i].alpha = 1;
  134. if ( players[i] isSplitScreen() )
  135. {
  136. You_win[i].fontScale = 2;
  137. You_win[i].y += 40;
  138. }
  139.  
  140. survived[i].alignX = "center";
  141. survived[i].alignY = "middle";
  142. survived[i].horzAlign = "center";
  143. survived[i].vertAlign = "middle";
  144. survived[i].y -= 100;
  145. survived[i].foreground = true;
  146. survived[i].fontScale = 2;
  147. survived[i].alpha = 0;
  148. survived[i].color = ( 1.0, 1.0, 1.0 );
  149. survived[i].hidewheninmenu = true;
  150. if ( players[i] isSplitScreen() )
  151. {
  152. survived[i].fontScale = 1.5;
  153. survived[i].y += 40;
  154. }
  155. }
  156.  
  157.  
  158. //OLD COUNT METHOD
  159. if( level.round_number < 2 )
  160. {
  161. {
  162. survived[i] SetText( &"ZOMBIE_SURVIVED_ROUND" );
  163. }
  164. }
  165. else
  166. {
  167. survived[i] SetText( &"ZOMBIE_SURVIVED_ROUNDS", level.round_number );
  168. }
  169.  
  170. survived[i] FadeOverTime( 1 );
  171. survived[i].alpha = 1;
  172. }
  173. }
  174.  
  175.  
  176. //check to see if we are in a game module that wants to do something with PvP damage
  177. if(isDefined(level.custom_end_screen))
  178. {
  179. level [[level.custom_end_screen]]();
  180. }
  181.  
  182. for (i = 0; i < players.size; i++)
  183. {
  184. players[i] SetClientUIVisibilityFlag( "weapon_hud_visible", 0 );
  185. players[i] SetClientMiniScoreboardHide( true );
  186. //players[i] setDStat( "AfterActionReportStats", "lobbyPopup", "summary" );
  187.  
  188. players[i] notify( "report_bgb_consumption" );
  189. }
  190.  
  191. //LUINotifyEvent( &"force_scoreboard", 0 );
  192.  
  193. //UploadStats();
  194. //zm_stats::update_players_stats_at_match_end( players );
  195. //zm_stats::update_global_counters_on_match_end();
  196. //zm::upload_leaderboards();
  197.  
  198. //recordGameResult( "draw" );
  199. //globallogic::recordZMEndGameComScoreEvent( "draw" );
  200. //globallogic_player::recordActivePlayersEndGameMatchRecordStats();
  201.  
  202. // Finalize Match Record
  203. finalizeMatchRecord();
  204.  
  205. //zm_utility::play_sound_at_pos( "end_of_game", ( 0, 0, 0 ) );
  206.  
  207. players = GetPlayers();
  208. foreach( player in players )
  209. {
  210. if( IsDefined( player.sessionstate ) && player.sessionstate == "spectator" )
  211. {
  212. player.sessionstate = "playing";
  213. player thread zm::end_game_player_was_spectator();
  214. }
  215. }
  216. WAIT_SERVER_FRAME;
  217.  
  218. players = GetPlayers();
  219.  
  220. LUINotifyEvent( &"force_scoreboard", 1, 1 );
  221.  
  222. zm::intermission();
  223.  
  224. wait( level.zombie_vars["zombie_intermission_time"] );
  225.  
  226. //hide the gameover message
  227. if ( !isDefined( level._supress_survived_screen ) )
  228. {
  229. for ( i = 0; i < players.size; i++ )
  230. {
  231. survived[i] Destroy();
  232. game_over[i] Destroy();
  233. }
  234. }
  235. else
  236. {
  237. for ( i = 0; i < players.size; i++ )
  238. {
  239. if(isDefined(players[i].survived_hud ) )
  240. players[i].survived_hud Destroy();
  241. if (isDefined( players[i].game_over_hud ) )
  242. players[i].game_over_hud Destroy();
  243. }
  244. }
  245.  
  246. level notify( "stop_intermission" );
  247. array::thread_all( GetPlayers(), &player_exit_level );
  248.  
  249. wait( 1.5 );
  250.  
  251. players = GetPlayers();
  252. for ( i = 0; i < players.size; i++ )
  253. {
  254. players[i] CameraActivate( false );
  255. }
  256.  
  257. ExitLevel( false );
  258.  
  259. // Let's not exit the function
  260. wait( 666 );
  261. }
  262.  
  263. function player_exit_level()
  264. {
  265. self AllowStand( true );
  266. self AllowCrouch( false );
  267. self AllowProne( false );
  268. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement