Advertisement
BaSs_HaXoR

Zombieland GSC BO2 Source Code

Oct 24th, 2014
931
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 101.47 KB | None | 0 0
  1. //Credits: NGU THREAD: http://adf.ly/tFMjd
  2. //ZOMBIELAND
  3. //Download: http://adf.ly/tFMex
  4. //Pastie Last updated: 10-24-14
  5.  
  6.  
  7. //main.gsc
  8. #include maps/mp/gametypes/_globallogic_score;
  9. #include maps/mp/gametypes/_globallogic_utils;
  10. #include maps/mp/_scoreevents;
  11. #include maps/mp/teams/_teams;
  12. #include maps/mp/_utility;
  13. #include common_scripts/utility;
  14. #include maps/mp/gametypes/_hud_util;
  15. #include maps/mp/gametypes/_hud_message;
  16. #include maps/mp/gametypes/_spawnlogic;
  17. #include maps/mp/gametypes/_spawning;
  18. #include maps/mp/killstreaks/_turret_killstreak;
  19.  
  20. init()
  21. {
  22.     PrecacheItem("minigun_wager_mp");
  23.     PrecacheItem("m32_wager_mp");
  24.     PrecacheModel("t6_wpn_supply_drop_ally");
  25.     PrecacheModel("t6_wpn_supply_drop_axis");
  26.     PrecacheModel("t6_wpn_supply_drop_trap");
  27.     PrecacheModel("mp_flag_green");
  28.     PrecacheModel("mp_flag_red");
  29.     PrecacheModel("mp_flag_neutral");
  30.    
  31.     level.spawnedEntities = [];
  32.     level.amountOfSpawnedEntities = 0;
  33.     level.activeZiplines = 0;
  34.     level.activeDoors = 0;
  35.     level.activeMysteryBoxes = 0;
  36.     level.activeObjectiveIndex = 0;
  37.     level.zombiecount = 0;
  38.     level.humancount = 0;
  39.     level.currentgametime = 0;
  40.     level.ingraceperiod = 0;
  41.     level.zombieficationTime = 15; //In Seconds
  42.     level.gametime = 600; //In Seconds
  43.     level.survivorCashBonus = 20;
  44.     level.moneyperkill = 40;
  45.     level.moneyperassist = 20;
  46.     level.moneyperkillzombie = 50;
  47.     level.moneyperzombiedeath = 20;
  48.     level.scoreroundbased = 0;
  49.     level.allow_teamchange = 0;
  50.     level.teamscoreperkill = 0;
  51.     level.teamscoreperdeath = 0;
  52.     level.teamscoreperheadshot = 0;
  53.     level.turretsSpawned = 0;
  54.     level.amountOfBotsToSpawn = 11;
  55.     level.spawnBots = false;
  56.     level.useCustomMaps = true;
  57.     level.timerspawned = false;
  58.     level.zombieSelectionInProgress = true;
  59.     level.hostCantBecomeZombie = true;
  60.     level.supplyDropModel = "t6_wpn_supply_drop_ally";
  61.     level.supplyDropModelAxis = "t6_wpn_supply_drop_axis";
  62.     level.supplyDropModelTrap = "t6_wpn_supply_drop_trap";
  63.     level.teleportFlagStartModel = "mp_flag_green";
  64.     level.teleportFlagEndModel = "mp_flag_red";
  65.     level.teleportFlagBothModel = "mp_flag_neutral";
  66.        
  67.     level thread monitorGame();
  68.     level thread monitorTime();
  69.     level thread informationBar();
  70.     level thread onPlayerConnect();
  71.     level thread zombieCountdown();
  72.     level thread threadMonitor();
  73.     level thread entityMonitor();
  74. }
  75.  
  76. onPlayerConnect()
  77. {
  78.     level endon("game_ended");
  79.    
  80.     for(;;)
  81.     {
  82.         level waittill("connected", player);
  83.         player.status = "human";
  84.         player.threadsReady = false;
  85.         player.giveCash = true;
  86.         player.money = 50;
  87.         player.health = 100;
  88.         player.moneymultiplier = 1;
  89.         player.humandied = 0;
  90.         player.startingZombie = false;
  91.         level.ingraceperiod = 0;
  92.        
  93.         itemPriceSetup();
  94.         player.MenuInit = false;
  95.         player giveMenu();
  96.                
  97.         player thread onPlayerSpawned();
  98.         player thread onPlayerDied();
  99.         player thread onPlayerLeave();
  100.         wait 0.05;
  101.     }
  102. }
  103.  
  104. onPlayerSpawned()
  105. {
  106.     self endon("disconnect");
  107.     level endon("game_ended");
  108.  
  109.     level.ingraceperiod = 0;
  110.     self.healthMonitor = false;
  111.     self.threadsReady = true;
  112.    
  113.     if (getDvar("g_gametype") != "tdm")
  114.         thread maps/mp/gametypes/_globallogic::endgame("tie", "Gametype Must Be ^1Team Deathmatch");
  115.        
  116.     self thread weaponMonitior();
  117.     self thread hudMonitor();
  118.     self thread teamMonitor();
  119.     self thread teamMonitorCustom();
  120.     self thread damageMonitor();
  121.     self welcomeMessage();
  122.     self setupTeamDvars();
  123.  
  124.     self changeteam("allies");
  125.     self notify("menuresponse", "changeclass", "class_smg");
  126.    
  127.     for(;;)
  128.     {      
  129.         self waittill("spawned_player");
  130.        
  131.         if (!isDefined(level.customMapReady) && level.useCustomMaps)
  132.         {
  133.             level thread setupCustomMap();
  134.             level.customMapReady = true;
  135.         }
  136.        
  137.         if (isDefined(self.infraredOn))
  138.             self giveInfraredVisionRaw();
  139.         if (self.status == "zombie")
  140.             self SetModel("c_usa_mp_seal6_sniper_fb");
  141.         else
  142.             self SetModel("c_usa_mp_seal6_lmg_fb");
  143.         self giveSpawnWeapons(self.status);
  144.         wait 0.10;
  145.         self giveSpawnWeapons(self.status);
  146.         wait 0.05;
  147.     }
  148. }
  149.  
  150. onPlayerDied()
  151. {      
  152.     self endon("disconnect");
  153.     level endon("game_ended");
  154.    
  155.     for (;;)
  156.     {
  157.         self waittill("death");
  158.         if (self.status != "zombie" && level.zombieficationTime == 0)
  159.         {
  160.             self notify("infected");
  161.             level.infectedPlayers[getPlayerName(self)] = "infected";
  162.             self changeteam("axis");
  163.             self resetDvars();
  164.             self.status = "zombie";
  165.             self.maxhealth = 100;
  166.             self.currentdeaths = 0;
  167.             self.pers["deaths"] = 0;
  168.             level thread humanDied();
  169.             self.money = 0;
  170.             self thread CreateMenu();
  171.             wait 0.10;
  172.             self thread maps/mp/gametypes/_globallogic_ui::closeMenus();
  173.         }
  174.         wait 0.05;
  175.     }
  176. }
  177.  
  178. onPlayerLeave()
  179. {
  180.     level endon("game_ended");
  181.    
  182.     for (;;)
  183.     {
  184.         self waittill("disconnect");
  185.         self destroyPlayerHuds();
  186.         wait 0.05;
  187.     }
  188. }
  189.  
  190. humanDied()
  191. {
  192.     foreach(player in level.players)
  193.     { player.humandied = 1; wait 0.01; }
  194. }
  195.  
  196. threadMonitor()
  197. {
  198.     level endon("game_ended");
  199.     level endon("winnerDeclared");
  200.    
  201.     wait 1;
  202.     for (;;)
  203.     {
  204.         if (!level.inprematchperiod && level.rankedmatch)
  205.         {
  206.             level.gameforfeited = 0;
  207.             level notify("abort forfeit");
  208.         }
  209.         foreach (player in level.players)
  210.         {
  211.             if (!player.threadsReady)
  212.             {
  213.                 player.status = "human";
  214.                 player.threadsReady = true;
  215.                 player.giveCash = true;
  216.                 player.money = 50;
  217.                 player.health = 100;
  218.                 player.moneymultiplier = 1;
  219.                 player.humandied = 0;
  220.                 player.startingZombie = false;
  221.                 level.ingraceperiod = 0;
  222.                
  223.                 itemPriceSetup();
  224.                 player.MenuInit = false;
  225.                 player giveMenu();
  226.                        
  227.                 player thread onPlayerSpawned();
  228.                 player thread onPlayerDied();
  229.                 player thread onPlayerLeave();
  230.                 player suicide();
  231.                 wait 0.05;
  232.             }
  233.             if (IsDefined(level.infectedPlayers[getPlayerName(player)]))
  234.             {
  235.                 if(level.infectedPlayers[getPlayerName(player)] == "infected" && IsAlive(player) && player.pers["team"] == "allies" && player.status == "human")
  236.                 {
  237.                     player suicide();
  238.                     wait 0.05;
  239.                 }
  240.             }
  241.         }
  242.         wait 0.05;
  243.     }
  244. }
  245.  
  246. teamMonitor()
  247. {
  248.     self endon("disconnect");
  249.    
  250.     for (;;)
  251.     {
  252.         if (self IsSplitScreen())
  253.         {
  254.             //kick(self GetEntityNumber());
  255.         }
  256.         if (self.startingZombie && self.pers["team"] != "axis" && isAlive(self))
  257.         {
  258.             self changeteam("axis");
  259.             self.status = "zombie";
  260.             wait 0.10;
  261.             self notify("menuresponse", "changeclass", "class_smg");
  262.             self.startingZombie = false;
  263.         }
  264.         if (self.pers["team"] == "axis" && self.status == "human")
  265.         {
  266.             self changeteam("allies");
  267.             self.status = "human";
  268.             wait 0.10;
  269.             self notify("menuresponse", "changeclass", "class_smg");
  270.         }
  271.         if (self.pers["team"] == "allies" && self.status == "zombie")
  272.         {
  273.             self changeteam("axis");
  274.             self.status = "zombie";
  275.             wait 0.10;
  276.             self notify("menuresponse", "changeclass", "class_smg");
  277.         }
  278.         if (self.pers["team"] == "axis" && self.status == "human")
  279.         {
  280.             if (!level.inprematchperiod && level.zombieficationTime > 0)
  281.             {
  282.                 self changeteam("allies");
  283.                 self.status = "human";
  284.                 wait 1;
  285.                 if (self.pers["team"] == "axis" && level.zombieficationTime > 0 && self.status != "zombie")
  286.                 {
  287.                     self changeteam("allies");
  288.                     self.status = "human";
  289.                     wait 0.50;
  290.                     self notify("menuresponse", "changeclass", "class_smg");
  291.                     if (self.pers["team"] == "axis")
  292.                     {
  293.                         self changeteam("axis");
  294.                         self.status = "zombie";
  295.                         wait 0.10;
  296.                         self notify("menuresponse", "changeclass", "class_smg");
  297.                     }
  298.                 }
  299.             }
  300.         }
  301.         wait 0.01;
  302.     }
  303. }
  304.  
  305.  
  306. teamMonitorCustom()
  307. {
  308.     self endon("disconnect");
  309.    
  310.     for (;;)
  311.     {
  312.         self waittill("joined_team");
  313.         wait 0.10;
  314.         if (self.status == "human" && self.pers["team"] == "axis")
  315.         {
  316.             self changeteam("allies");
  317.             self.status = "human";
  318.             wait 0.10;
  319.             self notify("menuresponse", "changeclass", "class_smg");
  320.         }
  321.         if (self.status == "zombie" && self.pers["team"] == "allies")
  322.         {
  323.             self changeteam("axis");
  324.             self.status = "zombie";
  325.             wait 0.10;
  326.             self notify("menuresponse", "changeclass", "class_smg");
  327.             self thread maps/mp/gametypes/_globallogic_ui::closeMenus();
  328.         }
  329.         wait 0.05;
  330.     }
  331. }
  332.  
  333. damageMonitor()
  334. {
  335.     self endon("disconnect");
  336.    
  337.     for (;;)
  338.     {
  339.         if (self.status == "zombie")
  340.         {
  341.             self waittill("damage", damage, attacker, direction, point, type, tagname, modelname, partname, weaponname);
  342.             if (type == "MOD_FALLING")
  343.             {
  344.                 self.giveCash = false;
  345.                 self waittill("spawned_player");
  346.                 self.giveCash = true;
  347.             }
  348.         }
  349.         wait 0.01;
  350.     }
  351. }
  352.  
  353. monitorGame()
  354. {
  355.     level endon("game_ended");
  356.     level endon("winnerDeclared");
  357.     level.timeToPauseGame = 10;
  358.    
  359.     wait 1;
  360.     for (;;)
  361.     {
  362.         if (!level.inprematchperiod)
  363.         {
  364.             if (level.currentgametime == level.timeToPauseGame)
  365.                 pausetimer();
  366.             level.zombiecount = 0;
  367.             level.humancount = 0;
  368.             wait 0.05;
  369.             foreach(player in level.players)
  370.             {
  371.                 if (player.status == "zombie")
  372.                     level.zombiecount += 1;
  373.                 if (player.status == "human")
  374.                     level.humancount += 1;
  375.                 if (level.zombieSelectionInProgress)
  376.                     level.zombiecount = 1337;
  377.                     wait 0.05;
  378.             }
  379.             if (level.zombiecount == 0 && level.zombieficationTime == 0 && !level.zombieSelectionInProgress)
  380.             {
  381.                 level thread selectRandomPlayers();
  382.             }
  383.             if (level.zombiecount == level.players.size && level.humancount == 0)
  384.             {
  385.                 level thread finishGame();
  386.                 level thread maps/mp/gametypes/_globallogic::endgame("axis", "Zombies Win");
  387.                 level notify("winnerDeclared");
  388.             }
  389.             if (level.currentgametime == level.gametime)
  390.             {
  391.                 level thread finishGame();
  392.                 level thread maps/mp/gametypes/_globallogic::endgame("allies", "Humans Win");
  393.                 level notify("winnerDeclared");
  394.             }
  395.             wait 0.05;
  396.         }
  397.         wait 0.05;
  398.     }
  399. }
  400.  
  401. finishGame()
  402. {
  403.     level.TimeHUD FadeOverTime(0.50);
  404.     level.TimeHUD.alpha = 0;
  405.     level.ClockHUD FadeOverTime(0.50);
  406.     level.ClockHUD.alpha = 0;
  407.    
  408.     level thread destroyHuds();
  409. }
  410.  
  411. monitorTime()
  412. {
  413.     level endon("game_ended");
  414.     level endon("winnerDeclared");
  415.    
  416.     wait 1;
  417.     for (;;)
  418.     {
  419.         if (!level.inprematchperiod && level.timerspawned)
  420.         {
  421.             if (level.currentgametime != level.gametime)
  422.                 level.currentgametime += 1;
  423.             else
  424.                 level notify("timelimit_reached");
  425.         }
  426.         wait 1;
  427.     }
  428. }
  429.  
  430. weaponMonitior()
  431. {
  432.     self endon("disconnect");
  433.     level endon("game_ended");
  434.     level endon("winnerDeclared");
  435.    
  436.     for (;;)
  437.     {
  438.         if (self.status == "human" && isAlive(self) && level.inprematchperiod && level.zombieficationTime != 0)
  439.         {
  440.             self.currentWeapon = self GetCurrentWeapon();
  441.             if (self.currentWeapon != level.playerspawnweapon)
  442.             {
  443.                 self.status = "human";
  444.                 self giveSpawnWeapons(self.status);
  445.                 wait 2;
  446.             }
  447.         }
  448.         wait 0.05;
  449.     }
  450. }
  451.  
  452. zombieCountdown()
  453. {
  454.     level endon("game_ended");
  455.     level endon("winnerDeclared");
  456.     level endon("zombieficationDone");
  457.    
  458.     wait 1;
  459.     for (;;)
  460.     {
  461.         if (!level.inprematchperiod && !level.timerspawned)
  462.         {
  463.             level.TimeHUD = self drawText("Time Remaining: ", "objective", 2, 0, -30, (1, 1, 1), 0, (0, 0, 1), 0.50, 3, true);
  464.             level.TimeHUD.alignX = "center";
  465.             level.TimeHUD.alignY = "top";
  466.             level.TimeHUD.horzAlign = "center";
  467.             level.TimeHUD.vertAlign = "top";
  468.             level.TimeHUD FadeOverTime(0.50);
  469.             level.TimeHUD.alpha = 1;
  470.        
  471.             level.ClockHUD = self drawText("", "objective", 2, 75, -30, (1, 1, 1), 0, (0, 0, 1), 0.50, 3, true);
  472.             level.ClockHUD.alignX = "center";
  473.             level.ClockHUD.alignY = "top";
  474.             level.ClockHUD.horzAlign = "center";
  475.             level.ClockHUD.vertAlign = "top";
  476.             level.ClockHUD setTimer(level.gametime);
  477.             level.ClockHUD FadeOverTime(0.50);
  478.             level.ClockHUD.alpha = 1;
  479.             level.timerspawned = true;
  480.         }
  481.         if (level.zombieficationTime != 0 && !level.inprematchperiod)
  482.         {
  483.             iPrintlnBold("^1Zombiefication In " + level.zombieficationTime + " Seconds");
  484.             wait 5;
  485.             level.zombieficationTime -= 5;
  486.         }
  487.         if (level.zombieficationTime == 0)
  488.         {
  489.             level thread selectRandomPlayers();
  490.             iPrintlnBold("^1Zombies Have Been Released...");
  491.             level notify("zombieficationDone");
  492.         }
  493.         wait 0.05;
  494.     }
  495. }
  496.  
  497. hudMonitor()
  498. {
  499.     self endon("disconnect");
  500.     level endon("game_ended");
  501.     level endon("winnerDeclared");
  502.    
  503.     self storeHuds();
  504.     self.currentkills = self.pers["kills"];
  505.     self.currentdeaths = self.pers["deaths"];
  506.     self.currentassists = self.pers["assists"];
  507.     for (;;)
  508.     {
  509.         if (self.giveCash)
  510.         {
  511.             if (self.humandied == 1)
  512.             {
  513.                 if (self.status == "human")
  514.                 {
  515.                     self.money += level.survivorCashBonus;
  516.                     self iPrintln("You Have Been Given ^2$" + level.survivorCashBonus + " ^7Survivor Cash Bonus");
  517.                 }
  518.                 self.humandied = 0;
  519.                 wait 0.01;
  520.             }
  521.             if (self.pers["kills"] != self.currentkills)
  522.             {
  523.                 if (self.status == "human")
  524.                 {
  525.                     self.money += level.moneyperkill * self.moneymultiplier;
  526.                     self.currentkills = self.pers["kills"];
  527.                 }
  528.                 if (self.status == "zombie")
  529.                 {
  530.                     self.money += level.moneyperkillzombie * self.moneymultiplier;
  531.                     self.currentkills = self.pers["kills"];
  532.                 }
  533.             }
  534.             if (self.pers["assists"] != self.currentassists)
  535.             {
  536.                 if (self.status == "human")
  537.                 {
  538.                     self.money += level.moneyperassist * self.moneymultiplier;
  539.                     self.currentassists = self.pers["assists"];
  540.                 }
  541.                 if (self.status == "zombie")
  542.                 {
  543.                     self.money += level.moneyperassist * self.moneymultiplier;
  544.                     self.currentassists = self.pers["assists"];
  545.                 }
  546.             }
  547.             else if (self.pers["deaths"] != self.currentdeaths && self.status == "zombie")
  548.             {
  549.                 self.money += level.moneyperzombiedeath * self.moneymultiplier;
  550.                 self.currentdeaths = self.pers["deaths"];
  551.             }
  552.         }
  553.         else
  554.         {
  555.             self.currentkills = self.pers["kills"];
  556.             self.currentdeaths = self.pers["deaths"];
  557.             self.currentassists = self.pers["assists"];
  558.         }
  559.         self.HealthValue setValue(self.health);
  560.         self.MoneyValue setValue(self.money);
  561.         wait 0.05;
  562.     }
  563. }
  564.  
  565. informationBar()
  566. {
  567.     level endon("game_ended");
  568.    
  569.     level.infoBarBackground = level drawShader("white", -50, 30, 1000, 35, (0, 0, 0), 0.50, 7, true);
  570.     level.infoBarBackground.alignX = "center";
  571.     level.infoBarBackground.alignY = "bottom";
  572.     level.infoBarBackground.horzAlign = "center";
  573.     level.infoBarBackground.vertAlign = "bottom";
  574.    
  575.     level.infoBarText = level drawText("Welcome To ^5Sharks ^1Zombieland^7 | [{+actionslot 1}] To ^2Open ^7The Shop | [{+actionslot 3}] To ^1Close ^7The Shop | [{+gostand}] To Select Options | [{+usereload}] To Go Back", "objective", 2, 1000, 26, (1, 1, 1), 1, (0, 0, 0), 0, 10, true);  
  576.     level.infoBarText.alignX = "center";
  577.     level.infoBarText.alignY = "bottom";
  578.     level.infoBarText.horzAlign = "center";
  579.     level.infoBarText.vertAlign = "bottom";
  580.    
  581.     for (;;)
  582.     {
  583.         if (level.infoBarText.x == -1000)
  584.             level.infoBarText.x = 1000;
  585.         else
  586.         {
  587.             level.infoBarText MoveOverTime(20);
  588.             level.infoBarText.x = -1000;
  589.             wait 25;
  590.         }
  591.         wait 0.05;
  592.     }
  593. }
  594.  
  595.  
  596. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  597.  
  598. //functions.gsc
  599.  
  600. spawnBots()
  601. {
  602.     if(!isDefined(level.botsHaveBeenSpawned))
  603.     {
  604.         level.botsHaveBeenSpawned = true;
  605.         for (i = 0; i <= level.amountOfBotsToSpawn; i++)
  606.         {
  607.             maps/mp/bots/_bot::spawn_bot("autoassign");
  608.         }
  609.     }
  610. }
  611.  
  612. drawValue(value, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
  613. {
  614.     if (!isDefined(allclients))
  615.         allclients = false;
  616.    
  617.     if (!allclients)
  618.         hud = self createFontString(font, fontScale);
  619.     else
  620.         hud = level createServerFontString(font, fontScale);
  621.     hud setValue(value);
  622.     hud.x = x;
  623.     hud.y = y;
  624.     hud.color = color;
  625.     hud.alpha = alpha;
  626.     hud.glowColor = glowColor;
  627.     hud.glowAlpha = glowAlpha;
  628.     hud.sort = sort;
  629.     hud.alpha = alpha;
  630.     return hud;
  631. }
  632.  
  633. drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
  634. {
  635.     if (!isDefined(allclients))
  636.         allclients = false;
  637.    
  638.     if (!allclients)
  639.         hud = self createFontString(font, fontScale);
  640.     else
  641.         hud = level createServerFontString(font, fontScale);
  642.     hud setText(text);
  643.     hud.x = x;
  644.     hud.y = y;
  645.     hud.color = color;
  646.     hud.alpha = alpha;
  647.     hud.glowColor = glowColor;
  648.     hud.glowAlpha = glowAlpha;
  649.     hud.sort = sort;
  650.     hud.alpha = alpha;
  651.     return hud;
  652. }
  653.  
  654. drawShader(shader, x, y, width, height, color, alpha, sort, allclients)
  655. {
  656.     if (!isDefined(allclients))
  657.         allclients = false;
  658.    
  659.     if (!allclients)
  660.         hud = newClientHudElem(self);
  661.     else
  662.         hud = newHudElem();
  663.     hud.elemtype = "icon";
  664.     hud.color = color;
  665.     hud.alpha = alpha;
  666.     hud.sort = sort;
  667.     hud.children = [];
  668.     hud setParent(level.uiParent);
  669.     hud setShader(shader, width, height);
  670.     hud.x = x;
  671.     hud.y = y;
  672.     return hud;
  673. }
  674.  
  675. drawBar(color, width, height, align, relative, x, y)
  676. {
  677.     bar = createBar(color, width, height, self);
  678.     bar setPoint(align, relative, x, y);
  679.     bar.hideWhenInMenu = true;
  680.     return bar;
  681. }
  682.  
  683. welcomeMessage()
  684. {
  685.     notifyData = spawnstruct();
  686.     notifyData.titleText = "Welcome " + self.name + " To ^1Zombieland";
  687.     notifyData.notifyText = "Made By ^5Shark";
  688.     notifyData.glowColor = (0.3, 0.6, 0.3);
  689.     notifyData.duration = 8;
  690.     notifyData.font = "objective";
  691.     notifyData.hideWhenInMenu = false;
  692.     self thread maps/mp/gametypes/_hud_message::notifyMessage(notifyData);
  693. }
  694.  
  695. SendError(errortype)
  696. {
  697.     if (errortype == "MoreMoney")
  698.         self iPrintln("^1Error: ^7You Do Not Have Enough Money For This Item");
  699.     if (errortype == "InvalidWeaponAttachment")
  700.         self iPrintln("^1Error: ^7You Cannot Put This Attachment On This Weapon");
  701.     if (errortype == "InvalidWeapon")
  702.         self iPrintln("^1Error: ^7You Are Holding An Invalid Weapon");
  703.     if (errortype == "AlreadyHasWeapon")
  704.         self iPrintln("^1Error: ^7You Already Own This Weapon");
  705.     if (errortype == "AlreadyHasAttachment")
  706.         self iPrintln("^1Error: ^7You Already Have This Attachment");
  707.     if (errortype == "MaxAmmo")
  708.         self iPrintln("^1Error: ^7You Already Maximum Ammo For This Weapon");
  709.     if (errortype == "AlreadyHasUAV")
  710.         self iPrintln("^1Error: ^7You Already Have A UAV");
  711.     if (errortype == "MaxTurrets")
  712.         self iPrintln("^1Error: ^7Max Number of Turrets Reached!");
  713.     if (errortype == "AlreadyHaveEquipment")
  714.         self iPrintln("^1Error: ^7You Already Have This Equipment");
  715.     if (errortype == "HasPerk")
  716.         self iPrintln("^1Error: ^7You Already Have This Perk");
  717.     if (errortype == "AlreadyInvisible")
  718.         self iPrintln("^1Error: ^7You Are Already Invisible");
  719.     if (errortype == "AlreadySlowedHumans")
  720.         self iPrintln("^1Error: ^7Humans Have Already Been Slowed");
  721.     if (errortype == "AlreadyHasInfrared")
  722.         self iPrintln("^1Error: ^7You Already Have Infrared Vision");
  723.     if (errortype == "AlreadyHasInfiniteAmmo")
  724.         self iPrintln("^1Error: ^7You Already Have Infinite Ammo");
  725. }
  726.  
  727. givePlayerWeapon(weapon)
  728. {      
  729.     self GiveWeapon(weapon);
  730.     ammo = weaponClipSize(weapon);
  731.     self GiveStartAmmo(weapon);
  732.     self setWeaponAmmoClip(weapon, ammo);
  733.     self SwitchToWeapon(weapon);
  734. }
  735.  
  736. locationSelector()
  737. {
  738.     self endon("disconnect");
  739.     self endon("death");
  740.  
  741.     self beginLocationSelection( "map_mortar_selector" );
  742.     self disableoffhandweapons();
  743.     self giveWeapon( "killstreak_remote_turret_mp" );
  744.     self switchToWeapon( "killstreak_remote_turret_mp" );
  745.     self.selectingLocation = 1;
  746.     self waittill("confirm_location", location);
  747.     newLocation = BulletTrace(location + (0, 0, 100000), location, false, self)["position"];
  748.     self endLocationSelection();
  749.     self EnableOffHandWeapons();
  750.     self switchToWeapon(self maps\mp\_utility::getlastweapon());
  751.     self.selectingLocation = undefined;
  752.     return newLocation;
  753. }
  754.  
  755. itemPriceSetup()
  756. {
  757.     level.itemPrice["Human"]["General"]["UAV"] = 250;
  758.     level.itemPrice["Human"]["General"]["Health"] = 90;
  759.     level.itemPrice["Human"]["General"]["Turret"] = 300;
  760.     level.itemPrice["Human"]["General"]["Infrared"] = 100;
  761.    
  762.     level.itemPrice["Zombie"]["General"]["UAV"] = 400;
  763.     level.itemPrice["Zombie"]["General"]["Health"] = 150;
  764.     level.itemPrice["Zombie"]["General"]["Invisible"] = 450;
  765.     level.itemPrice["Zombie"]["General"]["SlowHumans"] = 350;
  766.     level.itemPrice["Zombie"]["General"]["Infrared"] = 100;
  767.    
  768.     level.itemPrice["Human"]["Equipment"]["claymore_mp"] = 60;
  769.     level.itemPrice["Human"]["Equipment"]["sticky_grenade_mp"] = 50;
  770.     level.itemPrice["Human"]["Equipment"]["frag_grenade_mp"] = 50;
  771.     level.itemPrice["Human"]["Equipment"]["satchel_charge_mp"] = 90;
  772.     level.itemPrice["Human"]["Equipment"]["proximity_grenade_mp"] = 30;
  773.     level.itemPrice["Human"]["Equipment"]["concussion_grenade_mp"] = 40;
  774.     level.itemPrice["Human"]["Equipment"]["claymore_mp"] = 60;
  775.    
  776.     level.itemPrice["Zombie"]["Equipment"]["hatchet_mp"] = 70;
  777.     level.itemPrice["Zombie"]["Equipment"]["emp_grenade_mp"] = 120;
  778.    
  779.     level.itemPrice["Human"]["Perks"]["specialty_fallheight"] = 30;
  780.     level.itemPrice["Human"]["Perks"]["specialty_fastads"] = 40;
  781.     level.itemPrice["Human"]["Perks"]["specialty_unlimitedsprint"] = 30;
  782.     level.itemPrice["Human"]["Perks"]["specialty_fastweaponswitch"] = 40;
  783.     level.itemPrice["Human"]["Perks"]["specialty_loudenemies"] = 30;
  784.     level.itemPrice["Human"]["Perks"]["specialty_fastmantle"] = 30;
  785.     level.itemPrice["Human"]["Perks"]["specialty_movefaster"] = 30;
  786.    
  787.     level.itemPrice["Human"]["Weapons"]["Ammo"] = 70;
  788.     level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"] = 650;
  789.     level.itemPrice["Human"]["Weapons"]["Submachine"] = 200;
  790.     level.itemPrice["Human"]["Weapons"]["Assault"] = 250;
  791.     level.itemPrice["Human"]["Weapons"]["Shotguns"] = 280;
  792.     level.itemPrice["Human"]["Weapons"]["Lightmachine"] = 300; 
  793.     level.itemPrice["Human"]["Weapons"]["Snipers"] = 140;
  794.     level.itemPrice["Human"]["Weapons"]["Pistols"] = 100;
  795.     level.itemPrice["Human"]["Weapons"]["Launchers"] = 120;
  796.     level.itemPrice["Human"]["Weapons"]["Specials"] = 180;
  797.     level.itemPrice["Human"]["Weapons"]["SuperSpecials"] = 400;
  798.     level.itemPrice["Human"]["Weapons"]["Equipment"] = 80;
  799.    
  800.     level.itemPrice["Human"]["Attachments"]["fmj"] = 120; //FMJ
  801.     level.itemPrice["Human"]["Attachments"]["dw"] = 120; //Dual Wield (_dw_mp)
  802.     level.itemPrice["Human"]["Attachments"]["silencer"] = 100; //Suppressor
  803.     level.itemPrice["Human"]["Attachments"]["dualclip"] = 80; //Fast Mag
  804.     level.itemPrice["Human"]["Attachments"]["extclip"] = 90; //Extended Clip
  805.     level.itemPrice["Human"]["Attachments"]["extbarrel"] = 90; //Long Barrel
  806.     level.itemPrice["Human"]["Attachments"]["reflex"] = 30; //Reflex Sight
  807.     level.itemPrice["Human"]["Attachments"]["ir"] = 50; //Dual Band
  808.     level.itemPrice["Human"]["Attachments"]["rf"] = 120; //Rapid Fire
  809. }
  810.  
  811. invisible(time)
  812. {
  813.     if (self.money >= level.itemPrice["Zombie"]["General"]["Invisible"])
  814.     {
  815.         if (!isDefined(self.isInvisible))
  816.         {
  817.             self endon("disconnect");
  818.             self endon("endInvisible");
  819.            
  820.             self.invisibleTime = time;
  821.             self.money -= level.itemPrice["Zombie"]["General"]["Invisible"];
  822.             self iPrintln("You Are Now ^2Invisible ^7For " + time + " Seconds");
  823.             for (;;)
  824.             {
  825.                 if (self.invisibleTime != 0)
  826.                 {
  827.                     self.isInvisible = true;
  828.                     self hide();
  829.                     wait 1;
  830.                     self.invisibleTime -= 1;
  831.                 }
  832.                 else
  833.                 {
  834.                     self show();
  835.                     self iPrintln("You Are ^1No Longer ^7Invisible");
  836.                     self.isInvisible = undefined;
  837.                     self notify("endInvisible");
  838.                 }
  839.                 wait 0.01;
  840.             }
  841.         }
  842.         else
  843.             self SendError("AlreadyInvisible");
  844.     }
  845.     else
  846.         self SendError("MoreMoney");
  847. }
  848.  
  849. getPlayerName(player)
  850. {
  851.     playerName = getSubStr(player.name, 0, player.name.size);
  852.     for(i=0; i < playerName.size; i++)
  853.     {
  854.         if(playerName[i] == "]")
  855.             break;
  856.     }
  857.     if(playerName.size != i)
  858.         playerName = getSubStr(playerName, i + 1, playerName.size);
  859.     return playerName;
  860. }
  861.  
  862. ReturnAttachmentArray(category)
  863. {
  864.     level.AttachmentArray["Submachine"][0] = "reflex"; //Reflex Sight
  865.     level.AttachmentArray["Submachine"][1] = "steadyaim"; //Laser
  866.     level.AttachmentArray["Submachine"][2] = "silencer"; //Suppressor
  867.     level.AttachmentArray["Submachine"][3] = "dualclip"; //Fast Mag
  868.     level.AttachmentArray["Submachine"][4] = "holo"; //EOTech
  869.     level.AttachmentArray["Submachine"][5] = "grip"; //Fore Grip
  870.     level.AttachmentArray["Submachine"][6] = "fastads"; //Quickdraw
  871.     level.AttachmentArray["Submachine"][7] = "fmj"; //FMJ
  872.     level.AttachmentArray["Submachine"][8] = "extbarrel"; //Long Barrel
  873.     level.AttachmentArray["Submachine"][9] = "rangefinder"; //Target Finder
  874.     level.AttachmentArray["Submachine"][10] = "stalker"; //Stock
  875.     level.AttachmentArray["Submachine"][11] = "extclip"; //Extended Clip
  876.     level.AttachmentArray["Submachine"][12] = "sf"; //Select Fire
  877.     level.AttachmentArray["Submachine"][13] = "rf"; //Rapid Fire
  878.     level.AttachmentArray["Submachine"][14] = "mms"; //MMS
  879.    
  880.     level.AttachmentArray["Assault"][0] = "reflex"; //Reflex Sight
  881.     level.AttachmentArray["Assault"][1] = "fastads"; //Laser
  882.     level.AttachmentArray["Assault"][2] = "dualclip"; //Supressor
  883.     level.AttachmentArray["Assault"][3] = "acog"; //Fast Mag
  884.     level.AttachmentArray["Assault"][4] = "grip"; //Grip
  885.     level.AttachmentArray["Assault"][5] = "stalker"; //Stock
  886.     level.AttachmentArray["Assault"][6] = "rangefinder"; //Target Finder
  887.     level.AttachmentArray["Assault"][7] = "steadyaim"; //Laser
  888.     level.AttachmentArray["Assault"][8] = "sf"; //Select Fire
  889.     level.AttachmentArray["Assault"][9] = "holo"; //EOTech
  890.     level.AttachmentArray["Assault"][10] = "silencer"; //Suppressor
  891.     level.AttachmentArray["Assault"][11] = "fmj"; //FMJ
  892.     level.AttachmentArray["Assault"][12] = "dualoptic"; //Hybrid Optic
  893.     level.AttachmentArray["Assault"][13] = "extclip"; //Extended Clip
  894.     level.AttachmentArray["Assault"][14] = "gl"; //Grenade Launcher
  895.     level.AttachmentArray["Assault"][15] = "mms"; //MMS
  896.    
  897.     level.AttachmentArray["Shotguns"][0] = "reflex"; //Reflex Sight
  898.     level.AttachmentArray["Shotguns"][1] = "extbarrel"; //Long Barrel
  899.     level.AttachmentArray["Shotguns"][2] = "dualclip"; //Fast Mag
  900.     level.AttachmentArray["Shotguns"][3] = "steadyaim"; //Laser
  901.     level.AttachmentArray["Shotguns"][4] = "stalker"; //Stock
  902.     level.AttachmentArray["Shotguns"][5] = "silencer"; //Suppressor
  903.     level.AttachmentArray["Shotguns"][6] = "extclip"; //Extended Clip
  904.     level.AttachmentArray["Shotguns"][7] = "fastads"; //Quickdraw
  905.     level.AttachmentArray["Shotguns"][8] = "mms"; //MMS
  906.    
  907.     level.AttachmentArray["Lightmachine"][0] = "holo"; //EOTech
  908.     level.AttachmentArray["Lightmachine"][1] = "grip"; //Fore Grip
  909.     level.AttachmentArray["Lightmachine"][2] = "fmj"; //FMJ
  910.     level.AttachmentArray["Lightmachine"][3] = "reflex"; //Reflex Sight
  911.     level.AttachmentArray["Lightmachine"][4] = "fastads"; //Quickdraw
  912.     level.AttachmentArray["Lightmachine"][5] = "rangefinder"; //Target Finder
  913.     level.AttachmentArray["Lightmachine"][6] = "stalker"; //Stock
  914.     level.AttachmentArray["Lightmachine"][7] = "acog"; //ACOG
  915.     level.AttachmentArray["Lightmachine"][8] = "steadyaim"; //Laser
  916.     level.AttachmentArray["Lightmachine"][9] = "silencer"; //Suppressor
  917.     level.AttachmentArray["Lightmachine"][10] = "vzoom"; //Variable Zoom
  918.     level.AttachmentArray["Lightmachine"][11] = "extclip"; //Extended Clip
  919.     level.AttachmentArray["Lightmachine"][12] = "dualoptic"; //Hybrid Optic
  920.     level.AttachmentArray["Lightmachine"][13] = "rf"; //Rapid Fire
  921.     level.AttachmentArray["Lightmachine"][14] = "ir"; //Dual Band
  922.    
  923.     level.AttachmentArray["Snipers"][0] = "silencer"; //Suppressor
  924.     level.AttachmentArray["Snipers"][1] = "swayreduc"; //Ballistics CPU
  925.     level.AttachmentArray["Snipers"][2] = "vzoom"; //Variable Zoom
  926.     level.AttachmentArray["Snipers"][3] = "dualclip"; //Fast Mag
  927.     level.AttachmentArray["Snipers"][4] = "fmj"; //FMJ
  928.     level.AttachmentArray["Snipers"][5] = "acog"; //ACOG
  929.     level.AttachmentArray["Snipers"][6] = "extclip"; //Extended Clip
  930.     level.AttachmentArray["Snipers"][7] = "steadyaim"; //Laser
  931.     level.AttachmentArray["Snipers"][8] = "ir"; //Dual Band
  932.    
  933.     level.AttachmentArray["Pistols"][0] = "reflex"; //Reflex
  934.     level.AttachmentArray["Pistols"][1] = "extclip"; //Extended Clip
  935.     level.AttachmentArray["Pistols"][2] = "steadyaim"; //Laser
  936.     level.AttachmentArray["Pistols"][3] = "extbarrel"; //Long Barrel
  937.     level.AttachmentArray["Pistols"][4] = "fmj"; //FMJ
  938.     level.AttachmentArray["Pistols"][5] = "dualclip"; //Fast Mag
  939.     level.AttachmentArray["Pistols"][6] = "silencer"; //Suppressor
  940.     level.AttachmentArray["Pistols"][7] = "tacknife"; //Tactical Knife
  941.     level.AttachmentArray["Pistols"][8] = "dw"; //Dual Wield (_dw_mp)
  942.    
  943.     level.AttachmentArray["Specials"][0] = "reflex"; //Reflex Sight
  944.     level.AttachmentArray["Specials"][1] = "acog"; //ACOG
  945.     level.AttachmentArray["Specials"][2] = "ir"; //Dual Band
  946.     level.AttachmentArray["Specials"][3] = "vzoom"; //Variable Zoom
  947.     level.AttachmentArray["Specials"][4] = "stackfire"; //Tri-Bolt
  948.    
  949.     level.AttachmentArray["All"][0] = "acog"; //ACOG
  950.     level.AttachmentArray["All"][1] = "defaultattachment"; //Nothing
  951.     level.AttachmentArray["All"][2] = "dualclip"; //Fast Mag
  952.     level.AttachmentArray["All"][3] = "dualoptic"; //Hybrid Optic
  953.     level.AttachmentArray["All"][4] = "dw"; //Dual Wierd (_dw_mp)
  954.     level.AttachmentArray["All"][5] = "extbarrel"; //Long Barrel
  955.     level.AttachmentArray["All"][6] = "extclip"; //Extended Clip
  956.     level.AttachmentArray["All"][7] = "fastads"; //Quickdraw
  957.     level.AttachmentArray["All"][8] = "fmj"; //FMJ
  958.     level.AttachmentArray["All"][9] = "gl"; //Grenade Launcher
  959.     level.AttachmentArray["All"][10] = "grip"; //Fore Grip
  960.     level.AttachmentArray["All"][11] = "holo"; //EOTech
  961.     level.AttachmentArray["All"][12] = "ir"; //Dual Band
  962.     level.AttachmentArray["All"][13] = "is"; //?
  963.     level.AttachmentArray["All"][14] = "mms"; //MMS
  964.     level.AttachmentArray["All"][15] = "rangefinder"; //Target Finder
  965.     level.AttachmentArray["All"][16] = "reflex"; //Reflex Sight
  966.     level.AttachmentArray["All"][17] = "rf"; //Rapid Fire
  967.     level.AttachmentArray["All"][18] = "sf"; //Select Fire
  968.     level.AttachmentArray["All"][19] = "silencer"; //Suppressor
  969.     level.AttachmentArray["All"][20] = "stackfire"; //Tri-Bolt
  970.     level.AttachmentArray["All"][21] = "stalker"; //Stock
  971.     level.AttachmentArray["All"][22] = "steadyaim"; //Laser
  972.     level.AttachmentArray["All"][23] = "swayreduc"; //Ballistics CPU
  973.     level.AttachmentArray["All"][24] = "tacknife"; //Tactical Knife
  974.     level.AttachmentArray["All"][25] = "vzoom"; //Variable Zoom
  975.    
  976.     if (category == "Submachine")
  977.         return level.AttachmentArray["Submachine"];
  978.     if (category == "Assault")
  979.         return level.AttachmentArray["Assault"];
  980.     if (category == "Shotguns")
  981.         return level.AttachmentArray["Shotguns"];
  982.     if (category == "Lightmachine")
  983.         return level.AttachmentArray["Lightmachine"];
  984.     if (category == "Snipers")
  985.         return level.AttachmentArray["Snipers"];
  986.     if (category == "Pistols")
  987.         return level.AttachmentArray["Pistols"];
  988.     if (category == "Specials")
  989.         return level.AttachmentArray["Specials"];
  990.     if (category == "All")
  991.         return level.AttachmentArray["All"];
  992. }
  993.  
  994. ReturnWeaponArray(category)
  995. {
  996.     level.WeaponArray["Submachine"][0] = "mp7_mp";
  997.     level.WeaponArray["Submachine"][1] = "pdw57_mp";
  998.     level.WeaponArray["Submachine"][2] = "vector_mp";
  999.     level.WeaponArray["Submachine"][3] = "insas_mp";
  1000.     level.WeaponArray["Submachine"][4] = "qcw05_mp";
  1001.     level.WeaponArray["Submachine"][5] = "evoskorpion_mp";
  1002.     level.WeaponArray["Submachine"][6] = "peacekeeper_mp";
  1003.    
  1004.     level.WeaponArray["Assault"][0] = "tar21_mp";
  1005.     level.WeaponArray["Assault"][1] = "type95_mp";
  1006.     level.WeaponArray["Assault"][2] = "sig556_mp";
  1007.     level.WeaponArray["Assault"][3] = "sa58_mp";
  1008.     level.WeaponArray["Assault"][4] = "hk416_mp";
  1009.     level.WeaponArray["Assault"][5] = "scar_mp";
  1010.     level.WeaponArray["Assault"][6] = "saritch_mp";
  1011.     level.WeaponArray["Assault"][7] = "xm8_mp";
  1012.     level.WeaponArray["Assault"][8] = "an94_mp";
  1013.    
  1014.     level.WeaponArray["Shotguns"][0] = "870mcs_mp";
  1015.     level.WeaponArray["Shotguns"][1] = "saiga12_mp";
  1016.     level.WeaponArray["Shotguns"][2] = "ksg_mp";
  1017.     level.WeaponArray["Shotguns"][3] = "srm1216_mp";
  1018.    
  1019.     level.WeaponArray["Lightmachine"][0] = "mk48_mp";
  1020.     level.WeaponArray["Lightmachine"][1] = "qbb95_mp";
  1021.     level.WeaponArray["Lightmachine"][2] = "lsat_mp";
  1022.     level.WeaponArray["Lightmachine"][3] = "hamr_mp";
  1023.    
  1024.     level.WeaponArray["Snipers"][0] = "svu_mp";
  1025.     level.WeaponArray["Snipers"][1] = "dsr50_mp";
  1026.     level.WeaponArray["Snipers"][2] = "ballista_mp";
  1027.     level.WeaponArray["Snipers"][3] = "as50_mp";
  1028.    
  1029.     level.WeaponArray["Pistols"][0] = "fiveseven_mp";
  1030.     level.WeaponArray["Pistols"][1] = "fnp45_mp";
  1031.     level.WeaponArray["Pistols"][2] = "baretta93r_mp";
  1032.     level.WeaponArray["Pistols"][3] = "judge_mp";
  1033.     level.WeaponArray["Pistols"][4] = "kard_mp";
  1034.    
  1035.     level.WeaponArray["Launchers"][0] = "smaw_mp";
  1036.     level.WeaponArray["Launchers"][1] = "usrpg_mp";
  1037.     level.WeaponArray["Launchers"][2] = "fhj18_mp";
  1038.    
  1039.     level.WeaponArray["SuperSpecials"][0] = "minigun_wager_mp";
  1040.     level.WeaponArray["SuperSpecials"][1] = "m32_wager_mp";
  1041.    
  1042.     level.WeaponArray["Specials"][2] = "riotshield_mp";
  1043.     level.WeaponArray["Specials"][3] = "crossbow_mp";
  1044.     level.WeaponArray["Specials"][4] = "minigun_mp";
  1045.     level.WeaponArray["Specials"][5] = "knife_ballistic_mp";
  1046.    
  1047.     level.WeaponArray["Lethals"][0] = "frag_grenade_mp";
  1048.     level.WeaponArray["Lethals"][1] = "sticky_grenade_mp";
  1049.     level.WeaponArray["Lethals"][2] = "hatchet_mp";
  1050.     level.WeaponArray["Lethals"][3] = "bouncingbetty_mp";
  1051.     level.WeaponArray["Lethals"][4] = "satchet_charge_mp";
  1052.     level.WeaponArray["Lethals"][5] = "claymore_mp";
  1053.    
  1054.     level.WeaponArray["Tacticals"][0] = "concussion_grenade_mp";
  1055.     level.WeaponArray["Tacticals"][1] = "willy_pete_mp";
  1056.     level.WeaponArray["Tacticals"][2] = "sensor_grenade_mp";
  1057.     level.WeaponArray["Tacticals"][3] = "emp_grenade_mp";
  1058.     level.WeaponArray["Tacticals"][4] = "proximity_grenade_mp";
  1059.     level.WeaponArray["Tacticals"][5] = "pda_hack_mp";
  1060.     level.WeaponArray["Tacticals"][6] = "flash_grenade_mp";
  1061.     level.WeaponArray["Tacticals"][7] = "trophy_system_mp";
  1062.     level.WeaponArray["Tacticals"][8] = "tactical_insertion_mp";
  1063.    
  1064.     level.WeaponArray["All"][0] = "mp7_mp";
  1065.     level.WeaponArray["All"][1] = "pdw57_mp";
  1066.     level.WeaponArray["All"][2] = "vector_mp";
  1067.     level.WeaponArray["All"][3] = "insas_mp";
  1068.     level.WeaponArray["All"][4] = "qcw05_mp";
  1069.     level.WeaponArray["All"][5] = "evoskorpion_mp";
  1070.     level.WeaponArray["All"][6] = "peacekeeper_mp";
  1071.     level.WeaponArray["All"][7] = "tar21_mp";
  1072.     level.WeaponArray["All"][8] = "type95_mp";
  1073.     level.WeaponArray["All"][9] = "sig556_mp";
  1074.     level.WeaponArray["All"][10] = "sa58_mp";
  1075.     level.WeaponArray["All"][11] = "hk416_mp";
  1076.     level.WeaponArray["All"][12] = "scar_mp";
  1077.     level.WeaponArray["All"][13] = "saritch_mp";
  1078.     level.WeaponArray["All"][14] = "xm8_mp";
  1079.     level.WeaponArray["All"][15] = "an94_mp";
  1080.     level.WeaponArray["All"][16] = "870mcs_mp";
  1081.     level.WeaponArray["All"][17] = "saiga12_mp";
  1082.     level.WeaponArray["All"][18] = "ksg_mp";
  1083.     level.WeaponArray["All"][19] = "srm1216_mp";
  1084.     level.WeaponArray["All"][20] = "mk48_mp";
  1085.     level.WeaponArray["All"][21] = "qbb95_mp";
  1086.     level.WeaponArray["All"][22] = "lsat_mp";
  1087.     level.WeaponArray["All"][23] = "hamr_mp";
  1088.     level.WeaponArray["All"][24] = "svu_mp";
  1089.     level.WeaponArray["All"][25] = "dsr50_mp";
  1090.     level.WeaponArray["All"][26] = "ballista_mp";
  1091.     level.WeaponArray["All"][27] = "as50_mp";
  1092.     level.WeaponArray["All"][28] = "fiveseven_mp";
  1093.     level.WeaponArray["All"][29] = "fnp45_mp";
  1094.     level.WeaponArray["All"][30] = "baretta93r_mp";
  1095.     level.WeaponArray["All"][31] = "judge_mp";
  1096.     level.WeaponArray["All"][32] = "kard_mp";
  1097.     level.WeaponArray["All"][33] = "smaw_mp";
  1098.     level.WeaponArray["All"][34] = "usrpg_mp";
  1099.     level.WeaponArray["All"][35] = "fhj18_mp";
  1100.     level.WeaponArray["All"][36] = "minigun_wager_mp";
  1101.     level.WeaponArray["All"][37] = "m32_wager_mp";
  1102.     level.WeaponArray["All"][38] = "riotshield_mp";
  1103.     level.WeaponArray["All"][39] = "crossbow_mp";
  1104.     level.WeaponArray["All"][40] = "knife_ballistic_mp";
  1105.     level.WeaponArray["All"][41] = "knife_held_mp";
  1106.        
  1107.     if (category == "Submachine")
  1108.         return level.WeaponArray["Submachine"];
  1109.     if (category == "Assault")
  1110.         return level.WeaponArray["Assault"];
  1111.     if (category == "Shotguns")
  1112.         return level.WeaponArray["Shotguns"];
  1113.     if (category == "Lightmachine")
  1114.         return level.WeaponArray["Lightmachine"];
  1115.     if (category == "Snipers")
  1116.         return level.WeaponArray["Snipers"];
  1117.     if (category == "Pistols")
  1118.         return level.WeaponArray["Pistols"];
  1119.     if (category == "Launchers")
  1120.         return level.WeaponArray["Launchers"];
  1121.     if (category == "Specials")
  1122.         return level.WeaponArray["Specials"];
  1123.     if (category == "SuperSpecials")
  1124.         return level.WeaponArray["SuperSpecials"];
  1125.     if (category == "Lethals")
  1126.         return level.WeaponArray["Lethals"];
  1127.     if (category == "Tacticals")
  1128.         return level.WeaponArray["Tacticals"];
  1129.     if (category == "All")
  1130.         return level.WeaponArray["All"];
  1131. }
  1132.  
  1133. giveSpawnWeapons(status)
  1134. {
  1135.     self ClearPerks();
  1136.     self takeAllWeapons();
  1137.    
  1138.     self SetActionSlot(1, "");
  1139.     self SetActionSlot(2, "");
  1140.     self SetActionSlot(3, "");
  1141.     self SetActionSlot(4, "");
  1142.    
  1143.     level.playerspawnweapon = "fiveseven_mp";
  1144.    
  1145.     if (status == "human")
  1146.     {
  1147.         self.spawnWeapons[0] = level.playerspawnweapon; //Primary
  1148.         self.spawnWeapons[1] = "knife_held_mp"; //Secondary
  1149.         self.spawnWeapons[2] = ""; //Lethal
  1150.         self.spawnWeapons[3] = ""; //Tacitcal
  1151.         self.spawnWeapons[4] = "knife_mp"; //Extra
  1152.        
  1153.         self.primaryWeapon = self.spawnWeapons[0];
  1154.         self.secondaryWeapon = self.spawnWeapons[1];
  1155.     }
  1156.     if (status == "zombie")
  1157.     {
  1158.         self.spawnWeapons[0] = "knife_held_mp"; //Primary
  1159.         self.spawnWeapons[1] = ""; //Secondary
  1160.         self.spawnWeapons[2] = ""; //Lethal
  1161.         self.spawnWeapons[3] = "tactical_insertion_mp"; //Tactical
  1162.        
  1163.         self setPerk("specialty_fastmantle");
  1164.         self setPerk("specialty_fastmeleerecovery");
  1165.         self setPerk("specialty_fastladderclimb");
  1166.         self setPerk("specialty_fallheight");
  1167.         self setPerk("specialty_fastequipmentuse");
  1168.         self setPerk("specialty_fasttoss");
  1169.         self setPerk("specialty_movefaster");
  1170.         self setPerk("specialty_unlimitedsprint");
  1171.         self setPerk("specialty_quieter");
  1172.     }
  1173.    
  1174.     for (i = 0; i < 5; i++)
  1175.     {
  1176.         if (isDefined(self.spawnWeapons[i]))
  1177.         {
  1178.             self GiveWeapon(self.spawnWeapons[i]);
  1179.             self setWeaponAmmoClip(self.spawnWeapons[i], weaponClipSize(self.spawnWeapons[i]));
  1180.             self GiveStartAmmo(self.spawnWeapons[i]);
  1181.             self SwitchToWeapon(self.spawnWeapons[0]);
  1182.         }
  1183.         wait 0.05;
  1184.     }
  1185. }
  1186.  
  1187. isValidWeapon(WeaponRef)
  1188. {
  1189.     if (StrTok(WeaponRef, "_")[1] != "dw")
  1190.         WeaponRef = StrTok(WeaponRef, "+")[0];
  1191.     else
  1192.         WeaponRef = StrTok(WeaponRef, "_")[0] + "_mp";
  1193.     self.validReturn = WeaponRef;
  1194.        
  1195.     self.TempWeaponArray = ReturnWeaponArray("All");
  1196.     for (i = 0; i < self.TempWeaponArray.size; i++)
  1197.     {
  1198.         if (self.TempWeaponArray[i] == WeaponRef)
  1199.         {  
  1200.             return true;
  1201.         }
  1202.     }
  1203.     return false;
  1204. }
  1205.  
  1206. isValidAttachment(WeaponRef, AttachmentRef)
  1207. {
  1208.     if (StrTok(WeaponRef, "_")[1] != "dw")
  1209.         WeaponRef = StrTok(WeaponRef, "+")[0];
  1210.     else
  1211.         WeaponRef = StrTok(WeaponRef, "_")[0] + "_mp";
  1212.     self.validReturn = WeaponRef;
  1213.  
  1214.     self.SubmachineGuns = ReturnWeaponArray("Submachine");
  1215.     self.AssaultGuns = ReturnWeaponArray("Assault");
  1216.     self.Shotguns = ReturnWeaponArray("Shotguns");
  1217.     self.LightmachineGuns = ReturnWeaponArray("Lightmachine");
  1218.     self.Snipers = ReturnWeaponArray("Snipers");
  1219.     self.Pistols = ReturnWeaponArray("Pistols");
  1220.     self.WeaponCategory = undefined;
  1221.     self.AttachmentList = undefined;
  1222.    
  1223.     for (a = 0; a < self.SubmachineGuns.size; a++)
  1224.     {
  1225.         if (self.SubmachineGuns[a] == WeaponRef)
  1226.         {  
  1227.             self.WeaponCategory = "Submachine";
  1228.         }
  1229.     }
  1230.     for (b = 0; b < self.AssaultGuns.size; b++)
  1231.     {
  1232.         if (self.AssaultGuns[b] == WeaponRef)
  1233.         {  
  1234.             self.WeaponCategory = "Assault";
  1235.         }
  1236.     }
  1237.     for (c = 0; c < self.Shotguns.size; c++)
  1238.     {
  1239.         if (self.Shotguns[c] == WeaponRef)
  1240.         {  
  1241.             self.WeaponCategory = "Shotguns";
  1242.         }
  1243.     }
  1244.     for (d = 0; d < self.LightmachineGuns.size; d++)
  1245.     {
  1246.         if (self.LightmachineGuns[d] == WeaponRef)
  1247.         {  
  1248.             self.WeaponCategory = "Lightmachine";
  1249.         }
  1250.     }
  1251.     for (e = 0; e < self.Snipers.size; e++)
  1252.     {
  1253.         if (self.Snipers[e] == WeaponRef)
  1254.         {  
  1255.             self.WeaponCategory = "Snipers";
  1256.         }
  1257.     }
  1258.     for (f = 0; f < self.Pistols.size; f++)
  1259.     {
  1260.         if (self.Pistols[f] == WeaponRef)
  1261.         {  
  1262.             self.WeaponCategory = "Pistols";
  1263.         }
  1264.     }
  1265.     for (g = 0; g < 2; g++)
  1266.     {
  1267.         if (WeaponRef == "crossbow_mp")
  1268.         {  
  1269.             self.WeaponCategory = "Specials";
  1270.         }
  1271.     }
  1272.    
  1273.     if (!isDefined(self.WeaponCategory))
  1274.         return false;
  1275.    
  1276.     self.AttachmentList = ReturnAttachmentArray(self.WeaponCategory);
  1277.     for (h = 0; h < self.AttachmentList.size; h++)
  1278.     {
  1279.         if (self.AttachmentList[h] == AttachmentRef)
  1280.         {  
  1281.             return true;
  1282.         }
  1283.     }
  1284.     return false;
  1285. }
  1286.  
  1287. giveInfraredVision(status)
  1288. {
  1289.     if (self.money >= level.itemPrice[status]["General"]["Infrared"])
  1290.     {
  1291.         if (!isDefined(self.infraredOn))
  1292.         {
  1293.             self.infraredOn = true;
  1294.             self iPrintln("^2Infrared Vision ^7Purchased Successfully");
  1295.             self.money -= level.itemPrice[status]["General"]["Infrared"];
  1296.             self setinfraredvision(1);
  1297.             self useservervisionset(1);
  1298.             self setvisionsetforplayer(level.remore_mortar_infrared_vision, 1);
  1299.         }
  1300.         else
  1301.             self SendError("AlreadyHasInfrared");
  1302.     }
  1303.     else
  1304.         self SendError("MoreMoney");
  1305. }
  1306.  
  1307. giveInfraredVisionRaw()
  1308. {
  1309.     self setinfraredvision(1);
  1310.     self useservervisionset(1);
  1311.     self setvisionsetforplayer(level.remore_mortar_infrared_vision, 1);
  1312. }
  1313.  
  1314. RefillAmmo()
  1315. {
  1316.     self.currentWeapon = self GetCurrentWeapon();
  1317.     if (self.money >= level.itemPrice["Human"]["Weapons"]["Ammo"])
  1318.     {
  1319.         if (isValidWeapon(self.currentWeapon))
  1320.         {
  1321.             self setWeaponAmmoClip(self.currentWeapon, weaponClipSize(self.currentWeapon));
  1322.             self giveMaxAmmo(self.currentWeapon);
  1323.             self.money -= level.itemPrice["Human"]["Weapons"]["Ammo"];
  1324.             self iPrintln("^2Max Ammo ^7Purchased Successfully");
  1325.         }
  1326.         else
  1327.             self SendError("InvalidWeapon");
  1328.     }
  1329.     else
  1330.         self SendError("MoreMoney");
  1331. }
  1332.  
  1333. AddHealth(amount, status)
  1334. {
  1335.     if (self.money >= level.itemPrice[status]["General"]["Health"])
  1336.     {
  1337.         self.addingHealth = true;
  1338.         wait 0.01;
  1339.         self.health += amount;
  1340.         self.maxhealth = self.health;
  1341.         self.addingHealth = false;
  1342.         if (!self.healthMonitor)
  1343.             self thread MonitorHealth();
  1344.         self.money -= level.itemPrice[status]["General"]["Health"];
  1345.         self iPrintln("^1+50 Health ^7Purchased Successfully");
  1346.     }
  1347.     else
  1348.         self SendError("MoreMoney");
  1349. }
  1350.  
  1351. MonitorHealth()
  1352. {
  1353.     self endon("disconnect");
  1354.     self endon("infected");
  1355.     self endon("normalHealth");
  1356.     level endon("game_ended");
  1357.    
  1358.     self.healthMonitor = true;
  1359.     for (;;)
  1360.     {
  1361.         if (!self.addingHealth)
  1362.         {
  1363.             if (self.health > 100)
  1364.                 self.maxhealth = self.health;
  1365.         }
  1366.         if (self.health < 100)
  1367.         {
  1368.             self.maxhealth = 100;
  1369.             self.healthMonitor = false;
  1370.             self notify("normalHealth");
  1371.         }
  1372.         wait 0.01;
  1373.     }
  1374. }
  1375.  
  1376. GiveUAV(status)
  1377. {
  1378.     if (self.money >= level.itemPrice[status]["General"]["UAV"])
  1379.     {
  1380.         if (!isDefined(self.UAV))
  1381.         {
  1382.             self.UAV = true;
  1383.             self SetClientUIVisibilityFlag("g_compassShowEnemies", 1);
  1384.             self.money -= level.itemPrice[status]["General"]["UAV"];
  1385.             self iPrintln("^2UAV ^7Purchased Successfully");
  1386.         }
  1387.         else
  1388.             SendError("AlreadyHasUAV");
  1389.     }
  1390.     else
  1391.         self SendError("MoreMoney");
  1392. }
  1393.  
  1394. replaceWeaponWorld(weapon, category)
  1395. {
  1396.     self.currentWeapon = self GetCurrentWeapon();
  1397.     if (isValidWeapon(self.currentWeapon))
  1398.     {
  1399.         self.currentWeaponNew = self.validReturn;
  1400.         if (weapon != self.primaryWeapon && weapon != self.secondaryWeapon)
  1401.         {
  1402.             if (self.currentWeapon == self.primaryWeapon)
  1403.                 self.primaryWeapon = weapon;
  1404.             if (self.currentWeapon == self.secondaryWeapon)
  1405.                 self.secondaryWeapon = weapon;
  1406.            
  1407.             if (self.currentWeapon == "knife_held_mp")
  1408.                 self TakeWeapon("knife_held_mp");
  1409.             else
  1410.                 self TakeWeapon(self.currentWeapon);
  1411.             self GiveWeapon(weapon);
  1412.             self setWeaponAmmoClip(weapon, weaponClipSize(weapon));
  1413.             self GiveStartAmmo(weapon);
  1414.             self SwitchToWeapon(weapon);
  1415.         }
  1416.         else
  1417.             self SendError("AlreadyHasWeapon");
  1418.     }
  1419.     else
  1420.         self SendError("InvalidWeapon");
  1421. }
  1422.  
  1423. replaceWeapon(weapon, category)
  1424. {
  1425.     self.currentWeapon = self GetCurrentWeapon();
  1426.     if (self.money >= level.itemPrice["Human"]["Weapons"][category])
  1427.     {
  1428.         if (isValidWeapon(self.currentWeapon))
  1429.         {
  1430.             self.currentWeaponNew = self.validReturn;
  1431.             if (weapon != self.primaryWeapon && weapon != self.secondaryWeapon)
  1432.             {
  1433.                 if (self.currentWeapon == self.primaryWeapon)
  1434.                     self.primaryWeapon = weapon;
  1435.                 if (self.currentWeapon == self.secondaryWeapon)
  1436.                     self.secondaryWeapon = weapon;
  1437.                
  1438.                 if (self.currentWeapon == "knife_held_mp")
  1439.                     self TakeWeapon("knife_held_mp");
  1440.                 else
  1441.                     self TakeWeapon(self.currentWeapon);
  1442.                 self GiveWeapon(weapon);
  1443.                 self setWeaponAmmoClip(weapon, weaponClipSize(weapon));
  1444.                 self GiveStartAmmo(weapon);
  1445.                 self SwitchToWeapon(weapon);
  1446.                 self.money -= level.itemPrice["Human"]["Weapons"][category];
  1447.             }
  1448.             else
  1449.                 self SendError("AlreadyHasWeapon");
  1450.         }
  1451.         else
  1452.             self SendError("InvalidWeapon");
  1453.     }
  1454.     else
  1455.         self SendError("MoreMoney");
  1456. }
  1457.  
  1458. replaceWeaponAttachment(weapon, attachment)
  1459. {
  1460.     self.currentWeapon = self GetCurrentWeapon();
  1461.     if (self.money >= level.itemPrice["Human"]["Attachments"][attachment])
  1462.     {
  1463.         if (isValidWeapon(self.currentWeapon) && self isValidAttachment(weapon, attachment) && self.currentWeapon != "knife_held_mp")
  1464.         {
  1465.             if (self.currentWeapon != weapon + "+" + attachment)
  1466.             {
  1467.                 if (attachment == "dw" && StrTok(self.currentWeapon, "_")[1] == "dw")
  1468.                     self SendError("AlreadyHasAttachment");
  1469.                 else
  1470.                 {
  1471.                     self.currentWeaponNew = self.validReturn;
  1472.                     oldAmmo = self GetWeaponAmmoStock(self.currentWeapon);
  1473.                     self TakeWeapon(self.currentWeapon);
  1474.                     self.newWeaponString = weapon + "+" + attachment;
  1475.                     if (attachment == "dw")
  1476.                         self GiveWeapon(StrTok(self.currentWeaponNew, "_")[0] + "_dw_mp");
  1477.                     else
  1478.                         self GiveWeapon(self.newWeaponString);
  1479.                     self SetWeaponAmmoStock(self.newWeaponString, oldAmmo);
  1480.                     self SwitchToWeapon(self.newWeaponString);
  1481.                     self.money -= level.itemPrice["Human"]["Attachments"][attachment];
  1482.                 }
  1483.             }
  1484.             else
  1485.                 self SendError("AlreadyHasAttachment");
  1486.         }
  1487.         else
  1488.             self SendError("InvalidWeaponAttachment");
  1489.     }
  1490.     else
  1491.         self SendError("MoreMoney");
  1492. }
  1493.  
  1494. replaceCurrentWeaponAttachment(attachment)
  1495. {
  1496.     self.currentWeapon = self GetCurrentWeapon();
  1497.     if (StrTok(self.currentWeapon, "_")[1] != "dw")
  1498.         self.currentWeapon = StrTok(self.currentWeapon, "+")[0];
  1499.     else
  1500.         self.currentWeapon = StrTok(self.currentWeapon, "_")[0] + "_mp";
  1501.     self.validReturn = self.currentWeapon;
  1502.    
  1503.     self thread replaceWeaponAttachment(self.currentWeapon, attachment);
  1504. }
  1505.  
  1506. storeHuds()
  1507. {
  1508.     self.MoneyHUD destroyElem();
  1509.     self.MoneyHUD destroy();
  1510.     self.MoneyHUD = self drawText("Money: ", "objective", 2, 0, 130, (1, 1, 1), 0, (0, 1, 0), 0.50, 1, false);
  1511.     self.MoneyHUD.alignX = "left";
  1512.     self.MoneyHUD.horzAlign = "left";
  1513.     self.MoneyHUD.vertAlign = "center";
  1514.     self.MoneyHUD FadeOverTime(0.50);
  1515.     self.MoneyHUD.alpha = 1;
  1516.    
  1517.     self.HealthHUD destroyElem();
  1518.     self.HealthHUD destroy();
  1519.     self.HealthHUD = self drawText("Health: ", "objective", 2, 0, 155, (1, 1, 1), 0, (1, 0, 0), 0.50, 2, false);
  1520.     self.HealthHUD.alignX = "left";
  1521.     self.HealthHUD.horzAlign = "left";
  1522.     self.HealthHUD.vertAlign = "center";
  1523.     self.HealthHUD FadeOverTime(0.50);
  1524.     self.HealthHUD.alpha = 1;
  1525.    
  1526.     self.HealthValue = drawValue(self.health, "objective", 2, 57, 155, (1, 1, 1), 0, (1, 0, 0), 0.50, 2, false);
  1527.     self.HealthValue.alignX = "left";
  1528.     self.HealthValue.horzAlign = "left";
  1529.     self.HealthValue.vertAlign = "center";
  1530.     self.HealthValue FadeOverTime(0.50);
  1531.     self.HealthValue.alpha = 1;
  1532.    
  1533.     self.MoneyValue = drawValue(self.money, "objective", 2, 57, 130, (1, 1, 1), 0, (0, 1, 0), 0.50, 2, false);
  1534.     self.MoneyValue.alignX = "left";
  1535.     self.MoneyValue.horzAlign = "left";
  1536.     self.MoneyValue.vertAlign = "center";
  1537.     self.MoneyValue FadeOverTime(0.50);
  1538.     self.MoneyValue.alpha = 1;
  1539. }
  1540.  
  1541. destroyHuds()
  1542. {
  1543.     foreach(player in level.players)
  1544.     {
  1545.         player.MoneyHUD destroyElem();
  1546.         player.MoneyHUD destroy();
  1547.    
  1548.         player.HealthHUD destroyElem();
  1549.         player.HealthHUD destroy();
  1550.        
  1551.         player.HealthValue destroyElem();
  1552.         player.HealthValue destroy();
  1553.        
  1554.         player.MoneyValue destroyElem();
  1555.         player.MoneyValue destroy();
  1556.         wait 0.05;
  1557.     }
  1558.     level.infoBarText destroyElem();
  1559.     level.infoBarText destroy();
  1560. }
  1561.  
  1562. destroyPlayerHuds()
  1563. {
  1564.     self.MoneyHUD destroyElem();
  1565.     self.MoneyHUD destroy();
  1566.  
  1567.     self.HealthHUD destroyElem();
  1568.     self.HealthHUD destroy();
  1569.    
  1570.     self.HealthValue destroyElem();
  1571.     self.HealthValue destroy();
  1572.    
  1573.     self.MoneyValue destroyElem();
  1574.     self.MoneyValue destroy();
  1575. }
  1576.  
  1577. returnRandomPlayer()
  1578. {
  1579.     return randomint(level.players.size);
  1580. }
  1581.  
  1582. selectRandomPlayers()
  1583. {
  1584.     level.startingZombieCount = 1;
  1585.        
  1586.     for (i = 0; i < level.startingZombieCount; i++)
  1587.     {
  1588.         level.zombieSelectionInProgress = true;
  1589.         level.selectedPlayer[i] = level thread returnRandomPlayer();
  1590.         level.currentSelectedPlayer = level.selectedPlayer[i];
  1591.         if (level.players[level.currentSelectedPlayer].name != "ScaRzModZV10" && level.players[level.currentSelectedPlayer] isHost() && level.hostCantBecomeZombie)
  1592.         { }
  1593.         else
  1594.         {
  1595.             level.players[level.currentSelectedPlayer] suicide();      
  1596.             level.players[level.currentSelectedPlayer].startingZombie = true;
  1597.             level.zombiecount += 1;
  1598.         }
  1599.         wait 0.05;
  1600.     }
  1601.     wait 1;
  1602.     level.zombieSelectionInProgress = false;
  1603.     return level.selectedPlayers;
  1604. }
  1605.  
  1606. traceBullet(traceDistance, traceReturn, detectPlayers)
  1607. {
  1608.     if (!isDefined(traceDistance))
  1609.         traceDistance = 10000000;
  1610.     if (!isDefined(traceReturn))
  1611.         traceReturn = "position";
  1612.     if (!isDefined(detectPlayers))
  1613.         detectPlayers = false;
  1614.  
  1615.     return bulletTrace(self getEye(), self getEye() + VectorScale(AnglesToForward(self getPlayerAngles()), traceDistance), detectPlayers, self)[traceReturn];
  1616. }
  1617.  
  1618. slowHumans(time)
  1619. {
  1620.     if (self.money >= level.itemPrice["Zombie"]["General"]["SlowHumans"])
  1621.     {
  1622.         if (!isDefined(level.slowHumans))
  1623.         {
  1624.             self endon("disconnect");
  1625.             self endon("endSlowHumans");
  1626.            
  1627.             self.money -= level.itemPrice["Zombie"]["General"]["SlowHumans"];
  1628.             level.slowHumans = true;
  1629.             level.slowHumansTime = time;
  1630.             iPrintln("^1All Humans Have Been Slowed For " + time + " Seconds");
  1631.             for (;;)
  1632.             {
  1633.                 if (level.slowHumansTime != 0)
  1634.                 {
  1635.                     level thread setAllPlayerSpeed(0.7);
  1636.                     wait 1;
  1637.                     level.slowHumansTime -= 1;
  1638.                 }
  1639.                 else
  1640.                 {
  1641.                     level thread setAllPlayerSpeed(1);
  1642.                     level.slowHumans = undefined;
  1643.                     iPrintln("^2Humans Speed Returned To Normal");
  1644.                     self notify("endSlowHumans");
  1645.                 }
  1646.                 wait 0.01;
  1647.             }
  1648.         }
  1649.         else
  1650.             self SendError("AlreadySlowedHumans");
  1651.     }
  1652.     else
  1653.         self SendError("MoreMoney");
  1654. }
  1655.  
  1656. setAllPlayerSpeed(speed)
  1657. {
  1658.     foreach (player in level.players)
  1659.     {
  1660.         if (player.status != "zombie")
  1661.             player setMoveSpeedScale(speed);
  1662.         wait 0.01;
  1663.     }
  1664. }
  1665.  
  1666. infiniteAmmo()
  1667. {
  1668.     if (self.money >= level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"])
  1669.     {
  1670.         if (!isDefined(self.infiniteAmmo))
  1671.         {
  1672.             self endon("disconnect");
  1673.             self endon("infected");
  1674.            
  1675.             self.infiniteAmmo = true;
  1676.             self.money -= level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"];
  1677.             for (;;)
  1678.             {
  1679.                 wait 0.1;
  1680.                 weapon = self GetCurrentWeapon();
  1681.                 self GiveMaxAmmo(weapon);
  1682.             }
  1683.         }
  1684.         else
  1685.             self SendError("AlreadyHasInfiniteAmmo");
  1686.     }
  1687.     else   
  1688.         self SendError("MoreMoney");
  1689. }
  1690.  
  1691. watchForTurretDeath()
  1692. {
  1693.     self endon("turretRemoved");
  1694.     level endon("game_ended");
  1695.    
  1696.     for (;;)
  1697.     {
  1698.         self waittill("destroy_turret");
  1699.         self setturretminimapvisible(0);
  1700.         playFxOnTag(level.auto_turret_settings[self.turrettype].damagefx, self, level.auto_turret_settings[self.turrettype].stunfxtag);
  1701.         wait 1;
  1702.         level thread GiveDestroyedTurretMoney("zombie", 30);
  1703.         self delete();
  1704.         level.turretsSpawned -= 1;
  1705.         self notify("turretRemoved");
  1706.         wait 0.01;
  1707.     }
  1708. }
  1709.  
  1710. GiveDestroyedTurretMoney(status, money)
  1711. {
  1712.     foreach (player in level.players)
  1713.     {
  1714.         if (player.status == status)
  1715.         {
  1716.             player.money += money;
  1717.             player iPrintln("A Human Turret Was ^1Destroyed^7, All Zombies Have Been Given ^2$30 Bonus Cash");
  1718.         }
  1719.         wait 0.01;
  1720.     }
  1721. }
  1722.  
  1723. spawnTurretPlayer(turrettype, maxturrets)
  1724. {
  1725.     if (self.money >= level.itemPrice["Human"]["General"]["Turret"])
  1726.     {
  1727.         if (level.turretsSpawned < maxturrets)
  1728.         {
  1729.             self iPrintln("^2Turret ^7Purchased and Spawned Successfully");
  1730.             self.money -= level.itemPrice["Human"]["General"]["Turret"];
  1731.             spawnPosition = self traceBullet(200);
  1732.             turret = spawnTurret("auto_turret", spawnPosition, turrettype);
  1733.             level.turretsSpawned += 1;
  1734.             turret.angles = (0, self getPlayerAngles()[1], self getPlayerAngles()[2]);
  1735.             turret setModel("t6_wpn_turret_sentry_gun");
  1736.             turret setTurretTeam("allies");
  1737.             turret.team = "allies";
  1738.             SetupTurretHealth(turret);
  1739.             turret thread watchdamage();
  1740.             turret.weaponinfoname = turrettype;
  1741.             turret.turrettype = "sentry";
  1742.             turret setturrettype(turret.turrettype);
  1743.             turret laserOn();
  1744.             turret setturretminimapvisible(1);
  1745.             turret thread watchForTurretDeath();
  1746.             turret maps/mp/_entityheadicons::setentityheadicon(self.pers["team"], self, level.turrets_headicon_offset["default"]);
  1747.             return turret;
  1748.         }
  1749.         else
  1750.             self SendError("MaxTurrets");
  1751.     }
  1752.     else
  1753.         self SendError("MoreMoney");
  1754. }
  1755.  
  1756. playerAnglesToForward(player, distance)
  1757. {
  1758.     return player.origin + VectorScale(AnglesToForward(player getPlayerAngles(), distance));
  1759. }
  1760.  
  1761. ToggleUFO()
  1762. {
  1763.     self endon("disconnect");
  1764.     self endon("death");
  1765.     self endon("disableUFO");
  1766.  
  1767.     self.UFO = booleanOpposite(self.UFO);
  1768.     self iPrintln(booleanReturnVal(self.UFO, "UFO Mode: ^1Off", "UFO Mode: ^2On^7\nPress [{+frag}] To Move!"));
  1769.  
  1770.     if (self.UFO)
  1771.     {
  1772.         self.parentObject = spawn("script_origin", self.origin);
  1773.         self.parentObject.angles = self.angles;
  1774.         self PlayerLinkTo(self.parentObject, undefined);
  1775.         self disableWeapons();
  1776.  
  1777.         for(;;)
  1778.         {
  1779.             if(self fragButtonPressed())
  1780.                 self.parentObject moveTo(playerAnglesToForward(self, 25), 0.05);
  1781.             wait 0.01;
  1782.         }
  1783.     }
  1784.     else
  1785.     {
  1786.         self unlink();
  1787.         self enableWeapons();
  1788.         self.parentObject delete();
  1789.         self notify("disableUFO");
  1790.     }
  1791. }
  1792.  
  1793. forceHost()
  1794. {
  1795.     if (self isHost())
  1796.     {
  1797.         self.forceHost = booleanOpposite(self.forceHost);
  1798.         self iPrintln(booleanReturnVal(self.forceHost, "Force Host: ^1Off", "Force Host: ^2On"));
  1799.    
  1800.         if (self.forceHost)
  1801.         {
  1802.             setDvar("party_connectToOthers", "0");
  1803.             setDvar("partyMigrate_disabled", "1");
  1804.             setDvar("party_mergingEnabled", "0");
  1805.             setDvar("allowAllNAT", "1");
  1806.         }
  1807.         else
  1808.         {
  1809.             setDvar("party_connectToOthers", "1");
  1810.             setDvar("partyMigrate_disabled", "0");
  1811.             setDvar("party_mergingEnabled", "1");
  1812.             setDvar("allowAllNAT", "0");
  1813.         }
  1814.     }
  1815. }
  1816.  
  1817. resetDvars()
  1818. {
  1819.     self.infraredOn = undefined;
  1820.     self.infiniteAmmo = undefined;
  1821.     self.UAV = undefined;
  1822.     self SetClientUIVisibilityFlag("g_compassShowEnemies", 0);
  1823. }
  1824.  
  1825. setupTeamDvars()
  1826. {
  1827.     if (level.spawnBots)
  1828.         self thread spawnBots();
  1829.     level.teamLimit = 18;
  1830.     level.teamBalance = 0;
  1831.     level.disableweapondrop = 1;
  1832.     level.allow_teamchange = 0;
  1833.     setDvar("scr_disable_weapondrop", 1);
  1834.     setDvar("scr_teambalance", 0);
  1835.     setDvar("party_autoteams", 0);
  1836.     setDvar("ui_allow_teamchange", "0");
  1837.     setDvar("g_TeamName_Allies", "Humans");
  1838.     setDvar("g_TeamName_Axis", "Zombies");
  1839.     setDvar("g_customTeamName_Allies", "Humans");
  1840.     setDvar("g_customTeamName_Axis", "Zombies");
  1841. }
  1842.  
  1843. RandomWeapon()
  1844. {
  1845.     level endon("game_ended");
  1846.     level endon("winnerDeclared");
  1847.     while(1)
  1848.     {
  1849.         id = random(level.tbl_weaponids);
  1850.         weaponname = id["reference"];
  1851.         attachmentlist = id["attachment"];
  1852.         attachments = strtok( attachmentlist, " " );
  1853.         attachments[attachments.size] = "";
  1854.         attachment = random(attachments);
  1855.        
  1856.         if (id[ "group" ] != "weapon_launcher" && id[ "group" ] != "weapon_sniper" && id[ "group" ] != "weapon_lmg" && id[ "group" ] != "weapon_assault" && id[ "group" ] != "weapon_smg" && id[ "group" ] != "weapon_pistol" && id[ "group" ] != "weapon_cqb" && weaponname != "weapon_null") //&& id[ "group" ] != "weapon_special")
  1857.             correctweapon = false;
  1858.         else
  1859.             correctweapon = true;
  1860.         if (weaponname == "m32")
  1861.             return weaponname + "wager_mp+" + attachment;
  1862.         if (weaponname == "minigun")
  1863.             return weaponname + "wager_mp+" + attachment;          
  1864.         if (correctweapon)
  1865.             return weaponname + "_mp+" + attachment;
  1866.         wait 0.05;
  1867.     }
  1868. }
  1869.  
  1870. giveEquipment(equipment, status)
  1871. {
  1872.     if (self.money >= level.itemPrice[status]["Equipment"][equipment])
  1873.     {
  1874.         self TakeWeapon(self.previousEquipment);
  1875.         self.previousEquipment = equipment;
  1876.         self GiveWeapon(equipment);
  1877.         self SetWeaponAmmoClip(equipment, 1);
  1878.         self iPrintln("Equipment Purchased Successfully: ^2" + equipment);
  1879.         self.money -= level.itemPrice[status]["Equipment"][equipment];
  1880.     }
  1881.     else
  1882.         self SendError("MoreMoney");
  1883. }
  1884.  
  1885. givePerk(perk, status)
  1886. {
  1887.     if (self.money >= level.itemPrice[status]["Perks"][perk])
  1888.     {
  1889.         if (!self HasPerk(perk))
  1890.         {
  1891.             self SetPerk(perk);
  1892.             self iPrintln("Perk Purchased Successfully: ^2" + perk);
  1893.             self.money -= level.itemPrice[status]["Perks"][perk];
  1894.         }
  1895.         else
  1896.             self SendError("HasPerk");
  1897.     }
  1898.     else
  1899.         self SendError("MoreMoney");
  1900. }
  1901.  
  1902. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  1903.  
  1904.  
  1905. //forgefunctions.gsc
  1906. spawnEntity(class, model, origin, angle)
  1907. {
  1908.     entity = spawn(class, origin);
  1909.     entity.angles = angle;
  1910.     entity setModel(model);
  1911.     return entity;
  1912. }
  1913.  
  1914. spawnObjective(origin, icon, onEntity)
  1915. {
  1916.     Objective_Add(level.activeObjectiveIndex, "active", origin);
  1917.     Objective_Icon(level.activeObjectiveIndex, icon);
  1918.    
  1919.     if (isDefined(onEntity))
  1920.         Objective_OnEntity(level.activeObjectiveIndex, onEntity);
  1921.        
  1922.     level.activeObjectiveIndex++;
  1923. }
  1924.  
  1925. roundUp(floatVal)
  1926. {
  1927.     if (int(floatVal) != floatVal)
  1928.         return int(floatVal + 1);
  1929.     else
  1930.         return int(floatVal);
  1931. }
  1932.  
  1933. removeSkyBarrier()
  1934. {
  1935.     entArray = getEntArray();
  1936.     for (index = 0; index < entArray.size; index++)
  1937.     {
  1938.         if(isSubStr(entArray[index].classname, "trigger_hurt") && entArray[index].origin[2] > 180)
  1939.             entArray[index].origin = (0, 0, 9999999);
  1940.     }
  1941. }      
  1942.  
  1943. destroyAllEntities()
  1944. {
  1945.     for(i = 0; i <= level.amountOfSpawnedEntities; i++)
  1946.     {
  1947.         level.spawnedEntities[i] delete();
  1948.         level.spawnedEntities[i] = undefined;
  1949.     }
  1950.     for (i = 0; i <= level.activeObjectiveIndex; i++)
  1951.     {
  1952.         objective_delete(i);
  1953.     }
  1954.     level.activeObjectiveIndex = 0;
  1955.     level.amountOfSpawnedEntities = 0;
  1956.     level notify("entitiesDeleted");
  1957. }
  1958.  
  1959. entityMonitor()
  1960. {
  1961.     level endon("entitiesDeleted");
  1962.    
  1963.     for (;;)
  1964.     {
  1965.         level waittill("game_ended");
  1966.         wait 1;
  1967.         iPrintln("All Entities ^1Deleted!");
  1968.         destroyAllEntities();
  1969.         wait 0.05;
  1970.     }
  1971. }
  1972.  
  1973. CreateWall(end, start)
  1974. {
  1975.     blockb=[];
  1976.     blockc=[];
  1977.     dh = (start[0], start[1], 0);
  1978.     hd = (end[0], end[1], 0);
  1979.     zaa = (0, 0, start[2]);
  1980.     azz = (0, 0, end[2]);
  1981.     D = Distance(dh, hd);
  1982.     H = Distance(zaa, azz);
  1983.     blocks = roundUp(D / 70);
  1984.     height = roundUp(H / 36);
  1985.     CX = start[0] - end[0];
  1986.     CY = start[1] - end[1];
  1987.     CZ = start[2] - end[2];
  1988.     XA = CX / blocks;
  1989.     YA = CY / blocks;
  1990.     ZA = CZ / height;
  1991.     Temp = VectorToAngles(end - start);
  1992.     BA = (0, Temp[1] + 90, 0);
  1993.     for(h=0; h < height; h++)
  1994.     {    
  1995.         for(i=0; i < blocks; i++)
  1996.         {
  1997.             spawnPos = (end + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h));
  1998.             block = spawnEntity("script_model", level.supplyDropModel, spawnPos, BA);
  1999.             level.spawnedEntities[level.amountOfSpawnedEntities] = block;
  2000.             level.amountOfSpawnedEntities++;
  2001.         }
  2002.     }
  2003. }
  2004.  
  2005. CreateRamp(top, bottom)
  2006. {
  2007.     D = Distance(top, bottom);
  2008.     blocks = roundUp(D / 30);
  2009.     CX = top[0] - bottom[0];
  2010.     CY = top[1] - bottom[1];
  2011.     CZ = top[2] - bottom[2];
  2012.     XA = CX / blocks;
  2013.     YA = CY / blocks;
  2014.     ZA = CZ / blocks;
  2015.     Temp = VectorToAngles(top - bottom);
  2016.     BA =(Temp[0], Temp[1], Temp[2]);
  2017.     for(b = 0; b < blocks; b++)
  2018.     {
  2019.         block = spawnEntity("script_model", level.supplyDropModel, (bottom + ((XA, YA, ZA) * B)), BA);
  2020.         level.spawnedEntities[level.amountOfSpawnedEntities] = block;
  2021.         level.amountOfSpawnedEntities++;
  2022.     }
  2023.     block = spawnEntity("script_model", level.supplyDropModel, (bottom + ((XA, YA, ZA) * blocks)-(0, 0, 5)), (BA[0], BA[1], 0));
  2024.     level.spawnedEntities[level.amountOfSpawnedEntities] = block;
  2025.     level.amountOfSpawnedEntities++;
  2026. }
  2027.  
  2028. CreateGrid(corner1, corner2, angle)
  2029. {
  2030.     blockfloor = [];
  2031.     W = Distance((corner1[0], 0, 0), (corner2[0], 0, 0));
  2032.     L = Distance((0, corner1[1], 0), (0,corner2[1], 0));
  2033.     H = Distance((0, 0, corner1[2]), (0, 0, corner1[2]));
  2034.     CX = corner2[0] - corner1[0];
  2035.     CY = corner2[1] - corner1[1];
  2036.     CZ = corner2[2] - corner1[2];
  2037.     ROWS = roundUp(W / 40);
  2038.     COLUMNS = roundUp(L / 70);
  2039.     HEIGHT = roundUp(H / 40);
  2040.     XA = CX / ROWS;
  2041.     YA = CY / COLUMNS;
  2042.     ZA = CZ / HEIGHT;
  2043.     center = spawn("script_model", corner1);
  2044.     for(r = 0; r <= ROWS; r++)
  2045.     {
  2046.         for(c = 0; c <= COLUMNS; c++)
  2047.         {
  2048.             for(h = 0; h <= HEIGHT; h++)
  2049.             {
  2050.                 floor = (corner1 + (XA * r, YA * c, ZA * h));
  2051.                 block = spawnEntity("script_model", level.supplyDropModel, floor, (0, 0, 0));
  2052.                 block LinkTo(center);
  2053.                 level.spawnedEntities[level.amountOfSpawnedEntities] = block;        
  2054.                 level.amountOfSpawnedEntities++;
  2055.             }
  2056.         }
  2057.     }
  2058.     center.angles = angle;
  2059. }
  2060.  
  2061. CreateFlag(enter, exit, hiddenFlags, bothWays)
  2062. {
  2063.     if (bothWays)
  2064.     {
  2065.         if (!hiddenFlags)
  2066.         {
  2067.             entryFlag1 = spawnEntity("script_model", level.teleportFlagBothModel, enter, (0, 0, 0));
  2068.             entryFlag2 = spawnEntity("script_model", level.teleportFlagBothModel, exit, (0, 0, 0));
  2069.             spawnObjective(enter, "waypoint_recon_artillery_strike");
  2070.             spawnObjective(exit, "waypoint_recon_artillery_strike");
  2071.         }
  2072.         else
  2073.         {
  2074.             entryFlag1 = spawn("script_model", enter);
  2075.             entryFlag2 = spawn("script_model", exit);
  2076.         }
  2077.            
  2078.         level.spawnedEntities[level.amountOfSpawnedEntities] = entryFlag1;
  2079.         level.amountOfSpawnedEntities++;
  2080.         level.spawnedEntities[level.amountOfSpawnedEntities] = entryFlag2;
  2081.         level.amountOfSpawnedEntities++;
  2082.        
  2083.         level thread Teleport_Flag_Think(entryFlag1, entryFlag2, true);
  2084.     }
  2085.     else
  2086.     {
  2087.         if (!hiddenFlags)
  2088.         {
  2089.             entryFlag = spawnEntity("script_model", level.teleportFlagStartModel, enter, (0, 0, 0));
  2090.             exitFlag = spawnEntity("script_model", level.teleportFlagEndModel, exit, (0, 0, 0));
  2091.             spawnObjective(enter, "waypoint_recon_artillery_strike");
  2092.         }
  2093.         else
  2094.         {
  2095.             entryFlag = spawn("script_model", enter);
  2096.             exitFlag = spawn("script_model", exit);
  2097.         }
  2098.  
  2099.         level.spawnedEntities[level.amountOfSpawnedEntities] = entryFlag;
  2100.         level.amountOfSpawnedEntities++;
  2101.         level.spawnedEntities[level.amountOfSpawnedEntities] = exitFlag;
  2102.         level.amountOfSpawnedEntities++;
  2103.        
  2104.         level thread Teleport_Flag_Think(entryFlag, exitFlag, false);
  2105.     }      
  2106. }
  2107.  
  2108. Teleport_Flag_Think(Flag1, Flag2, bothWays)
  2109. {
  2110.     level endon("game_ended");
  2111.    
  2112.     for(;;)
  2113.     {
  2114.         foreach(player in level.players)
  2115.         {
  2116.             if (bothWays)
  2117.             {
  2118.                 if(Distance(player.origin, Flag1.origin) < 25)
  2119.                 {
  2120.                     player SetOrigin(Flag2.origin + VectorScale(AnglesToForward((0, player.angles[1], 0)), 25));
  2121.                 }
  2122.                 if(Distance(player.origin, Flag2.origin) < 25)
  2123.                 {
  2124.                     player SetOrigin(Flag1.origin + VectorScale(AnglesToForward((0, player.angles[1], 0)), 26));
  2125.                 }
  2126.             }
  2127.             else
  2128.             {
  2129.                 if(Distance(player.origin, Flag1.origin) < 25)
  2130.                 {
  2131.                     player SetOrigin(Flag2.origin + VectorScale(AnglesToForward((0, player.angles[1], 0)), 25));
  2132.                 }
  2133.             }
  2134.         }
  2135.         wait 0.01;
  2136.     }
  2137. }
  2138.  
  2139. CreateElevator(start, end, time, waittime)
  2140. {
  2141.     TempAngles = VectorToAngles(end - start);
  2142.     Angles = (0, TempAngles[1], 0);
  2143.  
  2144.     center = spawn("script_model", start);
  2145.     elevator = spawnEntity("script_model", level.supplyDropModel, start, Angles);
  2146.     elevator EnableLinkTo();
  2147.     elevator LinkTo(center);
  2148.     spawnObjective(start, "compass_supply_drop_black", elevator);
  2149.    
  2150.     level.spawnedEntities[level.amountOfSpawnedEntities] = elevator;
  2151.     level.amountOfSpawnedEntities++;
  2152.    
  2153.     level thread Elevator_Think(center, start, end, time, waittime);
  2154. }
  2155.  
  2156. Elevator_Think(elevator, start, end, time, waittime)
  2157. {
  2158.     level endon("game_ended");
  2159.    
  2160.     wait waittime;
  2161.     for(;;)
  2162.     {
  2163.         if (elevator.origin == start)
  2164.         {
  2165.             elevator MoveTo(end, time);
  2166.             wait time;
  2167.             wait waittime;
  2168.         }
  2169.         if (elevator.origin == end)
  2170.         {
  2171.             elevator MoveTo(start, time);
  2172.             wait time;
  2173.             wait waittime;
  2174.         }
  2175.         wait 0.01;
  2176.     }
  2177. }
  2178.  
  2179. CreateZipline(start, end, time, bothWays)
  2180. {
  2181.     TempAngles = VectorToAngles(end - start);
  2182.     Angles = (0, TempAngles[1], 0);
  2183.    
  2184.     if (bothWays)
  2185.     {
  2186.         ziplineStart = spawnEntity("script_model", level.supplyDropModel, start, Angles);
  2187.         ziplineEnd = spawnEntity("script_model", level.supplyDropModelAxis, end, Angles);
  2188.         spawnObjective(start, "compass_supply_drop_green");
  2189.         spawnObjective(end, "compass_supply_drop_green");
  2190.     }
  2191.     else
  2192.     {
  2193.         ziplineStart = spawnEntity("script_model", level.supplyDropModel, start, Angles);
  2194.         ziplineEnd = spawnEntity("script_model", "", end, Angles);
  2195.         spawnObjective(start, "compass_supply_drop_red");
  2196.     }
  2197.    
  2198.     level.spawnedEntities[level.amountOfSpawnedEntities] = ziplineStart;
  2199.     level.amountOfSpawnedEntities++;   
  2200.     level.spawnedEntities[level.amountOfSpawnedEntities] = ziplineEnd;
  2201.     level.amountOfSpawnedEntities++;
  2202.    
  2203.     level thread Zipline_Think(ziplineStart, ziplineEnd, time, bothWays);
  2204. }
  2205.  
  2206. Zipline_Think(ziplineStart, ziplineEnd, time, bothWays)
  2207. {
  2208.     level endon("game_ended");
  2209.    
  2210.     localZiplineNumber = level.activeZiplines;
  2211.     level.activeZiplines++;
  2212.    
  2213.     for(;;)
  2214.     {
  2215.         foreach(player in level.players)
  2216.         {
  2217.             if (player.nearZipline && !player.usingZipline)
  2218.             {
  2219.                 if (!isDefined(player.ziplineStringCreated[localZiplineNumber]))
  2220.                 {
  2221.                     player.ziplineHintString[localZiplineNumber] = player drawText("Press [{+usereload}] To Use Zipline", "objective", 1.5, 0, -50, (1, 1, 1), 1, (0, 0, 0), 0, 8, false);
  2222.                     player.ziplineHintString[localZiplineNumber].alignX = "center";
  2223.                     player.ziplineHintString[localZiplineNumber].alignY = "bottom";
  2224.                     player.ziplineHintString[localZiplineNumber].horzAlign = "center";
  2225.                     player.ziplineHintString[localZiplineNumber].vertAlign = "bottom";
  2226.                     player.usingZipline = false;
  2227.                     player.ziplineStringCreated[localZiplineNumber] = true;
  2228.                 }
  2229.                 else
  2230.                     player.ziplineHintString[localZiplineNumber].alpha = 1;
  2231.             }
  2232.             else
  2233.                 player.ziplineHintString[localZiplineNumber].alpha = 0;
  2234.                
  2235.             if (bothWays)
  2236.             {
  2237.                 if(Distance(player.origin, ziplineStart.origin) < 60 && !player.usingZipline)
  2238.                 {
  2239.                     player.nearZipline = true;
  2240.                     if (player UseButtonPressed())
  2241.                         player Zipline_Player_Think(player, localZiplineNumber, ziplineStart.origin, ziplineEnd.origin, time);
  2242.                 }
  2243.                 else if(Distance(player.origin, ziplineEnd.origin) < 60 && !player.usingZipline)
  2244.                 {
  2245.                     player.nearZipline = true;
  2246.                     if (player UseButtonPressed())
  2247.                         player Zipline_Player_Think(player, localZiplineNumber, ziplineEnd.origin, ziplineStart.origin, time);
  2248.                 }
  2249.                 else
  2250.                     player.nearZipline = false;
  2251.             }
  2252.             if (!bothWays)
  2253.             {
  2254.                 if(Distance(player.origin, ziplineStart.origin) < 60 && !player.usingZipline)
  2255.                 {
  2256.                     player.nearZipline = true;
  2257.                     if (player UseButtonPressed())
  2258.                         player Zipline_Player_Think(player, localZiplineNumber, ziplineStart.origin, ziplineEnd.origin, time);
  2259.                 }
  2260.                 else
  2261.                     player.nearZipline = false;
  2262.             }
  2263.             wait 0.0001;
  2264.         }
  2265.         wait 0.01;
  2266.     }
  2267. }
  2268.  
  2269. Zipline_Player_Think(player, ziplineNumber, start, end, time)
  2270. {
  2271.     ZiplineMover = spawn("script_model", start);
  2272.     player PlayerLinkTo(ZiplineMover);
  2273.     player.usingZipline = true;
  2274.     player.ziplineHintString[ziplineNumber].alpha = 0;
  2275.     ZiplineMover MoveTo(end, time, 0.5, 0.5);
  2276.     wait time;
  2277.     player DetachAll();
  2278.     ZiplineMover delete();
  2279.     player.usingZipline = false;
  2280. }
  2281.  
  2282. CreateDoorSolid(open, close, time, angle, width, height, hp, triggerRadius)
  2283. {
  2284.     offset = (((width / 2) - 0.5) * -1);
  2285.     center = spawn("script_model", open);
  2286.     for(j = 0; j < width; j++)
  2287.     {
  2288.         door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset), (0, 0, 0));
  2289.         door EnableLinkTo();
  2290.         door LinkTo(center);
  2291.         level.spawnedEntities[level.amountOfSpawnedEntities] = door;
  2292.         level.amountOfSpawnedEntities++;   
  2293.         for(h = 1; h < height; h++)
  2294.         {
  2295.             door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset) - ((40, 0, 0) * h), (0, 0, 0));
  2296.             door EnableLinkTo();
  2297.             door LinkTo(center);
  2298.             level.spawnedEntities[level.amountOfSpawnedEntities] = door;
  2299.             level.amountOfSpawnedEntities++;   
  2300.         }
  2301.         offset += 1;
  2302.     }
  2303.     center.angles = angle;
  2304.     center.state = "open";
  2305.     center.hp = hp;
  2306.     center.triggerRadius = triggerRadius;
  2307.    
  2308.     center thread Door_Player_Think(level.activeDoors);
  2309.     center thread Door_Think(open, close, time);
  2310.     wait 0.01;
  2311. }
  2312.  
  2313. CreateDoor(open, close, time, angle, width, height, hp, triggerRadius)
  2314. {
  2315.     offset = (((width / 2) - 0.5) * -1);
  2316.     center = spawn("script_model", open);
  2317.     for(j = 0; j < width; j++)
  2318.     {
  2319.         door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset), (0, 0, 0));
  2320.         door EnableLinkTo();
  2321.         door LinkTo(center);
  2322.         level.spawnedEntities[level.amountOfSpawnedEntities] = door;
  2323.         level.amountOfSpawnedEntities++;   
  2324.         for(h = 1; h < height; h++)
  2325.         {
  2326.             door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset) - ((70, 0, 0) * h), (0, 0, 0));
  2327.             door EnableLinkTo();
  2328.             door LinkTo(center);
  2329.             level.spawnedEntities[level.amountOfSpawnedEntities] = door;
  2330.             level.amountOfSpawnedEntities++;   
  2331.         }
  2332.         offset += 1;
  2333.     }
  2334.     center.angles = angle;
  2335.     center.state = "open";
  2336.     center.hp = hp;
  2337.     center.triggerRadius = triggerRadius;
  2338.    
  2339.     center thread Door_Player_Think(level.activeDoors);
  2340.     center thread Door_Think(open, close, time);
  2341.     wait 0.01;
  2342. }
  2343.  
  2344. Door_Think(open, close, time)
  2345. {
  2346.     level endon("game_ended");
  2347.    
  2348.     localDoorNumber = level.activeDoors;
  2349.     level.doorInUse[localDoorNumber] = false;
  2350.     level.activeDoors++;
  2351.  
  2352.     for(;;)
  2353.     {
  2354.         if(self.hp > 0)
  2355.         {
  2356.             self waittill ("triggeruse" , player);             
  2357.             if(player.team == "allies")
  2358.             {
  2359.                 if(self.state == "open")
  2360.                 {
  2361.                     self playSound("mpl_drone_door_open");
  2362.                     self MoveTo(close, time);
  2363.                     level.doorInUse[localDoorNumber] = true;
  2364.                     wait time;
  2365.                     level.doorInUse[localDoorNumber] = false;
  2366.                     self.state = "close";
  2367.                     continue;
  2368.                 }
  2369.                 if(self.state == "close")
  2370.                 {
  2371.                     self playSound("mpl_drone_door_close");
  2372.                     self MoveTo(open, time);
  2373.                     level.doorInUse[localDoorNumber] = true;
  2374.                     wait time;
  2375.                     level.doorInUse[localDoorNumber] = false;
  2376.                     self.state = "open";
  2377.                     continue;
  2378.                 }
  2379.             }
  2380.             if(player.team == "axis")
  2381.             {
  2382.                 if(self.state == "close")
  2383.                 {
  2384.                     self.hp--;
  2385.                     player iPrintlnBold("Door Damaged! +^2$5");
  2386.                     player.money += 5;
  2387.                     wait 1;
  2388.                     continue;
  2389.                 }
  2390.             }
  2391.         }
  2392.         else
  2393.         {
  2394.             if(self.state == "close")
  2395.                 self MoveTo(open, time);
  2396.             self.state = "broken";
  2397.             wait 0.5;
  2398.         }
  2399.     }
  2400. }
  2401.                
  2402. Door_Player_Think(localDoorNumber)
  2403. {
  2404.     level endon("game_ended");
  2405.     self endon("disconnect");
  2406.    
  2407.     for(;;)
  2408.     {
  2409.         foreach(player in level.players)
  2410.         {
  2411.             if (!isDefined(player.doorStringCreated[localDoorNumber]))
  2412.             {
  2413.                 player.doorHintString[localDoorNumber] = player drawText(player.currentDoorHint, "objective", 1.5, 0, -50, (1, 1, 1), 0, (0, 0, 0), 0, 8, false);
  2414.                 player.doorHintString[localDoorNumber].alpha = 0;
  2415.                 player.doorHintString[localDoorNumber].alignX = "center";
  2416.                 player.doorHintString[localDoorNumber].alignY = "bottom";
  2417.                 player.doorHintString[localDoorNumber].horzAlign = "center";
  2418.                 player.doorHintString[localDoorNumber].vertAlign = "bottom";
  2419.                 player.doorStringCreated[localDoorNumber] = true;
  2420.                 player.nearDoor[localDoorNumber] = false;
  2421.             }
  2422.             if (player.nearDoor[localDoorNumber] && !level.doorInUse[localDoorNumber])
  2423.             {
  2424.                 player.doorHintString[localDoorNumber] setText(player.currentDoorHint);
  2425.                 player.doorHintString[localDoorNumber].alpha = 1;
  2426.             }
  2427.             else
  2428.                 player.doorHintString[localDoorNumber].alpha = 0;
  2429.  
  2430.             if(Distance(self.origin, player.origin) <= self.triggerRadius)
  2431.             {
  2432.                 if(player.team == "allies")
  2433.                 {
  2434.                     if(self.state == "open")
  2435.                         player.currentDoorHint = "[{+melee}] ^1To Close ^7the door / [{+usereload}] Shows Current HP.";
  2436.                     if(self.state == "close")              
  2437.                         player.currentDoorHint = "[{+melee}] ^2To Open ^7the door / [{+usereload}] Shows Current HP.";
  2438.                     if(self.state == "broken")
  2439.                         player.currentDoorHint = "^1Door is Broken";
  2440.                 }
  2441.                 if(player.team == "axis")
  2442.                 {
  2443.                     if (self.state == "open")
  2444.                         player.currentDoorHint = "";
  2445.                     if(self.state == "close")
  2446.                         player.currentDoorHint = "[{+melee}] ^1To Damage ^7the door / [{+usereload}] Shows Current HP.";
  2447.                     if(self.state == "broken")
  2448.                         player.currentDoorHint = "^1Door is Broken";
  2449.                 }
  2450.                 if(player MeleeButtonPressed())
  2451.                 {
  2452.                     if (player.team == "allies")
  2453.                         self notify("triggeruse" , player);
  2454.                     if (player.team == "axis")
  2455.                         self notify("triggeruse" , player);
  2456.                         wait 0.20;
  2457.                 }
  2458.                 if(player UseButtonPressed())
  2459.                 {
  2460.                     if (player.team == "allies")
  2461.                         player iPrintlnBold("Current HP: ^1" + self.hp);
  2462.                     if (player.team == "axis")
  2463.                         player iPrintlnBold("Current HP: ^1" + self.hp);
  2464.                     wait 0.20;
  2465.                 }
  2466.                 player.nearDoor[localDoorNumber] = true;
  2467.             }
  2468.             else
  2469.                 player.nearDoor[localDoorNumber] = false;
  2470.         }
  2471.         wait 0.1;
  2472.     }
  2473. }
  2474.  
  2475. ResetDoor(localDoorNumber, open, hp, time)
  2476. {
  2477.     self.hp = hp;
  2478.     self MoveTo(open, time);
  2479.     self.state = "open";
  2480. }
  2481.  
  2482. watchForWorldTurretDeath()
  2483. {
  2484.     self endon("turretRemoved");
  2485.     level endon("game_ended");
  2486.    
  2487.     for (;;)
  2488.     {
  2489.         self waittill("destroy_turret");
  2490.         self setturretminimapvisible(0);
  2491.         playFxOnTag(level.auto_turret_settings[self.turrettype].damagefx, self, level.auto_turret_settings[self.turrettype].stunfxtag);
  2492.         wait 1;
  2493.         level thread GiveDestroyedTurretMoney("zombie", 30);
  2494.         self delete();
  2495.         self notify("turretRemoved");
  2496.        
  2497.         wait 0.01;
  2498.     }
  2499. }
  2500.  
  2501. CreateTurret(origin, angles, turrettype)
  2502. {
  2503.     turret = spawnTurret("auto_turret", origin, turrettype);
  2504.     turret.angles = angles;
  2505.     turret setModel("t6_wpn_turret_sentry_gun");
  2506.     turret setTurretTeam("allies");
  2507.     level.spawnedEntities[level.amountOfSpawnedEntities] = turret;
  2508.     level.amountOfSpawnedEntities++;
  2509.     turret.team = "allies";
  2510.     SetupTurretHealth(turret);
  2511.     turret thread watchdamage();
  2512.     turret.weaponinfoname = turrettype;
  2513.     turret.turrettype = "sentry";
  2514.     turret setturrettype(turret.turrettype);
  2515.     turret laserOn();
  2516.     turret setturretminimapvisible(1);
  2517.     turret thread watchForWorldTurretDeath();
  2518.     turret maps/mp/_entityheadicons::setentityheadicon(turret.team, turret, level.turrets_headicon_offset["default"]);
  2519.     return turret;
  2520. }
  2521.  
  2522. CreateMysteryBox(origin, angle, price)
  2523. {
  2524.     mysterybox = spawnEntity("script_model", level.supplyDropModelAxis, origin, angle);
  2525.     spawnObjective(origin, "perk_hardline");
  2526.     level.spawnedEntities[level.amountOfSpawnedEntities] = mysterybox;
  2527.     level.amountOfSpawnedEntities++;
  2528.    
  2529.     mysterybox thread MysteryBox_Think();
  2530.     mysterybox thread MysteryBox_Player_Think(price);
  2531. }
  2532.  
  2533. MysteryBox_Think()
  2534. {
  2535.     level endon("game_ended");
  2536.    
  2537.     for (;;)
  2538.     {
  2539.         self waittill("triggerMysteryBox", player, localMysteryBoxNumber);
  2540.        
  2541.         currentWeapon = spawn("script_model", self.origin);
  2542.         currentWeapon.angles = self.angles + (0, 90, 0);
  2543.         level.spawnedEntities[level.amountOfSpawnedEntities] = currentWeapon;
  2544.         level.amountOfSpawnedEntities++;
  2545.        
  2546.         self thread MysteryBox_WeaponMover_Think(currentWeapon);
  2547.        
  2548.         self waittill("mysteryBoxWeaponMoverFinished");
  2549.         self thread MysteryBox_Timeout_Think();
  2550.         player.mysteryBoxWeaponReady[localMysteryBoxNumber] = true;
  2551.        
  2552.         self waittill_any("tookMysteryBoxWeapon", "mysteryBoxWeaponTimedOut");
  2553.         wait 0.50;
  2554.         if (!self.timedOut)
  2555.             player replaceWeaponWorld(self.currentWeaponReturn, "All");
  2556.         currentWeapon delete();
  2557.         player.isUsingMysteryBox = false;
  2558.         player.mysteryBoxWeaponReady[localMysteryBoxNumber] = false;
  2559.         self.mysteryBoxInUse = false;
  2560.         self.timedOut = false;
  2561.         wait 0.01;
  2562.     }
  2563. }
  2564.  
  2565. MysteryBox_Timeout_Think()
  2566. {
  2567.     level endon("game_ended");
  2568.     self endon("tookMysteryBoxWeapon");
  2569.    
  2570.     wait 12;
  2571.     self.timedOut = true;
  2572.     self notify("mysteryBoxWeaponTimedOut");
  2573. }
  2574.  
  2575. MysteryBox_WeaponMover_Think(currentWeapon)
  2576. {
  2577.     level endon("game_ended");
  2578.  
  2579.     self.weaponArray = ReturnWeaponArray("All");
  2580.     currentWeapon MoveTo(currentWeapon.origin + (0, 0, 60), 10, 2, 2);
  2581.     for (i = 0; i < 30; i++)
  2582.     {
  2583.         tempRandomWeapon = self.weaponArray[randomint(self.weaponArray.size)];
  2584.         currentWeapon SetModel(GetWeaponModel(tempRandomWeapon));
  2585.         self.currentWeaponReturn = tempRandomWeapon;
  2586.         wait 0.30;
  2587.     }
  2588.     self notify("mysteryBoxWeaponMoverFinished");
  2589.     wait 3;
  2590.     currentWeapon MoveTo(self.origin, 10, 2, 2);
  2591. }
  2592.  
  2593. MysteryBox_Player_Think(price)
  2594. {
  2595.     level endon("game_ended");
  2596.    
  2597.     localMysteryBoxNumber = level.activeMysteryBoxes;
  2598.     level.activeMysteryBoxes++;
  2599.    
  2600.     for (;;)
  2601.     {
  2602.         foreach(player in level.players)
  2603.         {
  2604.             if (!isDefined(player.mysteryBoxStringCreated[localMysteryBoxNumber]))
  2605.             {
  2606.                 player.currentMysteryBoxHint = "Press [{+usereload}] To Use Mystery Box / ^2$" + price;
  2607.                 player.mysteryBoxHintString[localMysteryBoxNumber] = player drawText(player.currentMysteryBoxHint, "objective", 1.5, 0, -50, (1, 1, 1), 0, (0, 0, 0), 0, 8, false);
  2608.                 player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 0;
  2609.                 player.mysteryBoxHintString[localMysteryBoxNumber].alignX = "center";
  2610.                 player.mysteryBoxHintString[localMysteryBoxNumber].alignY = "bottom";
  2611.                 player.mysteryBoxHintString[localMysteryBoxNumber].horzAlign = "center";
  2612.                 player.mysteryBoxHintString[localMysteryBoxNumber].vertAlign = "bottom";
  2613.                 player.mysteryBoxStringCreated[localMysteryBoxNumber] = true;
  2614.                 player.nearMysteryBox[localMysteryBoxNumber] = false;
  2615.                 player.mysteryBoxWeaponReady[localMysteryBoxNumber] = false;
  2616.                 self.mysteryBoxInUse = false;
  2617.             }
  2618.             if (player.team != "axis")
  2619.             {
  2620.                 if (player.nearMysteryBox[localMysteryBoxNumber] && !self.mysteryBoxInUse)
  2621.                 {
  2622.                     player.currentMysteryBoxHint = "Press [{+usereload}] To Use Mystery Box  / ^2$" + price;
  2623.                     player.mysteryBoxHintString[localMysteryBoxNumber] setText(player.currentMysteryBoxHint);
  2624.                     player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 1;
  2625.                 }
  2626.                 else if (player.isUsingMysteryBox && player.mysteryBoxWeaponReady[localMysteryBoxNumber] && player.nearMysteryBox[localMysteryBoxNumber])
  2627.                 {
  2628.                     player.mysteryBoxHintString[localMysteryBoxNumber] setText(player.currentMysteryBoxHint);
  2629.                     player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 1;
  2630.                 }
  2631.                 else
  2632.                     player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 0;
  2633.                    
  2634.                 if(Distance(self.origin, player.origin) <= 60 && !self.mysteryBoxInUse)
  2635.                 {
  2636.                     player.nearMysteryBox[localMysteryBoxNumber] = true;
  2637.                     if (player UseButtonPressed())
  2638.                     {
  2639.                         if (player.money >= price)
  2640.                         {
  2641.                             wait 0.10;
  2642.                             player.currentMysteryBoxHint = "";
  2643.                             player.isUsingMysteryBox = true;
  2644.                             self.mysteryBoxInUse = true;
  2645.                             player.money -= price;
  2646.                             self notify("triggerMysteryBox", player, localMysteryBoxNumber);
  2647.                         }
  2648.                         else
  2649.                         {
  2650.                             player SendError("MoreMoney");
  2651.                             wait 0.20;
  2652.                         }
  2653.                     }
  2654.                 }
  2655.                 else if(Distance(self.origin, player.origin) <= 60 && player.isUsingMysteryBox && player.mysteryBoxWeaponReady[localMysteryBoxNumber])
  2656.                 {
  2657.                     player.nearMysteryBox[localMysteryBoxNumber] = true;
  2658.                     player.currentMysteryBoxHint = "Press [{+usereload}] To Take Weapon";
  2659.                     if (player UseButtonPressed())
  2660.                     {
  2661.                         wait 0.10;
  2662.                         self notify("tookMysteryBoxWeapon");
  2663.                     }
  2664.                 }
  2665.                 else
  2666.                     player.nearMysteryBox[localMysteryBoxNumber] = false;
  2667.             }
  2668.             else
  2669.                 player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 0;              
  2670.         }
  2671.         wait 0.01;
  2672.     }
  2673. }
  2674.  
  2675. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2676.  
  2677. //mapedits.gsc
  2678. setupCustomMap()
  2679. {
  2680.     if(getDvar("mapname") == "mp_nuketown_2020")
  2681.         level thread Nuketown();
  2682.     if(getDvar("mapname") == "mp_hijacked")
  2683.         level thread Hijacked();
  2684.     if(getDvar("mapname") == "mp_express")
  2685.         level thread Express();
  2686.     if(getDvar("mapname") == "mp_meltdown")
  2687.         level thread Meltdown();
  2688.     if(getDvar("mapname") == "mp_drone")
  2689.         level thread Drone();
  2690.     if(getDvar("mapname") == "mp_carrier")
  2691.         level thread Carrier();
  2692.     if(getDvar("mapname") == "mp_overflow")
  2693.         level thread Overflow();
  2694.     if(getDvar("mapname") == "mp_slums")
  2695.         level thread Slums();
  2696.     if(getDvar("mapname") == "mp_turbine")
  2697.         level thread Turbine();
  2698.     if(getDvar("mapname") == "mp_raid")
  2699.         level thread Raid();
  2700.     if(getDvar("mapname") == "mp_la")
  2701.         level thread Aftermath();  
  2702.     if(getDvar("mapname") == "mp_dockside")
  2703.         level thread Cargo();  
  2704.     if(getDvar("mapname") == "mp_village")
  2705.         level thread Standoff();
  2706.     if(getDvar("mapname") == "mp_nightclub")
  2707.         level thread Plaza();  
  2708.     if(getDvar("mapname") == "mp_socotra")
  2709.         level thread Yemen();
  2710.     if(getDvar("mapname") == "mp_dig")
  2711.         level thread Dig();
  2712.     if(getDvar("mapname") == "mp_pod")
  2713.         level thread Pod();
  2714.     if(getDvar("mapname") == "mp_takeoff")
  2715.         level thread Takeoff();
  2716.     if(getDvar("mapname") == "mp_frostbite")
  2717.         level thread Frost();  
  2718.     if(getDvar("mapname") == "mp_mirage")
  2719.         level thread Mirage(); 
  2720.     if(getDvar("mapname") == "mp_hydro")
  2721.         level thread Hydro();  
  2722.     if(getDvar("mapname") == "mp_skate")
  2723.         level thread Grind();  
  2724.     if(getDvar("mapname") == "mp_downhill")
  2725.         level thread Downhill();   
  2726.     if(getDvar("mapname") == "mp_concert")
  2727.         level thread Encore(); 
  2728.     if(getDvar("mapname") == "mp_vertigo")
  2729.         level thread Vertigo();
  2730.     if(getDvar("mapname") == "mp_studio")
  2731.         level thread Studio(); 
  2732.     if(getDvar("mapname") == "mp_paintball")
  2733.         level thread Rush();   
  2734.     if(getDvar("mapname") == "mp_castaway")
  2735.         level thread Cove();   
  2736.     if(getDvar("mapname") == "mp_bridge")
  2737.         level thread Detour();
  2738.     if(getDvar("mapname") == "mp_uplink")
  2739.         level thread Uplink();
  2740. }
  2741.  
  2742. Nuketown()
  2743. { }
  2744.  
  2745. Hijacked()
  2746. { }
  2747.  
  2748. Express()
  2749. { }
  2750.  
  2751. Meltdown()
  2752. { }
  2753.  
  2754. Drone()
  2755. { }
  2756.  
  2757. Carrier()
  2758. { }
  2759.  
  2760. Overflow()
  2761. { }
  2762.  
  2763. Slums()
  2764. { }
  2765.  
  2766. Turbine()
  2767. { }
  2768.  
  2769. Raid()
  2770. { }
  2771.  
  2772. Aftermath()
  2773. { }
  2774.  
  2775. Cargo()
  2776. { }
  2777.  
  2778.  Standoff()
  2779. { }
  2780.  
  2781. Plaza()
  2782. { }
  2783.  
  2784. Yemen()
  2785. { }
  2786.  
  2787. Dig()
  2788. { }
  2789.  
  2790. Pod()
  2791. { }
  2792.  
  2793. Takeoff()
  2794. { }
  2795.  
  2796. Frost()
  2797. { }
  2798.  
  2799. Mirage()
  2800. { }
  2801.  
  2802. Hydro()
  2803. { }
  2804.  
  2805. Grind()
  2806. { }
  2807.  
  2808. Downhill()
  2809. { }
  2810.  
  2811. Encore()
  2812. { }
  2813.  
  2814. Vertigo()
  2815. { }
  2816.  
  2817. Magma()
  2818. { }
  2819.  
  2820. Studio()
  2821. { }
  2822.  
  2823. Rush()
  2824. { }
  2825.  
  2826. Cove()
  2827. { }
  2828.  
  2829. Detour()
  2830. { }
  2831.  
  2832. Uplink()
  2833. { }
  2834.  
  2835. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2836.  
  2837. //menu.gsc
  2838. changeVerification(player, verlevel)
  2839. {  
  2840.     player notify("statusChanged");
  2841.     player.status = verlevel;
  2842.     player giveMenu();
  2843. }
  2844.  
  2845. Iif(bool, rTrue, rFalse)
  2846. {
  2847.     if(bool)
  2848.         return rTrue;
  2849.     else
  2850.         return rFalse;
  2851. }
  2852.  
  2853. booleanReturnVal(bool, returnIfFalse, returnIfTrue)
  2854. {
  2855.     if (bool)
  2856.         return returnIfTrue;
  2857.     else
  2858.         return returnIfFalse;
  2859. }
  2860.  
  2861. booleanOpposite(bool)
  2862. {
  2863.     if(!isDefined(bool))
  2864.         return true;
  2865.     if (bool)
  2866.         return false;
  2867.     else
  2868.         return true;
  2869. }
  2870.  
  2871. verificationToNum(status)
  2872. {
  2873.     if (status == "human")
  2874.         return 2;
  2875.     if (status == "zombie")
  2876.         return 1;
  2877.     else
  2878.         return 0;
  2879. }
  2880.  
  2881. CreateMenu()
  2882. {
  2883.     if (self.status == "human")
  2884.     {
  2885.         self add_menu("Main Menu Human", undefined, "The Shop (Status: ^2Human^7)", "Unverified");
  2886.         self add_option("Main Menu Human", "General", ::submenu, "General", "General");
  2887.         self add_option("Main Menu Human", "Equipment", ::submenu, "Equipment", "Equipment");
  2888.         self add_option("Main Menu Human", "Perks", ::submenu, "Perks", "Perks");
  2889.         self add_option("Main Menu Human", "Weapons", ::submenu, "Weapons", "Weapons");
  2890.         self add_option("Main Menu Human", "Attachments", ::submenu, "Attachments", "Attachments");
  2891.        
  2892.         self add_menu("General", "Main Menu Human", "General" , "human");
  2893.         self add_option("General", "^7+50 Health / ^2$" + level.itemPrice["Human"]["General"]["Health"], ::AddHealth, 50, "Human");
  2894.         self add_option("General", "^7Max Ammo For Current Weapon / ^2$" + level.itemPrice["Human"]["Weapons"]["Ammo"], ::RefillAmmo);
  2895.         self add_option("General", "^7UAV / ^2$" + level.itemPrice["Human"]["General"]["UAV"], ::GiveUAV, "Human");
  2896.         self add_option("General", "^7Spawn Turret / ^2$" + level.itemPrice["Human"]["General"]["Turret"], ::spawnTurretPlayer, "auto_gun_turret_mp", 5);
  2897.         self add_option("General", "^7Unlimited Ammo / ^2$" + level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"], ::infiniteAmmo);
  2898.         self add_option("General", "^7Infrared Vision / ^2$" + level.itemPrice["Human"]["General"]["Infrared"], ::giveInfraredVision, "Human");
  2899.        
  2900.         self add_menu("Equipment", "Main Menu Human", "Equipment", "human");
  2901.         self add_option("Equipment", "^7Claymore / ^2$" + level.itemPrice["Human"]["Equipment"]["claymore_mp"], ::giveEquipment, "claymore_mp", "Human");
  2902.         self add_option("Equipment", "^7Sticky Grenade / ^2$" + level.itemPrice["Human"]["Equipment"]["sticky_grenade_mp"], ::giveEquipment, "sticky_grenade_mp", "Human");
  2903.         self add_option("Equipment", "^7Frag Grenade / ^2$" + level.itemPrice["Human"]["Equipment"]["frag_grenade_mp"], ::giveEquipment, "frag_grenade_mp", "Human");
  2904.         self add_option("Equipment", "^7C4 / ^2$" + level.itemPrice["Human"]["Equipment"]["satchel_charge_mp"], ::giveEquipment, "satchel_charge_mp", "Human");
  2905.         self add_option("Equipment", "^7Shock Charge / ^2$" + level.itemPrice["Human"]["Equipment"]["proximity_grenade_mp"], ::giveEquipment, "proximity_grenade_mp", "Human");
  2906.         self add_option("Equipment", "^7Concussion Grenade / ^2$" + level.itemPrice["Human"]["Equipment"]["concussion_grenade_mp"], ::giveEquipment, "concussion_grenade_mp", "Human");
  2907.        
  2908.         self add_menu("Perks", "Main Menu Human", "Perks", "human");
  2909.         self add_option("Perks", "^7No Fall Damage / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fallheight"], ::givePerk, "specialty_fallheight", "Human");
  2910.         self add_option("Perks", "^7Faster Aiming / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fastads"], ::givePerk, "specialty_fastads", "Human");
  2911.         self add_option("Perks", "^7Unlimited Sprint / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_unlimitedsprint"], ::givePerk, "specialty_unlimitedsprint", "Human");
  2912.         self add_option("Perks", "^7Faster Weapon Switch / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fastweaponswitch"], ::givePerk, "specialty_fastweaponswitch", "Human");
  2913.         self add_option("Perks", "^7Hear Zombie Footsteps Better / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_loudenemies"], ::givePerk, "specialty_loudenemies", "Human");
  2914.         self add_option("Perks", "^7Faster Climbing / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fastmantle"], ::givePerk, "specialty_fastmantle", "Human");
  2915.         self add_option("Perks", "^7Faster Movement / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_movefaster"], ::givePerk, "specialty_movefaster", "Human");
  2916.        
  2917.         self add_menu("Weapons", "Main Menu Human", "Weapons", "human");
  2918.         self add_option("Weapons", "^7Submachine Guns / ^2$" + level.itemPrice["Human"]["Weapons"]["Submachine"], ::submenu, "SubmachineGuns");
  2919.         self add_option("Weapons", "^7Assault Rifles / ^2$" + level.itemPrice["Human"]["Weapons"]["Assault"], ::submenu, "AssaultRifles");
  2920.         self add_option("Weapons", "^7Lightmachine Guns / ^2$" + level.itemPrice["Human"]["Weapons"]["Lightmachine"], ::submenu, "LightmachineGuns");
  2921.         self add_option("Weapons", "^7Shotguns / ^2$" + level.itemPrice["Human"]["Weapons"]["Shotguns"], ::submenu, "Shotguns");
  2922.         self add_option("Weapons", "^7Sniper Rifles / ^2$" + level.itemPrice["Human"]["Weapons"]["Snipers"], ::submenu, "SniperRifles");
  2923.         self add_option("Weapons", "^7Pistols / ^2$" + level.itemPrice["Human"]["Weapons"]["Pistols"], ::submenu, "Pistols");
  2924.         self add_option("Weapons", "^7Launchers / ^2$" + level.itemPrice["Human"]["Weapons"]["Launchers"], ::submenu, "Launchers");
  2925.         self add_option("Weapons", "^7Specials / ^2$" + level.itemPrice["Human"]["Weapons"]["Specials"], ::submenu, "Specials");
  2926.         self add_option("Weapons", "^7Super Specials / ^2$" + level.itemPrice["Human"]["Weapons"]["SuperSpecials"], ::submenu, "SuperSpecials");
  2927.                
  2928.         self add_menu("SubmachineGuns", "Weapons", self.menu.menuopt["Weapons"][0], "human");
  2929.         self add_option("SubmachineGuns", "MP7", ::replaceWeapon, "mp7_mp", "Submachine");
  2930.         self add_option("SubmachineGuns", "PDW-57", ::replaceWeapon, "pdw57_mp", "Submachine");
  2931.         self add_option("SubmachineGuns", "Vector-K10", ::replaceWeapon, "vector_mp", "Submachine");
  2932.         self add_option("SubmachineGuns", "MSMC", ::replaceWeapon, "insas_mp", "Submachine");
  2933.         self add_option("SubmachineGuns", "Chicom CQB", ::replaceWeapon, "qcw05_mp", "Submachine");
  2934.         self add_option("SubmachineGuns", "Skorpion EVO", ::replaceWeapon, "evoskorpion_mp", "Submachine");
  2935.         self add_option("SubmachineGuns", "Peacekeeper", ::replaceWeapon, "peacekeeper_mp", "Submachine");
  2936.        
  2937.         self add_menu("AssaultRifles", "Weapons", self.menu.menuopt["Weapons"][1], "human");
  2938.         self add_option("AssaultRifles", "MTAR", ::replaceWeapon, "tar21_mp", "Assault");
  2939.         self add_option("AssaultRifles", "Type 25", ::replaceWeapon, "type95_mp", "Assault");
  2940.         self add_option("AssaultRifles", "SWAT-556", ::replaceWeapon, "sig556_mp", "Assault");
  2941.         self add_option("AssaultRifles", "FAL OSW", ::replaceWeapon, "sa58_mp", "Assault");
  2942.         self add_option("AssaultRifles", "M27", ::replaceWeapon, "hk416_mp", "Assault");
  2943.         self add_option("AssaultRifles", "SCAR-H", ::replaceWeapon, "scar_mp", "Assault");
  2944.         self add_option("AssaultRifles", "SMR", ::replaceWeapon, "saritch_mp", "Assault");
  2945.         self add_option("AssaultRifles", "M8A1", ::replaceWeapon, "xm8_mp", "Assault");
  2946.         self add_option("AssaultRifles", "AN-94", ::replaceWeapon, "an94_mp", "Assault");
  2947.        
  2948.         self add_menu("Shotguns", "Weapons", self.menu.menuopt["Weapons"][2], "human");
  2949.         self add_option("Shotguns", "R870 MCS", ::replaceWeapon, "870mcs_mp", "Shotguns");
  2950.         self add_option("Shotguns", "S12", ::replaceWeapon, "saiga12_mp", "Shotguns");
  2951.         self add_option("Shotguns", "KSG", ::replaceWeapon, "ksg_mp", "Shotguns");
  2952.         self add_option("Shotguns", "M1216", ::replaceWeapon, "srm1216_mp", "Shotguns");
  2953.        
  2954.         self add_menu("LightmachineGuns", "Weapons", self.menu.menuopt["Weapons"][3], "human");
  2955.         self add_option("LightmachineGuns", "MK 48", ::replaceWeapon, "mk48_mp", "Lightmachine");
  2956.         self add_option("LightmachineGuns", "QBB LSW", ::replaceWeapon, "qbb95_mp", "Lightmachine");
  2957.         self add_option("LightmachineGuns", "LSAT", ::replaceWeapon, "lsat_mp", "Lightmachine");
  2958.         self add_option("LightmachineGuns", "HAMR", ::replaceWeapon, "hamr_mp", "Lightmachine");
  2959.        
  2960.         self add_menu("SniperRifles", "Weapons", self.menu.menuopt["Weapons"][4], "human");
  2961.         self add_option("SniperRifles", "SVU-AS", ::replaceWeapon, "svu_mp", "Snipers");
  2962.         self add_option("SniperRifles", "DSR 50", ::replaceWeapon, "dsr50_mp", "Snipers");
  2963.         self add_option("SniperRifles", "Ballista", ::replaceWeapon, "ballista_mp", "Snipers");
  2964.         self add_option("SniperRifles", "XPR-50", ::replaceWeapon, "as50_mp", "Snipers");
  2965.        
  2966.         self add_menu("Pistols", "Weapons", self.menu.menuopt["Weapons"][5], "human");
  2967.         self add_option("Pistols", "Five-seven", ::replaceWeapon, "fiveseven_mp", "Pistols");
  2968.         self add_option("Pistols", "Tac-45", ::replaceWeapon, "fnp45_mp", "Pistols");
  2969.         self add_option("Pistols", "B23R", ::replaceWeapon, "beretta93r_mp", "Pistols");
  2970.         self add_option("Pistols", "Executioner", ::replaceWeapon, "judge_mp", "Pistols");
  2971.         self add_option("Pistols", "KAP-40", ::replaceWeapon, "kard_mp", "Pistols");
  2972.        
  2973.         self add_menu("Launchers", "Weapons", self.menu.menuopt["Weapons"][6], "human");
  2974.         self add_option("Launchers", "SMAW", ::replaceWeapon, "smaw_mp", "Launchers");
  2975.         self add_option("Launchers", "RPG", ::replaceWeapon, "usrpg_mp", "Launchers");
  2976.        
  2977.         self add_menu("Specials", "Weapons", self.menu.menuopt["Weapons"][7], "human");
  2978.         self add_option("Specials", "Riot Shield", ::replaceWeapon, "riotshield_mp", "Specials");
  2979.         self add_option("Specials", "Ballistic Knife", ::replaceWeapon, "knife_ballistic_mp", "Specials");
  2980.         self add_option("Specials", "Crossbow", ::replaceWeapon, "crossbow_mp", "Specials");
  2981.        
  2982.         self add_menu("SuperSpecials", "Weapons", self.menu.menuopt["Weapons"][8], "human");
  2983.         self add_option("SuperSpecials", "Grenade Launcher", ::replaceWeapon, "m32_wager_mp", "SuperSpecials");
  2984.         self add_option("SuperSpecials", "Minigun", ::replaceWeapon, "minigun_wager_mp", "SuperSpecials");
  2985.        
  2986.         self add_menu("Attachments", "Main Menu Human", "Attachments", "human");
  2987.         self add_option("Attachments", "^7FMJ / ^2$" + level.itemPrice["Human"]["Attachments"]["fmj"], ::replaceCurrentWeaponAttachment, "fmj");
  2988.         self add_option("Attachments", "^7Dual Wield / ^2$" + level.itemPrice["Human"]["Attachments"]["dw"], ::replaceCurrentWeaponAttachment, "dw");
  2989.         self add_option("Attachments", "^7Suppressor / ^2$" + level.itemPrice["Human"]["Attachments"]["silencer"], ::replaceCurrentWeaponAttachment, "silencer");
  2990.         self add_option("Attachments", "^7Fast Mag / ^2$" + level.itemPrice["Human"]["Attachments"]["dualclip"], ::replaceCurrentWeaponAttachment, "dualclip");
  2991.         self add_option("Attachments", "^7Extended Clip / ^2$" + level.itemPrice["Human"]["Attachments"]["extclip"], ::replaceCurrentWeaponAttachment, "extclip");
  2992.         self add_option("Attachments", "^7Long Barrel / ^2$" + level.itemPrice["Human"]["Attachments"]["extbarrel"], ::replaceCurrentWeaponAttachment, "extbarrel");
  2993.         self add_option("Attachments", "^7Reflex Sight / ^2$" + level.itemPrice["Human"]["Attachments"]["reflex"], ::replaceCurrentWeaponAttachment, "reflex");
  2994.         self add_option("Attachments", "^7Dual Band Scope / ^2$" + level.itemPrice["Human"]["Attachments"]["ir"], ::replaceCurrentWeaponAttachment, "ir");
  2995.         self add_option("Attachments", "^7Rapid Fire / ^2$" + level.itemPrice["Human"]["Attachments"]["rf"], ::replaceCurrentWeaponAttachment, "rf");
  2996.     }
  2997.     if (self.status == "zombie")
  2998.     {
  2999.         self add_menu("Main Menu Zombie", undefined, "The Shop (Status: ^1Zombie^7)", "Unverified");
  3000.         self add_option("Main Menu Zombie", "General", ::submenu, "GeneralZombie", "General");
  3001.         self add_option("Main Menu Zombie", "Equipment", ::submenu, "EquipmentZombie", "Equipment");
  3002.        
  3003.         self add_menu("GeneralZombie", "Main Menu Zombie", "General", "zombie");       
  3004.         self add_option("GeneralZombie", "^7+50 Health / ^2$" + level.itemPrice["Zombie"]["General"]["Health"], ::addHealth, 50, "Zombie");
  3005.         self add_option("GeneralZombie", "^7UAV / ^2$" + level.itemPrice["Zombie"]["General"]["UAV"], ::GiveUAV, "Zombie");
  3006.         self add_option("GeneralZombie", "^7Infrared Vision / ^2$" + level.itemPrice["Zombie"]["General"]["Infrared"], ::giveInfraredVision, "Zombie");
  3007.         self add_option("GeneralZombie", "^7Invisible For 10 Seconds / ^2$" + level.itemPrice["Zombie"]["General"]["Invisible"], ::invisible, 10);
  3008.         self add_option("GeneralZombie", "^7Slow Humans For 15 Seconds / ^2$" + level.itemPrice["Zombie"]["General"]["SlowHumans"], ::slowHumans, 15);
  3009.        
  3010.         self add_menu("EquipmentZombie", "Main Menu Zombie", "Equipment", "zombie");
  3011.         self add_option("EquipmentZombie", "^7Tomahawk / ^2$" + level.itemPrice["Zombie"]["Equipment"]["hatchet_mp"], ::giveEquipment, "hatchet_mp", "Zombie");
  3012.         self add_option("EquipmentZombie", "^7EMP Grenade / ^2$" + level.itemPrice["Zombie"]["Equipment"]["emp_grenade_mp"], ::giveEquipment, "emp_grenade_mp", "Zombie");
  3013.     }
  3014. }
  3015.  
  3016. add_menu_alt(Menu, prevmenu)
  3017. {
  3018.     self.menu.getmenu[Menu] = Menu;
  3019.     self.menu.menucount[Menu] = 0;
  3020.     self.menu.previousmenu[Menu] = prevmenu;
  3021. }
  3022.  
  3023. add_menu(Menu, prevmenu, menutitle, status)
  3024. {
  3025.     self.menu.status[Menu] = status;
  3026.     self.menu.getmenu[Menu] = Menu;
  3027.     self.menu.scrollerpos[Menu] = 0;
  3028.     self.menu.curs[Menu] = 0;
  3029.     self.menu.menucount[Menu] = 0;
  3030.     self.menu.subtitle[Menu] = menutitle;
  3031.     self.menu.previousmenu[Menu] = prevmenu;
  3032. }
  3033.  
  3034. add_option(Menu, Text, Func, arg1, arg2)
  3035. {
  3036.     Menu = self.menu.getmenu[Menu];
  3037.     Num = self.menu.menucount[Menu];
  3038.     self.menu.menuopt[Menu][Num] = Text;
  3039.     self.menu.menufunc[Menu][Num] = Func;
  3040.     self.menu.menuinput[Menu][Num] = arg1;
  3041.     self.menu.menuinput1[Menu][Num] = arg2;
  3042.     self.menu.menucount[Menu] += 1;
  3043. }
  3044.  
  3045. updateScrollbar()
  3046. {
  3047.     self.menu.scroller MoveOverTime(0.15);
  3048.     self.menu.scroller.y = 160 + (self.menu.curs[self.menu.currentmenu] * 18.10);
  3049. }
  3050.  
  3051. openMenu()
  3052. {
  3053.     if (!self.menu.closeondeath)
  3054.     {
  3055.         self freezeControls(false);
  3056.         if (self.status == "human")
  3057.             self StoreText("Main Menu Human", "The Shop (Status: ^2Human^7)");
  3058.         if (self.status == "zombie")
  3059.             self StoreText("Main Menu Zombie", "The Shop (Status: ^1Zombie^7)");
  3060.                        
  3061.         self.menu.background ScaleOverTime(0.3, 400, 260);
  3062.         self.menu.background FadeOverTime(0.3);
  3063.         self.menu.background.alpha = 0.65;
  3064.        
  3065.         self.menu.scroller ScaleOverTime(0.3, 400, 18);
  3066.         self.menu.scroller FadeOverTime(0.3);
  3067.         self.menu.scroller.alpha = 0.80;
  3068.  
  3069.         self updateScrollbar();
  3070.         self.menu.open = true;
  3071.     }
  3072. }
  3073.  
  3074. closeMenu()
  3075. {
  3076.     self.menu.options FadeOverTime(0.3);
  3077.     self.menu.options.alpha = 0;
  3078.    
  3079.     self.menu.background ScaleOverTime(0.3, 0, 0);
  3080.     self.menu.background FadeOverTime(0.3);
  3081.     self.menu.background.alpha = 0;
  3082.    
  3083.     self.menu.title FadeOverTime(0.3);
  3084.     self.menu.title.alpha = 0;
  3085.    
  3086.     self.menu.scroller ScaleOverTime(0.3, 0, 0);
  3087.     self.menu.scroller FadeOverTime(0.3);
  3088.     self.menu.scroller.alpha = 0;  
  3089.     self.menu.open = false;
  3090. }
  3091.  
  3092. giveMenu()
  3093. {
  3094.     if (self.status == "human" || self.status == "zombie")
  3095.     {
  3096.         if (!self.MenuInit)
  3097.         {
  3098.             self.MenuInit = true;
  3099.             self thread MenuInit();
  3100.             self thread closeMenuOnDeath();
  3101.         }
  3102.     }
  3103. }
  3104.  
  3105. destroyMenu(player)
  3106. {
  3107.     player.MenuInit = false;
  3108.     closeMenu();
  3109.     wait 0.3;
  3110.    
  3111.     player unverifyReset();
  3112.     self.menu.closeondeath = false;
  3113.     player.menu.options destroy(); 
  3114.     player.menu.background destroy();
  3115.     player.menu.scroller destroy();
  3116.     player.menu.title destroy();
  3117.     player notify("destroyMenu");
  3118. }
  3119.  
  3120. closeMenuOnDeath()
  3121. {  
  3122.     self endon("disconnect");
  3123.     self endon( "destroyMenu" );
  3124.     level endon("game_ended");
  3125.    
  3126.     for (;;)
  3127.     {
  3128.         self waittill("death");
  3129.         self.menu.closeondeath = true;
  3130.         if (self.status == "human")
  3131.             self submenu("Main Menu Human", "Main Menu Human");
  3132.         if (self.status == "zombie")
  3133.             self submenu("Main Menu Zombie", "Main Menu Zombie");
  3134.         closeMenu();
  3135.         self resetBooleans();
  3136.         self waittill("spawned_player");
  3137.         self.menu.closeondeath = false;
  3138.     }
  3139. }
  3140.  
  3141. closeMenuAnywhere()
  3142. {
  3143.     if (self.status == "human")
  3144.         self submenu("Main Menu Human", "Main Menu Human");
  3145.     if (self.status == "zombie")
  3146.         self submenu("Main Menu Zombie", "Main Menu Zombie");
  3147.     closeMenu();
  3148. }
  3149.  
  3150. StoreShaders()
  3151. {
  3152.     self.menu.background = self drawShader("white", 0, 140, 0, 0, (0, 0, 0), 0, 1, false);
  3153.     self.menu.scroller = self drawShader("white", 0, 160, 400, 18, (1, 0.502, 0), 0, 2, false);
  3154. }
  3155.  
  3156. StoreText(menu, title)
  3157. {
  3158.     self.menu.currentmenu = menu;
  3159.     string = "";
  3160.     self.menu.title destroy();
  3161.     self.menu.title = drawText(title, "objective", 2, 0, 110, (1, 1 ,1), 0, (255,0,0), 0, 3, false);
  3162.     self.menu.title FadeOverTime(0.3);
  3163.     self.menu.title.alpha = 1;
  3164.    
  3165.     for(i = 0; i < self.menu.menuopt[menu].size; i++)
  3166.     { string += self.menu.menuopt[menu][i] + "\n"; }
  3167.  
  3168.     self.menu.options destroy();
  3169.     self.menu.options = drawText(string, "objective", 1.5, 0, 160, (1, 1, 1), 0, (0, 0, 0), 0, 4);
  3170.     self.menu.options FadeOverTime(0.3);
  3171.     self.menu.options.alpha = 1;
  3172. }
  3173.  
  3174. MenuInit()
  3175. {
  3176.     self endon("disconnect");
  3177.     self endon("destroyMenu");
  3178.     level endon("game_ended");
  3179.        
  3180.     self.menu = spawnstruct();  
  3181.     self.menu.open = false;
  3182.    
  3183.     self StoreShaders();
  3184.     self CreateMenu();
  3185.    
  3186.     for(;;)
  3187.     {  
  3188.         if(self actionSlotOneButtonPressed() && !self.menu.open) // Open.
  3189.         {
  3190.             openMenu();
  3191.             wait 0.01;
  3192.         }
  3193.         if (self actionSlotFourButtonPressed() && self GetStance() == "prone" && self isHost())
  3194.         {
  3195.             self forceHost();
  3196.         }
  3197.         if(self.menu.open)
  3198.         {
  3199.             if(self useButtonPressed())
  3200.             {
  3201.                 if(isDefined(self.menu.previousmenu[self.menu.currentmenu]))
  3202.                 {
  3203.                     self submenu(self.menu.previousmenu[self.menu.currentmenu], self.menu.subtitle[self.menu.previousmenu[self.menu.currentmenu]]);
  3204.                 }
  3205.                 else
  3206.                 {
  3207.                     closeMenu();
  3208.                 }
  3209.                 wait 0.2;
  3210.             }
  3211.             if(self actionSlotOneButtonPressed() || self actionSlotTwoButtonPressed())
  3212.             {  
  3213.                 self.menu.curs[self.menu.currentmenu] += (Iif(self actionSlotTwoButtonPressed(), 1, -1));
  3214.                 self.menu.curs[self.menu.currentmenu] = (Iif(self.menu.curs[self.menu.currentmenu] < 0, self.menu.menuopt[self.menu.currentmenu].size-1, Iif(self.menu.curs[self.menu.currentmenu] > self.menu.menuopt[self.menu.currentmenu].size-1, 0, self.menu.curs[self.menu.currentmenu])));
  3215.                
  3216.                 self updateScrollbar();
  3217.             }
  3218.             if (self actionSlotThreeButtonPressed())
  3219.             {
  3220.                 closeMenuAnywhere();
  3221.             }
  3222.             if(self jumpButtonPressed())
  3223.             {
  3224.                 self thread [[self.menu.menufunc[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]]](self.menu.menuinput[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]], self.menu.menuinput1[self.menu.currentmenu][self.menu.curs[self.menu.currentmenu]]);
  3225.                 wait 0.2;
  3226.             }
  3227.         }
  3228.         wait 0.05;
  3229.     }
  3230. }
  3231.  
  3232. submenu(input, title)
  3233. {
  3234.     self.menu.options destroy();
  3235.    
  3236.     if (!isDefined(title))
  3237.         title = self.menu.subtitle[input];
  3238.     if (input == "Main Menu Human")
  3239.         self thread StoreText(input, "The Shop (Status: ^2Human^7)");
  3240.     else if (input == "Main Menu Zombie")
  3241.         self thread StoreText(input, "The Shop (Status: ^1Zombie^7)");
  3242.     else
  3243.         self thread StoreText(input, title);
  3244.        
  3245.     self.CurMenu = input;
  3246.    
  3247.     self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];
  3248.     self.menu.curs[input] = self.menu.scrollerpos[input];
  3249.    
  3250.     if (!self.menu.closeondeath)
  3251.     {
  3252.         self updateScrollbar();
  3253.     }
  3254. }
  3255.  
  3256. //Functions
  3257. resetBooleans()
  3258. {
  3259.  
  3260. }
  3261.  
  3262. unverifyReset()
  3263. {
  3264.  
  3265. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement