FineNerds

Map Rotation

Oct 22nd, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.50 KB | None | 0 0
  1. #include maps\mp\_utility;
  2. #include common_scripts\utility;
  3. #include maps\mp\gametypes\_hud_util;
  4. #include maps\mp\gametypes\_hud_message;
  5.  
  6. init()
  7. {
  8.     thread onplayerconnect();
  9.     level.mapRotation = [];
  10.     createMapSelection();
  11.     thread mapRotate();
  12. }
  13.  
  14. onplayerconnect()
  15. {
  16.     while(true)
  17.     {
  18.         level waittill("connecting", player);
  19.         player thread onplayerspawned();
  20.         player thread showConnectMessage();
  21.     }
  22. }
  23.  
  24. onplayerspawned()
  25. {
  26.     self endon( "disconnect" );
  27.     displayMessage = true;
  28.     while(true)
  29.     {
  30.         self waittill( "spawned_player" );
  31.        
  32.     }
  33. }
  34.  
  35. showConnectMessage()
  36. {
  37.     self endon( "disconnect" );
  38.     self waittill( "spawned_player" );
  39.     self iprintln("^1Bot Map Rotation^7: ^4Loaded");
  40. }
  41.  
  42. createMapSelection()
  43. {
  44.     level.mapRotation[0] = "mp_la";
  45.     level.mapRotation[1] = "mp_carrier";
  46.     level.mapRotation[2] = "mp_dockside";
  47.     level.mapRotation[3] = "mp_drone";
  48.     level.mapRotation[4] = "mp_express";
  49.     level.mapRotation[5] = "mp_meltdown";
  50.     level.mapRotation[6] = "mp_overflow";
  51.     level.mapRotation[7] = "mp_nightclub";
  52.     level.mapRotation[8] = "mp_raid";
  53.     level.mapRotation[9] = "mp_slums";
  54.     level.mapRotation[10] = "mp_village";
  55.     level.mapRotation[11] = "mp_turbine";
  56.     level.mapRotation[12] = "mp_socotra";
  57.     level.mapRotation[13] = "mp_nuketown_2020";
  58.     level.mapRotation[14] = "mp_hijacked";
  59. }
  60.  
  61. mapRotate()
  62. {
  63.     level waittill("game_ended");
  64.     i = randomIntRange(0, 14);
  65.     map(level.mapRotation[i]);
  66.     self iprintln("New map loading: " + level.mapRotation[i]);
  67.     wait 5;
  68.     map_restart(false);
  69. }
Advertisement
Add Comment
Please, Sign In to add comment