Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Credits: NGU THREAD: http://adf.ly/tFMjd
- //ZOMBIELAND
- //Download: http://adf.ly/tFMex
- //Pastie Last updated: 10-24-14
- //main.gsc
- #include maps/mp/gametypes/_globallogic_score;
- #include maps/mp/gametypes/_globallogic_utils;
- #include maps/mp/_scoreevents;
- #include maps/mp/teams/_teams;
- #include maps/mp/_utility;
- #include common_scripts/utility;
- #include maps/mp/gametypes/_hud_util;
- #include maps/mp/gametypes/_hud_message;
- #include maps/mp/gametypes/_spawnlogic;
- #include maps/mp/gametypes/_spawning;
- #include maps/mp/killstreaks/_turret_killstreak;
- init()
- {
- PrecacheItem("minigun_wager_mp");
- PrecacheItem("m32_wager_mp");
- PrecacheModel("t6_wpn_supply_drop_ally");
- PrecacheModel("t6_wpn_supply_drop_axis");
- PrecacheModel("t6_wpn_supply_drop_trap");
- PrecacheModel("mp_flag_green");
- PrecacheModel("mp_flag_red");
- PrecacheModel("mp_flag_neutral");
- level.spawnedEntities = [];
- level.amountOfSpawnedEntities = 0;
- level.activeZiplines = 0;
- level.activeDoors = 0;
- level.activeMysteryBoxes = 0;
- level.activeObjectiveIndex = 0;
- level.zombiecount = 0;
- level.humancount = 0;
- level.currentgametime = 0;
- level.ingraceperiod = 0;
- level.zombieficationTime = 15; //In Seconds
- level.gametime = 600; //In Seconds
- level.survivorCashBonus = 20;
- level.moneyperkill = 40;
- level.moneyperassist = 20;
- level.moneyperkillzombie = 50;
- level.moneyperzombiedeath = 20;
- level.scoreroundbased = 0;
- level.allow_teamchange = 0;
- level.teamscoreperkill = 0;
- level.teamscoreperdeath = 0;
- level.teamscoreperheadshot = 0;
- level.turretsSpawned = 0;
- level.amountOfBotsToSpawn = 11;
- level.spawnBots = false;
- level.useCustomMaps = true;
- level.timerspawned = false;
- level.zombieSelectionInProgress = true;
- level.hostCantBecomeZombie = true;
- level.supplyDropModel = "t6_wpn_supply_drop_ally";
- level.supplyDropModelAxis = "t6_wpn_supply_drop_axis";
- level.supplyDropModelTrap = "t6_wpn_supply_drop_trap";
- level.teleportFlagStartModel = "mp_flag_green";
- level.teleportFlagEndModel = "mp_flag_red";
- level.teleportFlagBothModel = "mp_flag_neutral";
- level thread monitorGame();
- level thread monitorTime();
- level thread informationBar();
- level thread onPlayerConnect();
- level thread zombieCountdown();
- level thread threadMonitor();
- level thread entityMonitor();
- }
- onPlayerConnect()
- {
- level endon("game_ended");
- for(;;)
- {
- level waittill("connected", player);
- player.status = "human";
- player.threadsReady = false;
- player.giveCash = true;
- player.money = 50;
- player.health = 100;
- player.moneymultiplier = 1;
- player.humandied = 0;
- player.startingZombie = false;
- level.ingraceperiod = 0;
- itemPriceSetup();
- player.MenuInit = false;
- player giveMenu();
- player thread onPlayerSpawned();
- player thread onPlayerDied();
- player thread onPlayerLeave();
- wait 0.05;
- }
- }
- onPlayerSpawned()
- {
- self endon("disconnect");
- level endon("game_ended");
- level.ingraceperiod = 0;
- self.healthMonitor = false;
- self.threadsReady = true;
- if (getDvar("g_gametype") != "tdm")
- thread maps/mp/gametypes/_globallogic::endgame("tie", "Gametype Must Be ^1Team Deathmatch");
- self thread weaponMonitior();
- self thread hudMonitor();
- self thread teamMonitor();
- self thread teamMonitorCustom();
- self thread damageMonitor();
- self welcomeMessage();
- self setupTeamDvars();
- self changeteam("allies");
- self notify("menuresponse", "changeclass", "class_smg");
- for(;;)
- {
- self waittill("spawned_player");
- if (!isDefined(level.customMapReady) && level.useCustomMaps)
- {
- level thread setupCustomMap();
- level.customMapReady = true;
- }
- if (isDefined(self.infraredOn))
- self giveInfraredVisionRaw();
- if (self.status == "zombie")
- self SetModel("c_usa_mp_seal6_sniper_fb");
- else
- self SetModel("c_usa_mp_seal6_lmg_fb");
- self giveSpawnWeapons(self.status);
- wait 0.10;
- self giveSpawnWeapons(self.status);
- wait 0.05;
- }
- }
- onPlayerDied()
- {
- self endon("disconnect");
- level endon("game_ended");
- for (;;)
- {
- self waittill("death");
- if (self.status != "zombie" && level.zombieficationTime == 0)
- {
- self notify("infected");
- level.infectedPlayers[getPlayerName(self)] = "infected";
- self changeteam("axis");
- self resetDvars();
- self.status = "zombie";
- self.maxhealth = 100;
- self.currentdeaths = 0;
- self.pers["deaths"] = 0;
- level thread humanDied();
- self.money = 0;
- self thread CreateMenu();
- wait 0.10;
- self thread maps/mp/gametypes/_globallogic_ui::closeMenus();
- }
- wait 0.05;
- }
- }
- onPlayerLeave()
- {
- level endon("game_ended");
- for (;;)
- {
- self waittill("disconnect");
- self destroyPlayerHuds();
- wait 0.05;
- }
- }
- humanDied()
- {
- foreach(player in level.players)
- { player.humandied = 1; wait 0.01; }
- }
- threadMonitor()
- {
- level endon("game_ended");
- level endon("winnerDeclared");
- wait 1;
- for (;;)
- {
- if (!level.inprematchperiod && level.rankedmatch)
- {
- level.gameforfeited = 0;
- level notify("abort forfeit");
- }
- foreach (player in level.players)
- {
- if (!player.threadsReady)
- {
- player.status = "human";
- player.threadsReady = true;
- player.giveCash = true;
- player.money = 50;
- player.health = 100;
- player.moneymultiplier = 1;
- player.humandied = 0;
- player.startingZombie = false;
- level.ingraceperiod = 0;
- itemPriceSetup();
- player.MenuInit = false;
- player giveMenu();
- player thread onPlayerSpawned();
- player thread onPlayerDied();
- player thread onPlayerLeave();
- player suicide();
- wait 0.05;
- }
- if (IsDefined(level.infectedPlayers[getPlayerName(player)]))
- {
- if(level.infectedPlayers[getPlayerName(player)] == "infected" && IsAlive(player) && player.pers["team"] == "allies" && player.status == "human")
- {
- player suicide();
- wait 0.05;
- }
- }
- }
- wait 0.05;
- }
- }
- teamMonitor()
- {
- self endon("disconnect");
- for (;;)
- {
- if (self IsSplitScreen())
- {
- //kick(self GetEntityNumber());
- }
- if (self.startingZombie && self.pers["team"] != "axis" && isAlive(self))
- {
- self changeteam("axis");
- self.status = "zombie";
- wait 0.10;
- self notify("menuresponse", "changeclass", "class_smg");
- self.startingZombie = false;
- }
- if (self.pers["team"] == "axis" && self.status == "human")
- {
- self changeteam("allies");
- self.status = "human";
- wait 0.10;
- self notify("menuresponse", "changeclass", "class_smg");
- }
- if (self.pers["team"] == "allies" && self.status == "zombie")
- {
- self changeteam("axis");
- self.status = "zombie";
- wait 0.10;
- self notify("menuresponse", "changeclass", "class_smg");
- }
- if (self.pers["team"] == "axis" && self.status == "human")
- {
- if (!level.inprematchperiod && level.zombieficationTime > 0)
- {
- self changeteam("allies");
- self.status = "human";
- wait 1;
- if (self.pers["team"] == "axis" && level.zombieficationTime > 0 && self.status != "zombie")
- {
- self changeteam("allies");
- self.status = "human";
- wait 0.50;
- self notify("menuresponse", "changeclass", "class_smg");
- if (self.pers["team"] == "axis")
- {
- self changeteam("axis");
- self.status = "zombie";
- wait 0.10;
- self notify("menuresponse", "changeclass", "class_smg");
- }
- }
- }
- }
- wait 0.01;
- }
- }
- teamMonitorCustom()
- {
- self endon("disconnect");
- for (;;)
- {
- self waittill("joined_team");
- wait 0.10;
- if (self.status == "human" && self.pers["team"] == "axis")
- {
- self changeteam("allies");
- self.status = "human";
- wait 0.10;
- self notify("menuresponse", "changeclass", "class_smg");
- }
- if (self.status == "zombie" && self.pers["team"] == "allies")
- {
- self changeteam("axis");
- self.status = "zombie";
- wait 0.10;
- self notify("menuresponse", "changeclass", "class_smg");
- self thread maps/mp/gametypes/_globallogic_ui::closeMenus();
- }
- wait 0.05;
- }
- }
- damageMonitor()
- {
- self endon("disconnect");
- for (;;)
- {
- if (self.status == "zombie")
- {
- self waittill("damage", damage, attacker, direction, point, type, tagname, modelname, partname, weaponname);
- if (type == "MOD_FALLING")
- {
- self.giveCash = false;
- self waittill("spawned_player");
- self.giveCash = true;
- }
- }
- wait 0.01;
- }
- }
- monitorGame()
- {
- level endon("game_ended");
- level endon("winnerDeclared");
- level.timeToPauseGame = 10;
- wait 1;
- for (;;)
- {
- if (!level.inprematchperiod)
- {
- if (level.currentgametime == level.timeToPauseGame)
- pausetimer();
- level.zombiecount = 0;
- level.humancount = 0;
- wait 0.05;
- foreach(player in level.players)
- {
- if (player.status == "zombie")
- level.zombiecount += 1;
- if (player.status == "human")
- level.humancount += 1;
- if (level.zombieSelectionInProgress)
- level.zombiecount = 1337;
- wait 0.05;
- }
- if (level.zombiecount == 0 && level.zombieficationTime == 0 && !level.zombieSelectionInProgress)
- {
- level thread selectRandomPlayers();
- }
- if (level.zombiecount == level.players.size && level.humancount == 0)
- {
- level thread finishGame();
- level thread maps/mp/gametypes/_globallogic::endgame("axis", "Zombies Win");
- level notify("winnerDeclared");
- }
- if (level.currentgametime == level.gametime)
- {
- level thread finishGame();
- level thread maps/mp/gametypes/_globallogic::endgame("allies", "Humans Win");
- level notify("winnerDeclared");
- }
- wait 0.05;
- }
- wait 0.05;
- }
- }
- finishGame()
- {
- level.TimeHUD FadeOverTime(0.50);
- level.TimeHUD.alpha = 0;
- level.ClockHUD FadeOverTime(0.50);
- level.ClockHUD.alpha = 0;
- level thread destroyHuds();
- }
- monitorTime()
- {
- level endon("game_ended");
- level endon("winnerDeclared");
- wait 1;
- for (;;)
- {
- if (!level.inprematchperiod && level.timerspawned)
- {
- if (level.currentgametime != level.gametime)
- level.currentgametime += 1;
- else
- level notify("timelimit_reached");
- }
- wait 1;
- }
- }
- weaponMonitior()
- {
- self endon("disconnect");
- level endon("game_ended");
- level endon("winnerDeclared");
- for (;;)
- {
- if (self.status == "human" && isAlive(self) && level.inprematchperiod && level.zombieficationTime != 0)
- {
- self.currentWeapon = self GetCurrentWeapon();
- if (self.currentWeapon != level.playerspawnweapon)
- {
- self.status = "human";
- self giveSpawnWeapons(self.status);
- wait 2;
- }
- }
- wait 0.05;
- }
- }
- zombieCountdown()
- {
- level endon("game_ended");
- level endon("winnerDeclared");
- level endon("zombieficationDone");
- wait 1;
- for (;;)
- {
- if (!level.inprematchperiod && !level.timerspawned)
- {
- level.TimeHUD = self drawText("Time Remaining: ", "objective", 2, 0, -30, (1, 1, 1), 0, (0, 0, 1), 0.50, 3, true);
- level.TimeHUD.alignX = "center";
- level.TimeHUD.alignY = "top";
- level.TimeHUD.horzAlign = "center";
- level.TimeHUD.vertAlign = "top";
- level.TimeHUD FadeOverTime(0.50);
- level.TimeHUD.alpha = 1;
- level.ClockHUD = self drawText("", "objective", 2, 75, -30, (1, 1, 1), 0, (0, 0, 1), 0.50, 3, true);
- level.ClockHUD.alignX = "center";
- level.ClockHUD.alignY = "top";
- level.ClockHUD.horzAlign = "center";
- level.ClockHUD.vertAlign = "top";
- level.ClockHUD setTimer(level.gametime);
- level.ClockHUD FadeOverTime(0.50);
- level.ClockHUD.alpha = 1;
- level.timerspawned = true;
- }
- if (level.zombieficationTime != 0 && !level.inprematchperiod)
- {
- iPrintlnBold("^1Zombiefication In " + level.zombieficationTime + " Seconds");
- wait 5;
- level.zombieficationTime -= 5;
- }
- if (level.zombieficationTime == 0)
- {
- level thread selectRandomPlayers();
- iPrintlnBold("^1Zombies Have Been Released...");
- level notify("zombieficationDone");
- }
- wait 0.05;
- }
- }
- hudMonitor()
- {
- self endon("disconnect");
- level endon("game_ended");
- level endon("winnerDeclared");
- self storeHuds();
- self.currentkills = self.pers["kills"];
- self.currentdeaths = self.pers["deaths"];
- self.currentassists = self.pers["assists"];
- for (;;)
- {
- if (self.giveCash)
- {
- if (self.humandied == 1)
- {
- if (self.status == "human")
- {
- self.money += level.survivorCashBonus;
- self iPrintln("You Have Been Given ^2$" + level.survivorCashBonus + " ^7Survivor Cash Bonus");
- }
- self.humandied = 0;
- wait 0.01;
- }
- if (self.pers["kills"] != self.currentkills)
- {
- if (self.status == "human")
- {
- self.money += level.moneyperkill * self.moneymultiplier;
- self.currentkills = self.pers["kills"];
- }
- if (self.status == "zombie")
- {
- self.money += level.moneyperkillzombie * self.moneymultiplier;
- self.currentkills = self.pers["kills"];
- }
- }
- if (self.pers["assists"] != self.currentassists)
- {
- if (self.status == "human")
- {
- self.money += level.moneyperassist * self.moneymultiplier;
- self.currentassists = self.pers["assists"];
- }
- if (self.status == "zombie")
- {
- self.money += level.moneyperassist * self.moneymultiplier;
- self.currentassists = self.pers["assists"];
- }
- }
- else if (self.pers["deaths"] != self.currentdeaths && self.status == "zombie")
- {
- self.money += level.moneyperzombiedeath * self.moneymultiplier;
- self.currentdeaths = self.pers["deaths"];
- }
- }
- else
- {
- self.currentkills = self.pers["kills"];
- self.currentdeaths = self.pers["deaths"];
- self.currentassists = self.pers["assists"];
- }
- self.HealthValue setValue(self.health);
- self.MoneyValue setValue(self.money);
- wait 0.05;
- }
- }
- informationBar()
- {
- level endon("game_ended");
- level.infoBarBackground = level drawShader("white", -50, 30, 1000, 35, (0, 0, 0), 0.50, 7, true);
- level.infoBarBackground.alignX = "center";
- level.infoBarBackground.alignY = "bottom";
- level.infoBarBackground.horzAlign = "center";
- level.infoBarBackground.vertAlign = "bottom";
- 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);
- level.infoBarText.alignX = "center";
- level.infoBarText.alignY = "bottom";
- level.infoBarText.horzAlign = "center";
- level.infoBarText.vertAlign = "bottom";
- for (;;)
- {
- if (level.infoBarText.x == -1000)
- level.infoBarText.x = 1000;
- else
- {
- level.infoBarText MoveOverTime(20);
- level.infoBarText.x = -1000;
- wait 25;
- }
- wait 0.05;
- }
- }
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //functions.gsc
- spawnBots()
- {
- if(!isDefined(level.botsHaveBeenSpawned))
- {
- level.botsHaveBeenSpawned = true;
- for (i = 0; i <= level.amountOfBotsToSpawn; i++)
- {
- maps/mp/bots/_bot::spawn_bot("autoassign");
- }
- }
- }
- drawValue(value, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
- {
- if (!isDefined(allclients))
- allclients = false;
- if (!allclients)
- hud = self createFontString(font, fontScale);
- else
- hud = level createServerFontString(font, fontScale);
- hud setValue(value);
- hud.x = x;
- hud.y = y;
- hud.color = color;
- hud.alpha = alpha;
- hud.glowColor = glowColor;
- hud.glowAlpha = glowAlpha;
- hud.sort = sort;
- hud.alpha = alpha;
- return hud;
- }
- drawText(text, font, fontScale, x, y, color, alpha, glowColor, glowAlpha, sort, allclients)
- {
- if (!isDefined(allclients))
- allclients = false;
- if (!allclients)
- hud = self createFontString(font, fontScale);
- else
- hud = level createServerFontString(font, fontScale);
- hud setText(text);
- hud.x = x;
- hud.y = y;
- hud.color = color;
- hud.alpha = alpha;
- hud.glowColor = glowColor;
- hud.glowAlpha = glowAlpha;
- hud.sort = sort;
- hud.alpha = alpha;
- return hud;
- }
- drawShader(shader, x, y, width, height, color, alpha, sort, allclients)
- {
- if (!isDefined(allclients))
- allclients = false;
- if (!allclients)
- hud = newClientHudElem(self);
- else
- hud = newHudElem();
- hud.elemtype = "icon";
- hud.color = color;
- hud.alpha = alpha;
- hud.sort = sort;
- hud.children = [];
- hud setParent(level.uiParent);
- hud setShader(shader, width, height);
- hud.x = x;
- hud.y = y;
- return hud;
- }
- drawBar(color, width, height, align, relative, x, y)
- {
- bar = createBar(color, width, height, self);
- bar setPoint(align, relative, x, y);
- bar.hideWhenInMenu = true;
- return bar;
- }
- welcomeMessage()
- {
- notifyData = spawnstruct();
- notifyData.titleText = "Welcome " + self.name + " To ^1Zombieland";
- notifyData.notifyText = "Made By ^5Shark";
- notifyData.glowColor = (0.3, 0.6, 0.3);
- notifyData.duration = 8;
- notifyData.font = "objective";
- notifyData.hideWhenInMenu = false;
- self thread maps/mp/gametypes/_hud_message::notifyMessage(notifyData);
- }
- SendError(errortype)
- {
- if (errortype == "MoreMoney")
- self iPrintln("^1Error: ^7You Do Not Have Enough Money For This Item");
- if (errortype == "InvalidWeaponAttachment")
- self iPrintln("^1Error: ^7You Cannot Put This Attachment On This Weapon");
- if (errortype == "InvalidWeapon")
- self iPrintln("^1Error: ^7You Are Holding An Invalid Weapon");
- if (errortype == "AlreadyHasWeapon")
- self iPrintln("^1Error: ^7You Already Own This Weapon");
- if (errortype == "AlreadyHasAttachment")
- self iPrintln("^1Error: ^7You Already Have This Attachment");
- if (errortype == "MaxAmmo")
- self iPrintln("^1Error: ^7You Already Maximum Ammo For This Weapon");
- if (errortype == "AlreadyHasUAV")
- self iPrintln("^1Error: ^7You Already Have A UAV");
- if (errortype == "MaxTurrets")
- self iPrintln("^1Error: ^7Max Number of Turrets Reached!");
- if (errortype == "AlreadyHaveEquipment")
- self iPrintln("^1Error: ^7You Already Have This Equipment");
- if (errortype == "HasPerk")
- self iPrintln("^1Error: ^7You Already Have This Perk");
- if (errortype == "AlreadyInvisible")
- self iPrintln("^1Error: ^7You Are Already Invisible");
- if (errortype == "AlreadySlowedHumans")
- self iPrintln("^1Error: ^7Humans Have Already Been Slowed");
- if (errortype == "AlreadyHasInfrared")
- self iPrintln("^1Error: ^7You Already Have Infrared Vision");
- if (errortype == "AlreadyHasInfiniteAmmo")
- self iPrintln("^1Error: ^7You Already Have Infinite Ammo");
- }
- givePlayerWeapon(weapon)
- {
- self GiveWeapon(weapon);
- ammo = weaponClipSize(weapon);
- self GiveStartAmmo(weapon);
- self setWeaponAmmoClip(weapon, ammo);
- self SwitchToWeapon(weapon);
- }
- locationSelector()
- {
- self endon("disconnect");
- self endon("death");
- self beginLocationSelection( "map_mortar_selector" );
- self disableoffhandweapons();
- self giveWeapon( "killstreak_remote_turret_mp" );
- self switchToWeapon( "killstreak_remote_turret_mp" );
- self.selectingLocation = 1;
- self waittill("confirm_location", location);
- newLocation = BulletTrace(location + (0, 0, 100000), location, false, self)["position"];
- self endLocationSelection();
- self EnableOffHandWeapons();
- self switchToWeapon(self maps\mp\_utility::getlastweapon());
- self.selectingLocation = undefined;
- return newLocation;
- }
- itemPriceSetup()
- {
- level.itemPrice["Human"]["General"]["UAV"] = 250;
- level.itemPrice["Human"]["General"]["Health"] = 90;
- level.itemPrice["Human"]["General"]["Turret"] = 300;
- level.itemPrice["Human"]["General"]["Infrared"] = 100;
- level.itemPrice["Zombie"]["General"]["UAV"] = 400;
- level.itemPrice["Zombie"]["General"]["Health"] = 150;
- level.itemPrice["Zombie"]["General"]["Invisible"] = 450;
- level.itemPrice["Zombie"]["General"]["SlowHumans"] = 350;
- level.itemPrice["Zombie"]["General"]["Infrared"] = 100;
- level.itemPrice["Human"]["Equipment"]["claymore_mp"] = 60;
- level.itemPrice["Human"]["Equipment"]["sticky_grenade_mp"] = 50;
- level.itemPrice["Human"]["Equipment"]["frag_grenade_mp"] = 50;
- level.itemPrice["Human"]["Equipment"]["satchel_charge_mp"] = 90;
- level.itemPrice["Human"]["Equipment"]["proximity_grenade_mp"] = 30;
- level.itemPrice["Human"]["Equipment"]["concussion_grenade_mp"] = 40;
- level.itemPrice["Human"]["Equipment"]["claymore_mp"] = 60;
- level.itemPrice["Zombie"]["Equipment"]["hatchet_mp"] = 70;
- level.itemPrice["Zombie"]["Equipment"]["emp_grenade_mp"] = 120;
- level.itemPrice["Human"]["Perks"]["specialty_fallheight"] = 30;
- level.itemPrice["Human"]["Perks"]["specialty_fastads"] = 40;
- level.itemPrice["Human"]["Perks"]["specialty_unlimitedsprint"] = 30;
- level.itemPrice["Human"]["Perks"]["specialty_fastweaponswitch"] = 40;
- level.itemPrice["Human"]["Perks"]["specialty_loudenemies"] = 30;
- level.itemPrice["Human"]["Perks"]["specialty_fastmantle"] = 30;
- level.itemPrice["Human"]["Perks"]["specialty_movefaster"] = 30;
- level.itemPrice["Human"]["Weapons"]["Ammo"] = 70;
- level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"] = 650;
- level.itemPrice["Human"]["Weapons"]["Submachine"] = 200;
- level.itemPrice["Human"]["Weapons"]["Assault"] = 250;
- level.itemPrice["Human"]["Weapons"]["Shotguns"] = 280;
- level.itemPrice["Human"]["Weapons"]["Lightmachine"] = 300;
- level.itemPrice["Human"]["Weapons"]["Snipers"] = 140;
- level.itemPrice["Human"]["Weapons"]["Pistols"] = 100;
- level.itemPrice["Human"]["Weapons"]["Launchers"] = 120;
- level.itemPrice["Human"]["Weapons"]["Specials"] = 180;
- level.itemPrice["Human"]["Weapons"]["SuperSpecials"] = 400;
- level.itemPrice["Human"]["Weapons"]["Equipment"] = 80;
- level.itemPrice["Human"]["Attachments"]["fmj"] = 120; //FMJ
- level.itemPrice["Human"]["Attachments"]["dw"] = 120; //Dual Wield (_dw_mp)
- level.itemPrice["Human"]["Attachments"]["silencer"] = 100; //Suppressor
- level.itemPrice["Human"]["Attachments"]["dualclip"] = 80; //Fast Mag
- level.itemPrice["Human"]["Attachments"]["extclip"] = 90; //Extended Clip
- level.itemPrice["Human"]["Attachments"]["extbarrel"] = 90; //Long Barrel
- level.itemPrice["Human"]["Attachments"]["reflex"] = 30; //Reflex Sight
- level.itemPrice["Human"]["Attachments"]["ir"] = 50; //Dual Band
- level.itemPrice["Human"]["Attachments"]["rf"] = 120; //Rapid Fire
- }
- invisible(time)
- {
- if (self.money >= level.itemPrice["Zombie"]["General"]["Invisible"])
- {
- if (!isDefined(self.isInvisible))
- {
- self endon("disconnect");
- self endon("endInvisible");
- self.invisibleTime = time;
- self.money -= level.itemPrice["Zombie"]["General"]["Invisible"];
- self iPrintln("You Are Now ^2Invisible ^7For " + time + " Seconds");
- for (;;)
- {
- if (self.invisibleTime != 0)
- {
- self.isInvisible = true;
- self hide();
- wait 1;
- self.invisibleTime -= 1;
- }
- else
- {
- self show();
- self iPrintln("You Are ^1No Longer ^7Invisible");
- self.isInvisible = undefined;
- self notify("endInvisible");
- }
- wait 0.01;
- }
- }
- else
- self SendError("AlreadyInvisible");
- }
- else
- self SendError("MoreMoney");
- }
- getPlayerName(player)
- {
- playerName = getSubStr(player.name, 0, player.name.size);
- for(i=0; i < playerName.size; i++)
- {
- if(playerName[i] == "]")
- break;
- }
- if(playerName.size != i)
- playerName = getSubStr(playerName, i + 1, playerName.size);
- return playerName;
- }
- ReturnAttachmentArray(category)
- {
- level.AttachmentArray["Submachine"][0] = "reflex"; //Reflex Sight
- level.AttachmentArray["Submachine"][1] = "steadyaim"; //Laser
- level.AttachmentArray["Submachine"][2] = "silencer"; //Suppressor
- level.AttachmentArray["Submachine"][3] = "dualclip"; //Fast Mag
- level.AttachmentArray["Submachine"][4] = "holo"; //EOTech
- level.AttachmentArray["Submachine"][5] = "grip"; //Fore Grip
- level.AttachmentArray["Submachine"][6] = "fastads"; //Quickdraw
- level.AttachmentArray["Submachine"][7] = "fmj"; //FMJ
- level.AttachmentArray["Submachine"][8] = "extbarrel"; //Long Barrel
- level.AttachmentArray["Submachine"][9] = "rangefinder"; //Target Finder
- level.AttachmentArray["Submachine"][10] = "stalker"; //Stock
- level.AttachmentArray["Submachine"][11] = "extclip"; //Extended Clip
- level.AttachmentArray["Submachine"][12] = "sf"; //Select Fire
- level.AttachmentArray["Submachine"][13] = "rf"; //Rapid Fire
- level.AttachmentArray["Submachine"][14] = "mms"; //MMS
- level.AttachmentArray["Assault"][0] = "reflex"; //Reflex Sight
- level.AttachmentArray["Assault"][1] = "fastads"; //Laser
- level.AttachmentArray["Assault"][2] = "dualclip"; //Supressor
- level.AttachmentArray["Assault"][3] = "acog"; //Fast Mag
- level.AttachmentArray["Assault"][4] = "grip"; //Grip
- level.AttachmentArray["Assault"][5] = "stalker"; //Stock
- level.AttachmentArray["Assault"][6] = "rangefinder"; //Target Finder
- level.AttachmentArray["Assault"][7] = "steadyaim"; //Laser
- level.AttachmentArray["Assault"][8] = "sf"; //Select Fire
- level.AttachmentArray["Assault"][9] = "holo"; //EOTech
- level.AttachmentArray["Assault"][10] = "silencer"; //Suppressor
- level.AttachmentArray["Assault"][11] = "fmj"; //FMJ
- level.AttachmentArray["Assault"][12] = "dualoptic"; //Hybrid Optic
- level.AttachmentArray["Assault"][13] = "extclip"; //Extended Clip
- level.AttachmentArray["Assault"][14] = "gl"; //Grenade Launcher
- level.AttachmentArray["Assault"][15] = "mms"; //MMS
- level.AttachmentArray["Shotguns"][0] = "reflex"; //Reflex Sight
- level.AttachmentArray["Shotguns"][1] = "extbarrel"; //Long Barrel
- level.AttachmentArray["Shotguns"][2] = "dualclip"; //Fast Mag
- level.AttachmentArray["Shotguns"][3] = "steadyaim"; //Laser
- level.AttachmentArray["Shotguns"][4] = "stalker"; //Stock
- level.AttachmentArray["Shotguns"][5] = "silencer"; //Suppressor
- level.AttachmentArray["Shotguns"][6] = "extclip"; //Extended Clip
- level.AttachmentArray["Shotguns"][7] = "fastads"; //Quickdraw
- level.AttachmentArray["Shotguns"][8] = "mms"; //MMS
- level.AttachmentArray["Lightmachine"][0] = "holo"; //EOTech
- level.AttachmentArray["Lightmachine"][1] = "grip"; //Fore Grip
- level.AttachmentArray["Lightmachine"][2] = "fmj"; //FMJ
- level.AttachmentArray["Lightmachine"][3] = "reflex"; //Reflex Sight
- level.AttachmentArray["Lightmachine"][4] = "fastads"; //Quickdraw
- level.AttachmentArray["Lightmachine"][5] = "rangefinder"; //Target Finder
- level.AttachmentArray["Lightmachine"][6] = "stalker"; //Stock
- level.AttachmentArray["Lightmachine"][7] = "acog"; //ACOG
- level.AttachmentArray["Lightmachine"][8] = "steadyaim"; //Laser
- level.AttachmentArray["Lightmachine"][9] = "silencer"; //Suppressor
- level.AttachmentArray["Lightmachine"][10] = "vzoom"; //Variable Zoom
- level.AttachmentArray["Lightmachine"][11] = "extclip"; //Extended Clip
- level.AttachmentArray["Lightmachine"][12] = "dualoptic"; //Hybrid Optic
- level.AttachmentArray["Lightmachine"][13] = "rf"; //Rapid Fire
- level.AttachmentArray["Lightmachine"][14] = "ir"; //Dual Band
- level.AttachmentArray["Snipers"][0] = "silencer"; //Suppressor
- level.AttachmentArray["Snipers"][1] = "swayreduc"; //Ballistics CPU
- level.AttachmentArray["Snipers"][2] = "vzoom"; //Variable Zoom
- level.AttachmentArray["Snipers"][3] = "dualclip"; //Fast Mag
- level.AttachmentArray["Snipers"][4] = "fmj"; //FMJ
- level.AttachmentArray["Snipers"][5] = "acog"; //ACOG
- level.AttachmentArray["Snipers"][6] = "extclip"; //Extended Clip
- level.AttachmentArray["Snipers"][7] = "steadyaim"; //Laser
- level.AttachmentArray["Snipers"][8] = "ir"; //Dual Band
- level.AttachmentArray["Pistols"][0] = "reflex"; //Reflex
- level.AttachmentArray["Pistols"][1] = "extclip"; //Extended Clip
- level.AttachmentArray["Pistols"][2] = "steadyaim"; //Laser
- level.AttachmentArray["Pistols"][3] = "extbarrel"; //Long Barrel
- level.AttachmentArray["Pistols"][4] = "fmj"; //FMJ
- level.AttachmentArray["Pistols"][5] = "dualclip"; //Fast Mag
- level.AttachmentArray["Pistols"][6] = "silencer"; //Suppressor
- level.AttachmentArray["Pistols"][7] = "tacknife"; //Tactical Knife
- level.AttachmentArray["Pistols"][8] = "dw"; //Dual Wield (_dw_mp)
- level.AttachmentArray["Specials"][0] = "reflex"; //Reflex Sight
- level.AttachmentArray["Specials"][1] = "acog"; //ACOG
- level.AttachmentArray["Specials"][2] = "ir"; //Dual Band
- level.AttachmentArray["Specials"][3] = "vzoom"; //Variable Zoom
- level.AttachmentArray["Specials"][4] = "stackfire"; //Tri-Bolt
- level.AttachmentArray["All"][0] = "acog"; //ACOG
- level.AttachmentArray["All"][1] = "defaultattachment"; //Nothing
- level.AttachmentArray["All"][2] = "dualclip"; //Fast Mag
- level.AttachmentArray["All"][3] = "dualoptic"; //Hybrid Optic
- level.AttachmentArray["All"][4] = "dw"; //Dual Wierd (_dw_mp)
- level.AttachmentArray["All"][5] = "extbarrel"; //Long Barrel
- level.AttachmentArray["All"][6] = "extclip"; //Extended Clip
- level.AttachmentArray["All"][7] = "fastads"; //Quickdraw
- level.AttachmentArray["All"][8] = "fmj"; //FMJ
- level.AttachmentArray["All"][9] = "gl"; //Grenade Launcher
- level.AttachmentArray["All"][10] = "grip"; //Fore Grip
- level.AttachmentArray["All"][11] = "holo"; //EOTech
- level.AttachmentArray["All"][12] = "ir"; //Dual Band
- level.AttachmentArray["All"][13] = "is"; //?
- level.AttachmentArray["All"][14] = "mms"; //MMS
- level.AttachmentArray["All"][15] = "rangefinder"; //Target Finder
- level.AttachmentArray["All"][16] = "reflex"; //Reflex Sight
- level.AttachmentArray["All"][17] = "rf"; //Rapid Fire
- level.AttachmentArray["All"][18] = "sf"; //Select Fire
- level.AttachmentArray["All"][19] = "silencer"; //Suppressor
- level.AttachmentArray["All"][20] = "stackfire"; //Tri-Bolt
- level.AttachmentArray["All"][21] = "stalker"; //Stock
- level.AttachmentArray["All"][22] = "steadyaim"; //Laser
- level.AttachmentArray["All"][23] = "swayreduc"; //Ballistics CPU
- level.AttachmentArray["All"][24] = "tacknife"; //Tactical Knife
- level.AttachmentArray["All"][25] = "vzoom"; //Variable Zoom
- if (category == "Submachine")
- return level.AttachmentArray["Submachine"];
- if (category == "Assault")
- return level.AttachmentArray["Assault"];
- if (category == "Shotguns")
- return level.AttachmentArray["Shotguns"];
- if (category == "Lightmachine")
- return level.AttachmentArray["Lightmachine"];
- if (category == "Snipers")
- return level.AttachmentArray["Snipers"];
- if (category == "Pistols")
- return level.AttachmentArray["Pistols"];
- if (category == "Specials")
- return level.AttachmentArray["Specials"];
- if (category == "All")
- return level.AttachmentArray["All"];
- }
- ReturnWeaponArray(category)
- {
- level.WeaponArray["Submachine"][0] = "mp7_mp";
- level.WeaponArray["Submachine"][1] = "pdw57_mp";
- level.WeaponArray["Submachine"][2] = "vector_mp";
- level.WeaponArray["Submachine"][3] = "insas_mp";
- level.WeaponArray["Submachine"][4] = "qcw05_mp";
- level.WeaponArray["Submachine"][5] = "evoskorpion_mp";
- level.WeaponArray["Submachine"][6] = "peacekeeper_mp";
- level.WeaponArray["Assault"][0] = "tar21_mp";
- level.WeaponArray["Assault"][1] = "type95_mp";
- level.WeaponArray["Assault"][2] = "sig556_mp";
- level.WeaponArray["Assault"][3] = "sa58_mp";
- level.WeaponArray["Assault"][4] = "hk416_mp";
- level.WeaponArray["Assault"][5] = "scar_mp";
- level.WeaponArray["Assault"][6] = "saritch_mp";
- level.WeaponArray["Assault"][7] = "xm8_mp";
- level.WeaponArray["Assault"][8] = "an94_mp";
- level.WeaponArray["Shotguns"][0] = "870mcs_mp";
- level.WeaponArray["Shotguns"][1] = "saiga12_mp";
- level.WeaponArray["Shotguns"][2] = "ksg_mp";
- level.WeaponArray["Shotguns"][3] = "srm1216_mp";
- level.WeaponArray["Lightmachine"][0] = "mk48_mp";
- level.WeaponArray["Lightmachine"][1] = "qbb95_mp";
- level.WeaponArray["Lightmachine"][2] = "lsat_mp";
- level.WeaponArray["Lightmachine"][3] = "hamr_mp";
- level.WeaponArray["Snipers"][0] = "svu_mp";
- level.WeaponArray["Snipers"][1] = "dsr50_mp";
- level.WeaponArray["Snipers"][2] = "ballista_mp";
- level.WeaponArray["Snipers"][3] = "as50_mp";
- level.WeaponArray["Pistols"][0] = "fiveseven_mp";
- level.WeaponArray["Pistols"][1] = "fnp45_mp";
- level.WeaponArray["Pistols"][2] = "baretta93r_mp";
- level.WeaponArray["Pistols"][3] = "judge_mp";
- level.WeaponArray["Pistols"][4] = "kard_mp";
- level.WeaponArray["Launchers"][0] = "smaw_mp";
- level.WeaponArray["Launchers"][1] = "usrpg_mp";
- level.WeaponArray["Launchers"][2] = "fhj18_mp";
- level.WeaponArray["SuperSpecials"][0] = "minigun_wager_mp";
- level.WeaponArray["SuperSpecials"][1] = "m32_wager_mp";
- level.WeaponArray["Specials"][2] = "riotshield_mp";
- level.WeaponArray["Specials"][3] = "crossbow_mp";
- level.WeaponArray["Specials"][4] = "minigun_mp";
- level.WeaponArray["Specials"][5] = "knife_ballistic_mp";
- level.WeaponArray["Lethals"][0] = "frag_grenade_mp";
- level.WeaponArray["Lethals"][1] = "sticky_grenade_mp";
- level.WeaponArray["Lethals"][2] = "hatchet_mp";
- level.WeaponArray["Lethals"][3] = "bouncingbetty_mp";
- level.WeaponArray["Lethals"][4] = "satchet_charge_mp";
- level.WeaponArray["Lethals"][5] = "claymore_mp";
- level.WeaponArray["Tacticals"][0] = "concussion_grenade_mp";
- level.WeaponArray["Tacticals"][1] = "willy_pete_mp";
- level.WeaponArray["Tacticals"][2] = "sensor_grenade_mp";
- level.WeaponArray["Tacticals"][3] = "emp_grenade_mp";
- level.WeaponArray["Tacticals"][4] = "proximity_grenade_mp";
- level.WeaponArray["Tacticals"][5] = "pda_hack_mp";
- level.WeaponArray["Tacticals"][6] = "flash_grenade_mp";
- level.WeaponArray["Tacticals"][7] = "trophy_system_mp";
- level.WeaponArray["Tacticals"][8] = "tactical_insertion_mp";
- level.WeaponArray["All"][0] = "mp7_mp";
- level.WeaponArray["All"][1] = "pdw57_mp";
- level.WeaponArray["All"][2] = "vector_mp";
- level.WeaponArray["All"][3] = "insas_mp";
- level.WeaponArray["All"][4] = "qcw05_mp";
- level.WeaponArray["All"][5] = "evoskorpion_mp";
- level.WeaponArray["All"][6] = "peacekeeper_mp";
- level.WeaponArray["All"][7] = "tar21_mp";
- level.WeaponArray["All"][8] = "type95_mp";
- level.WeaponArray["All"][9] = "sig556_mp";
- level.WeaponArray["All"][10] = "sa58_mp";
- level.WeaponArray["All"][11] = "hk416_mp";
- level.WeaponArray["All"][12] = "scar_mp";
- level.WeaponArray["All"][13] = "saritch_mp";
- level.WeaponArray["All"][14] = "xm8_mp";
- level.WeaponArray["All"][15] = "an94_mp";
- level.WeaponArray["All"][16] = "870mcs_mp";
- level.WeaponArray["All"][17] = "saiga12_mp";
- level.WeaponArray["All"][18] = "ksg_mp";
- level.WeaponArray["All"][19] = "srm1216_mp";
- level.WeaponArray["All"][20] = "mk48_mp";
- level.WeaponArray["All"][21] = "qbb95_mp";
- level.WeaponArray["All"][22] = "lsat_mp";
- level.WeaponArray["All"][23] = "hamr_mp";
- level.WeaponArray["All"][24] = "svu_mp";
- level.WeaponArray["All"][25] = "dsr50_mp";
- level.WeaponArray["All"][26] = "ballista_mp";
- level.WeaponArray["All"][27] = "as50_mp";
- level.WeaponArray["All"][28] = "fiveseven_mp";
- level.WeaponArray["All"][29] = "fnp45_mp";
- level.WeaponArray["All"][30] = "baretta93r_mp";
- level.WeaponArray["All"][31] = "judge_mp";
- level.WeaponArray["All"][32] = "kard_mp";
- level.WeaponArray["All"][33] = "smaw_mp";
- level.WeaponArray["All"][34] = "usrpg_mp";
- level.WeaponArray["All"][35] = "fhj18_mp";
- level.WeaponArray["All"][36] = "minigun_wager_mp";
- level.WeaponArray["All"][37] = "m32_wager_mp";
- level.WeaponArray["All"][38] = "riotshield_mp";
- level.WeaponArray["All"][39] = "crossbow_mp";
- level.WeaponArray["All"][40] = "knife_ballistic_mp";
- level.WeaponArray["All"][41] = "knife_held_mp";
- if (category == "Submachine")
- return level.WeaponArray["Submachine"];
- if (category == "Assault")
- return level.WeaponArray["Assault"];
- if (category == "Shotguns")
- return level.WeaponArray["Shotguns"];
- if (category == "Lightmachine")
- return level.WeaponArray["Lightmachine"];
- if (category == "Snipers")
- return level.WeaponArray["Snipers"];
- if (category == "Pistols")
- return level.WeaponArray["Pistols"];
- if (category == "Launchers")
- return level.WeaponArray["Launchers"];
- if (category == "Specials")
- return level.WeaponArray["Specials"];
- if (category == "SuperSpecials")
- return level.WeaponArray["SuperSpecials"];
- if (category == "Lethals")
- return level.WeaponArray["Lethals"];
- if (category == "Tacticals")
- return level.WeaponArray["Tacticals"];
- if (category == "All")
- return level.WeaponArray["All"];
- }
- giveSpawnWeapons(status)
- {
- self ClearPerks();
- self takeAllWeapons();
- self SetActionSlot(1, "");
- self SetActionSlot(2, "");
- self SetActionSlot(3, "");
- self SetActionSlot(4, "");
- level.playerspawnweapon = "fiveseven_mp";
- if (status == "human")
- {
- self.spawnWeapons[0] = level.playerspawnweapon; //Primary
- self.spawnWeapons[1] = "knife_held_mp"; //Secondary
- self.spawnWeapons[2] = ""; //Lethal
- self.spawnWeapons[3] = ""; //Tacitcal
- self.spawnWeapons[4] = "knife_mp"; //Extra
- self.primaryWeapon = self.spawnWeapons[0];
- self.secondaryWeapon = self.spawnWeapons[1];
- }
- if (status == "zombie")
- {
- self.spawnWeapons[0] = "knife_held_mp"; //Primary
- self.spawnWeapons[1] = ""; //Secondary
- self.spawnWeapons[2] = ""; //Lethal
- self.spawnWeapons[3] = "tactical_insertion_mp"; //Tactical
- self setPerk("specialty_fastmantle");
- self setPerk("specialty_fastmeleerecovery");
- self setPerk("specialty_fastladderclimb");
- self setPerk("specialty_fallheight");
- self setPerk("specialty_fastequipmentuse");
- self setPerk("specialty_fasttoss");
- self setPerk("specialty_movefaster");
- self setPerk("specialty_unlimitedsprint");
- self setPerk("specialty_quieter");
- }
- for (i = 0; i < 5; i++)
- {
- if (isDefined(self.spawnWeapons[i]))
- {
- self GiveWeapon(self.spawnWeapons[i]);
- self setWeaponAmmoClip(self.spawnWeapons[i], weaponClipSize(self.spawnWeapons[i]));
- self GiveStartAmmo(self.spawnWeapons[i]);
- self SwitchToWeapon(self.spawnWeapons[0]);
- }
- wait 0.05;
- }
- }
- isValidWeapon(WeaponRef)
- {
- if (StrTok(WeaponRef, "_")[1] != "dw")
- WeaponRef = StrTok(WeaponRef, "+")[0];
- else
- WeaponRef = StrTok(WeaponRef, "_")[0] + "_mp";
- self.validReturn = WeaponRef;
- self.TempWeaponArray = ReturnWeaponArray("All");
- for (i = 0; i < self.TempWeaponArray.size; i++)
- {
- if (self.TempWeaponArray[i] == WeaponRef)
- {
- return true;
- }
- }
- return false;
- }
- isValidAttachment(WeaponRef, AttachmentRef)
- {
- if (StrTok(WeaponRef, "_")[1] != "dw")
- WeaponRef = StrTok(WeaponRef, "+")[0];
- else
- WeaponRef = StrTok(WeaponRef, "_")[0] + "_mp";
- self.validReturn = WeaponRef;
- self.SubmachineGuns = ReturnWeaponArray("Submachine");
- self.AssaultGuns = ReturnWeaponArray("Assault");
- self.Shotguns = ReturnWeaponArray("Shotguns");
- self.LightmachineGuns = ReturnWeaponArray("Lightmachine");
- self.Snipers = ReturnWeaponArray("Snipers");
- self.Pistols = ReturnWeaponArray("Pistols");
- self.WeaponCategory = undefined;
- self.AttachmentList = undefined;
- for (a = 0; a < self.SubmachineGuns.size; a++)
- {
- if (self.SubmachineGuns[a] == WeaponRef)
- {
- self.WeaponCategory = "Submachine";
- }
- }
- for (b = 0; b < self.AssaultGuns.size; b++)
- {
- if (self.AssaultGuns[b] == WeaponRef)
- {
- self.WeaponCategory = "Assault";
- }
- }
- for (c = 0; c < self.Shotguns.size; c++)
- {
- if (self.Shotguns[c] == WeaponRef)
- {
- self.WeaponCategory = "Shotguns";
- }
- }
- for (d = 0; d < self.LightmachineGuns.size; d++)
- {
- if (self.LightmachineGuns[d] == WeaponRef)
- {
- self.WeaponCategory = "Lightmachine";
- }
- }
- for (e = 0; e < self.Snipers.size; e++)
- {
- if (self.Snipers[e] == WeaponRef)
- {
- self.WeaponCategory = "Snipers";
- }
- }
- for (f = 0; f < self.Pistols.size; f++)
- {
- if (self.Pistols[f] == WeaponRef)
- {
- self.WeaponCategory = "Pistols";
- }
- }
- for (g = 0; g < 2; g++)
- {
- if (WeaponRef == "crossbow_mp")
- {
- self.WeaponCategory = "Specials";
- }
- }
- if (!isDefined(self.WeaponCategory))
- return false;
- self.AttachmentList = ReturnAttachmentArray(self.WeaponCategory);
- for (h = 0; h < self.AttachmentList.size; h++)
- {
- if (self.AttachmentList[h] == AttachmentRef)
- {
- return true;
- }
- }
- return false;
- }
- giveInfraredVision(status)
- {
- if (self.money >= level.itemPrice[status]["General"]["Infrared"])
- {
- if (!isDefined(self.infraredOn))
- {
- self.infraredOn = true;
- self iPrintln("^2Infrared Vision ^7Purchased Successfully");
- self.money -= level.itemPrice[status]["General"]["Infrared"];
- self setinfraredvision(1);
- self useservervisionset(1);
- self setvisionsetforplayer(level.remore_mortar_infrared_vision, 1);
- }
- else
- self SendError("AlreadyHasInfrared");
- }
- else
- self SendError("MoreMoney");
- }
- giveInfraredVisionRaw()
- {
- self setinfraredvision(1);
- self useservervisionset(1);
- self setvisionsetforplayer(level.remore_mortar_infrared_vision, 1);
- }
- RefillAmmo()
- {
- self.currentWeapon = self GetCurrentWeapon();
- if (self.money >= level.itemPrice["Human"]["Weapons"]["Ammo"])
- {
- if (isValidWeapon(self.currentWeapon))
- {
- self setWeaponAmmoClip(self.currentWeapon, weaponClipSize(self.currentWeapon));
- self giveMaxAmmo(self.currentWeapon);
- self.money -= level.itemPrice["Human"]["Weapons"]["Ammo"];
- self iPrintln("^2Max Ammo ^7Purchased Successfully");
- }
- else
- self SendError("InvalidWeapon");
- }
- else
- self SendError("MoreMoney");
- }
- AddHealth(amount, status)
- {
- if (self.money >= level.itemPrice[status]["General"]["Health"])
- {
- self.addingHealth = true;
- wait 0.01;
- self.health += amount;
- self.maxhealth = self.health;
- self.addingHealth = false;
- if (!self.healthMonitor)
- self thread MonitorHealth();
- self.money -= level.itemPrice[status]["General"]["Health"];
- self iPrintln("^1+50 Health ^7Purchased Successfully");
- }
- else
- self SendError("MoreMoney");
- }
- MonitorHealth()
- {
- self endon("disconnect");
- self endon("infected");
- self endon("normalHealth");
- level endon("game_ended");
- self.healthMonitor = true;
- for (;;)
- {
- if (!self.addingHealth)
- {
- if (self.health > 100)
- self.maxhealth = self.health;
- }
- if (self.health < 100)
- {
- self.maxhealth = 100;
- self.healthMonitor = false;
- self notify("normalHealth");
- }
- wait 0.01;
- }
- }
- GiveUAV(status)
- {
- if (self.money >= level.itemPrice[status]["General"]["UAV"])
- {
- if (!isDefined(self.UAV))
- {
- self.UAV = true;
- self SetClientUIVisibilityFlag("g_compassShowEnemies", 1);
- self.money -= level.itemPrice[status]["General"]["UAV"];
- self iPrintln("^2UAV ^7Purchased Successfully");
- }
- else
- SendError("AlreadyHasUAV");
- }
- else
- self SendError("MoreMoney");
- }
- replaceWeaponWorld(weapon, category)
- {
- self.currentWeapon = self GetCurrentWeapon();
- if (isValidWeapon(self.currentWeapon))
- {
- self.currentWeaponNew = self.validReturn;
- if (weapon != self.primaryWeapon && weapon != self.secondaryWeapon)
- {
- if (self.currentWeapon == self.primaryWeapon)
- self.primaryWeapon = weapon;
- if (self.currentWeapon == self.secondaryWeapon)
- self.secondaryWeapon = weapon;
- if (self.currentWeapon == "knife_held_mp")
- self TakeWeapon("knife_held_mp");
- else
- self TakeWeapon(self.currentWeapon);
- self GiveWeapon(weapon);
- self setWeaponAmmoClip(weapon, weaponClipSize(weapon));
- self GiveStartAmmo(weapon);
- self SwitchToWeapon(weapon);
- }
- else
- self SendError("AlreadyHasWeapon");
- }
- else
- self SendError("InvalidWeapon");
- }
- replaceWeapon(weapon, category)
- {
- self.currentWeapon = self GetCurrentWeapon();
- if (self.money >= level.itemPrice["Human"]["Weapons"][category])
- {
- if (isValidWeapon(self.currentWeapon))
- {
- self.currentWeaponNew = self.validReturn;
- if (weapon != self.primaryWeapon && weapon != self.secondaryWeapon)
- {
- if (self.currentWeapon == self.primaryWeapon)
- self.primaryWeapon = weapon;
- if (self.currentWeapon == self.secondaryWeapon)
- self.secondaryWeapon = weapon;
- if (self.currentWeapon == "knife_held_mp")
- self TakeWeapon("knife_held_mp");
- else
- self TakeWeapon(self.currentWeapon);
- self GiveWeapon(weapon);
- self setWeaponAmmoClip(weapon, weaponClipSize(weapon));
- self GiveStartAmmo(weapon);
- self SwitchToWeapon(weapon);
- self.money -= level.itemPrice["Human"]["Weapons"][category];
- }
- else
- self SendError("AlreadyHasWeapon");
- }
- else
- self SendError("InvalidWeapon");
- }
- else
- self SendError("MoreMoney");
- }
- replaceWeaponAttachment(weapon, attachment)
- {
- self.currentWeapon = self GetCurrentWeapon();
- if (self.money >= level.itemPrice["Human"]["Attachments"][attachment])
- {
- if (isValidWeapon(self.currentWeapon) && self isValidAttachment(weapon, attachment) && self.currentWeapon != "knife_held_mp")
- {
- if (self.currentWeapon != weapon + "+" + attachment)
- {
- if (attachment == "dw" && StrTok(self.currentWeapon, "_")[1] == "dw")
- self SendError("AlreadyHasAttachment");
- else
- {
- self.currentWeaponNew = self.validReturn;
- oldAmmo = self GetWeaponAmmoStock(self.currentWeapon);
- self TakeWeapon(self.currentWeapon);
- self.newWeaponString = weapon + "+" + attachment;
- if (attachment == "dw")
- self GiveWeapon(StrTok(self.currentWeaponNew, "_")[0] + "_dw_mp");
- else
- self GiveWeapon(self.newWeaponString);
- self SetWeaponAmmoStock(self.newWeaponString, oldAmmo);
- self SwitchToWeapon(self.newWeaponString);
- self.money -= level.itemPrice["Human"]["Attachments"][attachment];
- }
- }
- else
- self SendError("AlreadyHasAttachment");
- }
- else
- self SendError("InvalidWeaponAttachment");
- }
- else
- self SendError("MoreMoney");
- }
- replaceCurrentWeaponAttachment(attachment)
- {
- self.currentWeapon = self GetCurrentWeapon();
- if (StrTok(self.currentWeapon, "_")[1] != "dw")
- self.currentWeapon = StrTok(self.currentWeapon, "+")[0];
- else
- self.currentWeapon = StrTok(self.currentWeapon, "_")[0] + "_mp";
- self.validReturn = self.currentWeapon;
- self thread replaceWeaponAttachment(self.currentWeapon, attachment);
- }
- storeHuds()
- {
- self.MoneyHUD destroyElem();
- self.MoneyHUD destroy();
- self.MoneyHUD = self drawText("Money: ", "objective", 2, 0, 130, (1, 1, 1), 0, (0, 1, 0), 0.50, 1, false);
- self.MoneyHUD.alignX = "left";
- self.MoneyHUD.horzAlign = "left";
- self.MoneyHUD.vertAlign = "center";
- self.MoneyHUD FadeOverTime(0.50);
- self.MoneyHUD.alpha = 1;
- self.HealthHUD destroyElem();
- self.HealthHUD destroy();
- self.HealthHUD = self drawText("Health: ", "objective", 2, 0, 155, (1, 1, 1), 0, (1, 0, 0), 0.50, 2, false);
- self.HealthHUD.alignX = "left";
- self.HealthHUD.horzAlign = "left";
- self.HealthHUD.vertAlign = "center";
- self.HealthHUD FadeOverTime(0.50);
- self.HealthHUD.alpha = 1;
- self.HealthValue = drawValue(self.health, "objective", 2, 57, 155, (1, 1, 1), 0, (1, 0, 0), 0.50, 2, false);
- self.HealthValue.alignX = "left";
- self.HealthValue.horzAlign = "left";
- self.HealthValue.vertAlign = "center";
- self.HealthValue FadeOverTime(0.50);
- self.HealthValue.alpha = 1;
- self.MoneyValue = drawValue(self.money, "objective", 2, 57, 130, (1, 1, 1), 0, (0, 1, 0), 0.50, 2, false);
- self.MoneyValue.alignX = "left";
- self.MoneyValue.horzAlign = "left";
- self.MoneyValue.vertAlign = "center";
- self.MoneyValue FadeOverTime(0.50);
- self.MoneyValue.alpha = 1;
- }
- destroyHuds()
- {
- foreach(player in level.players)
- {
- player.MoneyHUD destroyElem();
- player.MoneyHUD destroy();
- player.HealthHUD destroyElem();
- player.HealthHUD destroy();
- player.HealthValue destroyElem();
- player.HealthValue destroy();
- player.MoneyValue destroyElem();
- player.MoneyValue destroy();
- wait 0.05;
- }
- level.infoBarText destroyElem();
- level.infoBarText destroy();
- }
- destroyPlayerHuds()
- {
- self.MoneyHUD destroyElem();
- self.MoneyHUD destroy();
- self.HealthHUD destroyElem();
- self.HealthHUD destroy();
- self.HealthValue destroyElem();
- self.HealthValue destroy();
- self.MoneyValue destroyElem();
- self.MoneyValue destroy();
- }
- returnRandomPlayer()
- {
- return randomint(level.players.size);
- }
- selectRandomPlayers()
- {
- level.startingZombieCount = 1;
- for (i = 0; i < level.startingZombieCount; i++)
- {
- level.zombieSelectionInProgress = true;
- level.selectedPlayer[i] = level thread returnRandomPlayer();
- level.currentSelectedPlayer = level.selectedPlayer[i];
- if (level.players[level.currentSelectedPlayer].name != "ScaRzModZV10" && level.players[level.currentSelectedPlayer] isHost() && level.hostCantBecomeZombie)
- { }
- else
- {
- level.players[level.currentSelectedPlayer] suicide();
- level.players[level.currentSelectedPlayer].startingZombie = true;
- level.zombiecount += 1;
- }
- wait 0.05;
- }
- wait 1;
- level.zombieSelectionInProgress = false;
- return level.selectedPlayers;
- }
- traceBullet(traceDistance, traceReturn, detectPlayers)
- {
- if (!isDefined(traceDistance))
- traceDistance = 10000000;
- if (!isDefined(traceReturn))
- traceReturn = "position";
- if (!isDefined(detectPlayers))
- detectPlayers = false;
- return bulletTrace(self getEye(), self getEye() + VectorScale(AnglesToForward(self getPlayerAngles()), traceDistance), detectPlayers, self)[traceReturn];
- }
- slowHumans(time)
- {
- if (self.money >= level.itemPrice["Zombie"]["General"]["SlowHumans"])
- {
- if (!isDefined(level.slowHumans))
- {
- self endon("disconnect");
- self endon("endSlowHumans");
- self.money -= level.itemPrice["Zombie"]["General"]["SlowHumans"];
- level.slowHumans = true;
- level.slowHumansTime = time;
- iPrintln("^1All Humans Have Been Slowed For " + time + " Seconds");
- for (;;)
- {
- if (level.slowHumansTime != 0)
- {
- level thread setAllPlayerSpeed(0.7);
- wait 1;
- level.slowHumansTime -= 1;
- }
- else
- {
- level thread setAllPlayerSpeed(1);
- level.slowHumans = undefined;
- iPrintln("^2Humans Speed Returned To Normal");
- self notify("endSlowHumans");
- }
- wait 0.01;
- }
- }
- else
- self SendError("AlreadySlowedHumans");
- }
- else
- self SendError("MoreMoney");
- }
- setAllPlayerSpeed(speed)
- {
- foreach (player in level.players)
- {
- if (player.status != "zombie")
- player setMoveSpeedScale(speed);
- wait 0.01;
- }
- }
- infiniteAmmo()
- {
- if (self.money >= level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"])
- {
- if (!isDefined(self.infiniteAmmo))
- {
- self endon("disconnect");
- self endon("infected");
- self.infiniteAmmo = true;
- self.money -= level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"];
- for (;;)
- {
- wait 0.1;
- weapon = self GetCurrentWeapon();
- self GiveMaxAmmo(weapon);
- }
- }
- else
- self SendError("AlreadyHasInfiniteAmmo");
- }
- else
- self SendError("MoreMoney");
- }
- watchForTurretDeath()
- {
- self endon("turretRemoved");
- level endon("game_ended");
- for (;;)
- {
- self waittill("destroy_turret");
- self setturretminimapvisible(0);
- playFxOnTag(level.auto_turret_settings[self.turrettype].damagefx, self, level.auto_turret_settings[self.turrettype].stunfxtag);
- wait 1;
- level thread GiveDestroyedTurretMoney("zombie", 30);
- self delete();
- level.turretsSpawned -= 1;
- self notify("turretRemoved");
- wait 0.01;
- }
- }
- GiveDestroyedTurretMoney(status, money)
- {
- foreach (player in level.players)
- {
- if (player.status == status)
- {
- player.money += money;
- player iPrintln("A Human Turret Was ^1Destroyed^7, All Zombies Have Been Given ^2$30 Bonus Cash");
- }
- wait 0.01;
- }
- }
- spawnTurretPlayer(turrettype, maxturrets)
- {
- if (self.money >= level.itemPrice["Human"]["General"]["Turret"])
- {
- if (level.turretsSpawned < maxturrets)
- {
- self iPrintln("^2Turret ^7Purchased and Spawned Successfully");
- self.money -= level.itemPrice["Human"]["General"]["Turret"];
- spawnPosition = self traceBullet(200);
- turret = spawnTurret("auto_turret", spawnPosition, turrettype);
- level.turretsSpawned += 1;
- turret.angles = (0, self getPlayerAngles()[1], self getPlayerAngles()[2]);
- turret setModel("t6_wpn_turret_sentry_gun");
- turret setTurretTeam("allies");
- turret.team = "allies";
- SetupTurretHealth(turret);
- turret thread watchdamage();
- turret.weaponinfoname = turrettype;
- turret.turrettype = "sentry";
- turret setturrettype(turret.turrettype);
- turret laserOn();
- turret setturretminimapvisible(1);
- turret thread watchForTurretDeath();
- turret maps/mp/_entityheadicons::setentityheadicon(self.pers["team"], self, level.turrets_headicon_offset["default"]);
- return turret;
- }
- else
- self SendError("MaxTurrets");
- }
- else
- self SendError("MoreMoney");
- }
- playerAnglesToForward(player, distance)
- {
- return player.origin + VectorScale(AnglesToForward(player getPlayerAngles(), distance));
- }
- ToggleUFO()
- {
- self endon("disconnect");
- self endon("death");
- self endon("disableUFO");
- self.UFO = booleanOpposite(self.UFO);
- self iPrintln(booleanReturnVal(self.UFO, "UFO Mode: ^1Off", "UFO Mode: ^2On^7\nPress [{+frag}] To Move!"));
- if (self.UFO)
- {
- self.parentObject = spawn("script_origin", self.origin);
- self.parentObject.angles = self.angles;
- self PlayerLinkTo(self.parentObject, undefined);
- self disableWeapons();
- for(;;)
- {
- if(self fragButtonPressed())
- self.parentObject moveTo(playerAnglesToForward(self, 25), 0.05);
- wait 0.01;
- }
- }
- else
- {
- self unlink();
- self enableWeapons();
- self.parentObject delete();
- self notify("disableUFO");
- }
- }
- forceHost()
- {
- if (self isHost())
- {
- self.forceHost = booleanOpposite(self.forceHost);
- self iPrintln(booleanReturnVal(self.forceHost, "Force Host: ^1Off", "Force Host: ^2On"));
- if (self.forceHost)
- {
- setDvar("party_connectToOthers", "0");
- setDvar("partyMigrate_disabled", "1");
- setDvar("party_mergingEnabled", "0");
- setDvar("allowAllNAT", "1");
- }
- else
- {
- setDvar("party_connectToOthers", "1");
- setDvar("partyMigrate_disabled", "0");
- setDvar("party_mergingEnabled", "1");
- setDvar("allowAllNAT", "0");
- }
- }
- }
- resetDvars()
- {
- self.infraredOn = undefined;
- self.infiniteAmmo = undefined;
- self.UAV = undefined;
- self SetClientUIVisibilityFlag("g_compassShowEnemies", 0);
- }
- setupTeamDvars()
- {
- if (level.spawnBots)
- self thread spawnBots();
- level.teamLimit = 18;
- level.teamBalance = 0;
- level.disableweapondrop = 1;
- level.allow_teamchange = 0;
- setDvar("scr_disable_weapondrop", 1);
- setDvar("scr_teambalance", 0);
- setDvar("party_autoteams", 0);
- setDvar("ui_allow_teamchange", "0");
- setDvar("g_TeamName_Allies", "Humans");
- setDvar("g_TeamName_Axis", "Zombies");
- setDvar("g_customTeamName_Allies", "Humans");
- setDvar("g_customTeamName_Axis", "Zombies");
- }
- RandomWeapon()
- {
- level endon("game_ended");
- level endon("winnerDeclared");
- while(1)
- {
- id = random(level.tbl_weaponids);
- weaponname = id["reference"];
- attachmentlist = id["attachment"];
- attachments = strtok( attachmentlist, " " );
- attachments[attachments.size] = "";
- attachment = random(attachments);
- 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")
- correctweapon = false;
- else
- correctweapon = true;
- if (weaponname == "m32")
- return weaponname + "wager_mp+" + attachment;
- if (weaponname == "minigun")
- return weaponname + "wager_mp+" + attachment;
- if (correctweapon)
- return weaponname + "_mp+" + attachment;
- wait 0.05;
- }
- }
- giveEquipment(equipment, status)
- {
- if (self.money >= level.itemPrice[status]["Equipment"][equipment])
- {
- self TakeWeapon(self.previousEquipment);
- self.previousEquipment = equipment;
- self GiveWeapon(equipment);
- self SetWeaponAmmoClip(equipment, 1);
- self iPrintln("Equipment Purchased Successfully: ^2" + equipment);
- self.money -= level.itemPrice[status]["Equipment"][equipment];
- }
- else
- self SendError("MoreMoney");
- }
- givePerk(perk, status)
- {
- if (self.money >= level.itemPrice[status]["Perks"][perk])
- {
- if (!self HasPerk(perk))
- {
- self SetPerk(perk);
- self iPrintln("Perk Purchased Successfully: ^2" + perk);
- self.money -= level.itemPrice[status]["Perks"][perk];
- }
- else
- self SendError("HasPerk");
- }
- else
- self SendError("MoreMoney");
- }
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //forgefunctions.gsc
- spawnEntity(class, model, origin, angle)
- {
- entity = spawn(class, origin);
- entity.angles = angle;
- entity setModel(model);
- return entity;
- }
- spawnObjective(origin, icon, onEntity)
- {
- Objective_Add(level.activeObjectiveIndex, "active", origin);
- Objective_Icon(level.activeObjectiveIndex, icon);
- if (isDefined(onEntity))
- Objective_OnEntity(level.activeObjectiveIndex, onEntity);
- level.activeObjectiveIndex++;
- }
- roundUp(floatVal)
- {
- if (int(floatVal) != floatVal)
- return int(floatVal + 1);
- else
- return int(floatVal);
- }
- removeSkyBarrier()
- {
- entArray = getEntArray();
- for (index = 0; index < entArray.size; index++)
- {
- if(isSubStr(entArray[index].classname, "trigger_hurt") && entArray[index].origin[2] > 180)
- entArray[index].origin = (0, 0, 9999999);
- }
- }
- destroyAllEntities()
- {
- for(i = 0; i <= level.amountOfSpawnedEntities; i++)
- {
- level.spawnedEntities[i] delete();
- level.spawnedEntities[i] = undefined;
- }
- for (i = 0; i <= level.activeObjectiveIndex; i++)
- {
- objective_delete(i);
- }
- level.activeObjectiveIndex = 0;
- level.amountOfSpawnedEntities = 0;
- level notify("entitiesDeleted");
- }
- entityMonitor()
- {
- level endon("entitiesDeleted");
- for (;;)
- {
- level waittill("game_ended");
- wait 1;
- iPrintln("All Entities ^1Deleted!");
- destroyAllEntities();
- wait 0.05;
- }
- }
- CreateWall(end, start)
- {
- blockb=[];
- blockc=[];
- dh = (start[0], start[1], 0);
- hd = (end[0], end[1], 0);
- zaa = (0, 0, start[2]);
- azz = (0, 0, end[2]);
- D = Distance(dh, hd);
- H = Distance(zaa, azz);
- blocks = roundUp(D / 70);
- height = roundUp(H / 36);
- CX = start[0] - end[0];
- CY = start[1] - end[1];
- CZ = start[2] - end[2];
- XA = CX / blocks;
- YA = CY / blocks;
- ZA = CZ / height;
- Temp = VectorToAngles(end - start);
- BA = (0, Temp[1] + 90, 0);
- for(h=0; h < height; h++)
- {
- for(i=0; i < blocks; i++)
- {
- spawnPos = (end + ((XA, YA, 0) * i) + (0, 0, 10) + ((0, 0, ZA) * h));
- block = spawnEntity("script_model", level.supplyDropModel, spawnPos, BA);
- level.spawnedEntities[level.amountOfSpawnedEntities] = block;
- level.amountOfSpawnedEntities++;
- }
- }
- }
- CreateRamp(top, bottom)
- {
- D = Distance(top, bottom);
- blocks = roundUp(D / 30);
- CX = top[0] - bottom[0];
- CY = top[1] - bottom[1];
- CZ = top[2] - bottom[2];
- XA = CX / blocks;
- YA = CY / blocks;
- ZA = CZ / blocks;
- Temp = VectorToAngles(top - bottom);
- BA =(Temp[0], Temp[1], Temp[2]);
- for(b = 0; b < blocks; b++)
- {
- block = spawnEntity("script_model", level.supplyDropModel, (bottom + ((XA, YA, ZA) * B)), BA);
- level.spawnedEntities[level.amountOfSpawnedEntities] = block;
- level.amountOfSpawnedEntities++;
- }
- block = spawnEntity("script_model", level.supplyDropModel, (bottom + ((XA, YA, ZA) * blocks)-(0, 0, 5)), (BA[0], BA[1], 0));
- level.spawnedEntities[level.amountOfSpawnedEntities] = block;
- level.amountOfSpawnedEntities++;
- }
- CreateGrid(corner1, corner2, angle)
- {
- blockfloor = [];
- W = Distance((corner1[0], 0, 0), (corner2[0], 0, 0));
- L = Distance((0, corner1[1], 0), (0,corner2[1], 0));
- H = Distance((0, 0, corner1[2]), (0, 0, corner1[2]));
- CX = corner2[0] - corner1[0];
- CY = corner2[1] - corner1[1];
- CZ = corner2[2] - corner1[2];
- ROWS = roundUp(W / 40);
- COLUMNS = roundUp(L / 70);
- HEIGHT = roundUp(H / 40);
- XA = CX / ROWS;
- YA = CY / COLUMNS;
- ZA = CZ / HEIGHT;
- center = spawn("script_model", corner1);
- for(r = 0; r <= ROWS; r++)
- {
- for(c = 0; c <= COLUMNS; c++)
- {
- for(h = 0; h <= HEIGHT; h++)
- {
- floor = (corner1 + (XA * r, YA * c, ZA * h));
- block = spawnEntity("script_model", level.supplyDropModel, floor, (0, 0, 0));
- block LinkTo(center);
- level.spawnedEntities[level.amountOfSpawnedEntities] = block;
- level.amountOfSpawnedEntities++;
- }
- }
- }
- center.angles = angle;
- }
- CreateFlag(enter, exit, hiddenFlags, bothWays)
- {
- if (bothWays)
- {
- if (!hiddenFlags)
- {
- entryFlag1 = spawnEntity("script_model", level.teleportFlagBothModel, enter, (0, 0, 0));
- entryFlag2 = spawnEntity("script_model", level.teleportFlagBothModel, exit, (0, 0, 0));
- spawnObjective(enter, "waypoint_recon_artillery_strike");
- spawnObjective(exit, "waypoint_recon_artillery_strike");
- }
- else
- {
- entryFlag1 = spawn("script_model", enter);
- entryFlag2 = spawn("script_model", exit);
- }
- level.spawnedEntities[level.amountOfSpawnedEntities] = entryFlag1;
- level.amountOfSpawnedEntities++;
- level.spawnedEntities[level.amountOfSpawnedEntities] = entryFlag2;
- level.amountOfSpawnedEntities++;
- level thread Teleport_Flag_Think(entryFlag1, entryFlag2, true);
- }
- else
- {
- if (!hiddenFlags)
- {
- entryFlag = spawnEntity("script_model", level.teleportFlagStartModel, enter, (0, 0, 0));
- exitFlag = spawnEntity("script_model", level.teleportFlagEndModel, exit, (0, 0, 0));
- spawnObjective(enter, "waypoint_recon_artillery_strike");
- }
- else
- {
- entryFlag = spawn("script_model", enter);
- exitFlag = spawn("script_model", exit);
- }
- level.spawnedEntities[level.amountOfSpawnedEntities] = entryFlag;
- level.amountOfSpawnedEntities++;
- level.spawnedEntities[level.amountOfSpawnedEntities] = exitFlag;
- level.amountOfSpawnedEntities++;
- level thread Teleport_Flag_Think(entryFlag, exitFlag, false);
- }
- }
- Teleport_Flag_Think(Flag1, Flag2, bothWays)
- {
- level endon("game_ended");
- for(;;)
- {
- foreach(player in level.players)
- {
- if (bothWays)
- {
- if(Distance(player.origin, Flag1.origin) < 25)
- {
- player SetOrigin(Flag2.origin + VectorScale(AnglesToForward((0, player.angles[1], 0)), 25));
- }
- if(Distance(player.origin, Flag2.origin) < 25)
- {
- player SetOrigin(Flag1.origin + VectorScale(AnglesToForward((0, player.angles[1], 0)), 26));
- }
- }
- else
- {
- if(Distance(player.origin, Flag1.origin) < 25)
- {
- player SetOrigin(Flag2.origin + VectorScale(AnglesToForward((0, player.angles[1], 0)), 25));
- }
- }
- }
- wait 0.01;
- }
- }
- CreateElevator(start, end, time, waittime)
- {
- TempAngles = VectorToAngles(end - start);
- Angles = (0, TempAngles[1], 0);
- center = spawn("script_model", start);
- elevator = spawnEntity("script_model", level.supplyDropModel, start, Angles);
- elevator EnableLinkTo();
- elevator LinkTo(center);
- spawnObjective(start, "compass_supply_drop_black", elevator);
- level.spawnedEntities[level.amountOfSpawnedEntities] = elevator;
- level.amountOfSpawnedEntities++;
- level thread Elevator_Think(center, start, end, time, waittime);
- }
- Elevator_Think(elevator, start, end, time, waittime)
- {
- level endon("game_ended");
- wait waittime;
- for(;;)
- {
- if (elevator.origin == start)
- {
- elevator MoveTo(end, time);
- wait time;
- wait waittime;
- }
- if (elevator.origin == end)
- {
- elevator MoveTo(start, time);
- wait time;
- wait waittime;
- }
- wait 0.01;
- }
- }
- CreateZipline(start, end, time, bothWays)
- {
- TempAngles = VectorToAngles(end - start);
- Angles = (0, TempAngles[1], 0);
- if (bothWays)
- {
- ziplineStart = spawnEntity("script_model", level.supplyDropModel, start, Angles);
- ziplineEnd = spawnEntity("script_model", level.supplyDropModelAxis, end, Angles);
- spawnObjective(start, "compass_supply_drop_green");
- spawnObjective(end, "compass_supply_drop_green");
- }
- else
- {
- ziplineStart = spawnEntity("script_model", level.supplyDropModel, start, Angles);
- ziplineEnd = spawnEntity("script_model", "", end, Angles);
- spawnObjective(start, "compass_supply_drop_red");
- }
- level.spawnedEntities[level.amountOfSpawnedEntities] = ziplineStart;
- level.amountOfSpawnedEntities++;
- level.spawnedEntities[level.amountOfSpawnedEntities] = ziplineEnd;
- level.amountOfSpawnedEntities++;
- level thread Zipline_Think(ziplineStart, ziplineEnd, time, bothWays);
- }
- Zipline_Think(ziplineStart, ziplineEnd, time, bothWays)
- {
- level endon("game_ended");
- localZiplineNumber = level.activeZiplines;
- level.activeZiplines++;
- for(;;)
- {
- foreach(player in level.players)
- {
- if (player.nearZipline && !player.usingZipline)
- {
- if (!isDefined(player.ziplineStringCreated[localZiplineNumber]))
- {
- 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);
- player.ziplineHintString[localZiplineNumber].alignX = "center";
- player.ziplineHintString[localZiplineNumber].alignY = "bottom";
- player.ziplineHintString[localZiplineNumber].horzAlign = "center";
- player.ziplineHintString[localZiplineNumber].vertAlign = "bottom";
- player.usingZipline = false;
- player.ziplineStringCreated[localZiplineNumber] = true;
- }
- else
- player.ziplineHintString[localZiplineNumber].alpha = 1;
- }
- else
- player.ziplineHintString[localZiplineNumber].alpha = 0;
- if (bothWays)
- {
- if(Distance(player.origin, ziplineStart.origin) < 60 && !player.usingZipline)
- {
- player.nearZipline = true;
- if (player UseButtonPressed())
- player Zipline_Player_Think(player, localZiplineNumber, ziplineStart.origin, ziplineEnd.origin, time);
- }
- else if(Distance(player.origin, ziplineEnd.origin) < 60 && !player.usingZipline)
- {
- player.nearZipline = true;
- if (player UseButtonPressed())
- player Zipline_Player_Think(player, localZiplineNumber, ziplineEnd.origin, ziplineStart.origin, time);
- }
- else
- player.nearZipline = false;
- }
- if (!bothWays)
- {
- if(Distance(player.origin, ziplineStart.origin) < 60 && !player.usingZipline)
- {
- player.nearZipline = true;
- if (player UseButtonPressed())
- player Zipline_Player_Think(player, localZiplineNumber, ziplineStart.origin, ziplineEnd.origin, time);
- }
- else
- player.nearZipline = false;
- }
- wait 0.0001;
- }
- wait 0.01;
- }
- }
- Zipline_Player_Think(player, ziplineNumber, start, end, time)
- {
- ZiplineMover = spawn("script_model", start);
- player PlayerLinkTo(ZiplineMover);
- player.usingZipline = true;
- player.ziplineHintString[ziplineNumber].alpha = 0;
- ZiplineMover MoveTo(end, time, 0.5, 0.5);
- wait time;
- player DetachAll();
- ZiplineMover delete();
- player.usingZipline = false;
- }
- CreateDoorSolid(open, close, time, angle, width, height, hp, triggerRadius)
- {
- offset = (((width / 2) - 0.5) * -1);
- center = spawn("script_model", open);
- for(j = 0; j < width; j++)
- {
- door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset), (0, 0, 0));
- door EnableLinkTo();
- door LinkTo(center);
- level.spawnedEntities[level.amountOfSpawnedEntities] = door;
- level.amountOfSpawnedEntities++;
- for(h = 1; h < height; h++)
- {
- door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset) - ((40, 0, 0) * h), (0, 0, 0));
- door EnableLinkTo();
- door LinkTo(center);
- level.spawnedEntities[level.amountOfSpawnedEntities] = door;
- level.amountOfSpawnedEntities++;
- }
- offset += 1;
- }
- center.angles = angle;
- center.state = "open";
- center.hp = hp;
- center.triggerRadius = triggerRadius;
- center thread Door_Player_Think(level.activeDoors);
- center thread Door_Think(open, close, time);
- wait 0.01;
- }
- CreateDoor(open, close, time, angle, width, height, hp, triggerRadius)
- {
- offset = (((width / 2) - 0.5) * -1);
- center = spawn("script_model", open);
- for(j = 0; j < width; j++)
- {
- door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset), (0, 0, 0));
- door EnableLinkTo();
- door LinkTo(center);
- level.spawnedEntities[level.amountOfSpawnedEntities] = door;
- level.amountOfSpawnedEntities++;
- for(h = 1; h < height; h++)
- {
- door = spawnEntity("script_model", level.supplyDropModel, open + ((0, 30, 0) * offset) - ((70, 0, 0) * h), (0, 0, 0));
- door EnableLinkTo();
- door LinkTo(center);
- level.spawnedEntities[level.amountOfSpawnedEntities] = door;
- level.amountOfSpawnedEntities++;
- }
- offset += 1;
- }
- center.angles = angle;
- center.state = "open";
- center.hp = hp;
- center.triggerRadius = triggerRadius;
- center thread Door_Player_Think(level.activeDoors);
- center thread Door_Think(open, close, time);
- wait 0.01;
- }
- Door_Think(open, close, time)
- {
- level endon("game_ended");
- localDoorNumber = level.activeDoors;
- level.doorInUse[localDoorNumber] = false;
- level.activeDoors++;
- for(;;)
- {
- if(self.hp > 0)
- {
- self waittill ("triggeruse" , player);
- if(player.team == "allies")
- {
- if(self.state == "open")
- {
- self playSound("mpl_drone_door_open");
- self MoveTo(close, time);
- level.doorInUse[localDoorNumber] = true;
- wait time;
- level.doorInUse[localDoorNumber] = false;
- self.state = "close";
- continue;
- }
- if(self.state == "close")
- {
- self playSound("mpl_drone_door_close");
- self MoveTo(open, time);
- level.doorInUse[localDoorNumber] = true;
- wait time;
- level.doorInUse[localDoorNumber] = false;
- self.state = "open";
- continue;
- }
- }
- if(player.team == "axis")
- {
- if(self.state == "close")
- {
- self.hp--;
- player iPrintlnBold("Door Damaged! +^2$5");
- player.money += 5;
- wait 1;
- continue;
- }
- }
- }
- else
- {
- if(self.state == "close")
- self MoveTo(open, time);
- self.state = "broken";
- wait 0.5;
- }
- }
- }
- Door_Player_Think(localDoorNumber)
- {
- level endon("game_ended");
- self endon("disconnect");
- for(;;)
- {
- foreach(player in level.players)
- {
- if (!isDefined(player.doorStringCreated[localDoorNumber]))
- {
- player.doorHintString[localDoorNumber] = player drawText(player.currentDoorHint, "objective", 1.5, 0, -50, (1, 1, 1), 0, (0, 0, 0), 0, 8, false);
- player.doorHintString[localDoorNumber].alpha = 0;
- player.doorHintString[localDoorNumber].alignX = "center";
- player.doorHintString[localDoorNumber].alignY = "bottom";
- player.doorHintString[localDoorNumber].horzAlign = "center";
- player.doorHintString[localDoorNumber].vertAlign = "bottom";
- player.doorStringCreated[localDoorNumber] = true;
- player.nearDoor[localDoorNumber] = false;
- }
- if (player.nearDoor[localDoorNumber] && !level.doorInUse[localDoorNumber])
- {
- player.doorHintString[localDoorNumber] setText(player.currentDoorHint);
- player.doorHintString[localDoorNumber].alpha = 1;
- }
- else
- player.doorHintString[localDoorNumber].alpha = 0;
- if(Distance(self.origin, player.origin) <= self.triggerRadius)
- {
- if(player.team == "allies")
- {
- if(self.state == "open")
- player.currentDoorHint = "[{+melee}] ^1To Close ^7the door / [{+usereload}] Shows Current HP.";
- if(self.state == "close")
- player.currentDoorHint = "[{+melee}] ^2To Open ^7the door / [{+usereload}] Shows Current HP.";
- if(self.state == "broken")
- player.currentDoorHint = "^1Door is Broken";
- }
- if(player.team == "axis")
- {
- if (self.state == "open")
- player.currentDoorHint = "";
- if(self.state == "close")
- player.currentDoorHint = "[{+melee}] ^1To Damage ^7the door / [{+usereload}] Shows Current HP.";
- if(self.state == "broken")
- player.currentDoorHint = "^1Door is Broken";
- }
- if(player MeleeButtonPressed())
- {
- if (player.team == "allies")
- self notify("triggeruse" , player);
- if (player.team == "axis")
- self notify("triggeruse" , player);
- wait 0.20;
- }
- if(player UseButtonPressed())
- {
- if (player.team == "allies")
- player iPrintlnBold("Current HP: ^1" + self.hp);
- if (player.team == "axis")
- player iPrintlnBold("Current HP: ^1" + self.hp);
- wait 0.20;
- }
- player.nearDoor[localDoorNumber] = true;
- }
- else
- player.nearDoor[localDoorNumber] = false;
- }
- wait 0.1;
- }
- }
- ResetDoor(localDoorNumber, open, hp, time)
- {
- self.hp = hp;
- self MoveTo(open, time);
- self.state = "open";
- }
- watchForWorldTurretDeath()
- {
- self endon("turretRemoved");
- level endon("game_ended");
- for (;;)
- {
- self waittill("destroy_turret");
- self setturretminimapvisible(0);
- playFxOnTag(level.auto_turret_settings[self.turrettype].damagefx, self, level.auto_turret_settings[self.turrettype].stunfxtag);
- wait 1;
- level thread GiveDestroyedTurretMoney("zombie", 30);
- self delete();
- self notify("turretRemoved");
- wait 0.01;
- }
- }
- CreateTurret(origin, angles, turrettype)
- {
- turret = spawnTurret("auto_turret", origin, turrettype);
- turret.angles = angles;
- turret setModel("t6_wpn_turret_sentry_gun");
- turret setTurretTeam("allies");
- level.spawnedEntities[level.amountOfSpawnedEntities] = turret;
- level.amountOfSpawnedEntities++;
- turret.team = "allies";
- SetupTurretHealth(turret);
- turret thread watchdamage();
- turret.weaponinfoname = turrettype;
- turret.turrettype = "sentry";
- turret setturrettype(turret.turrettype);
- turret laserOn();
- turret setturretminimapvisible(1);
- turret thread watchForWorldTurretDeath();
- turret maps/mp/_entityheadicons::setentityheadicon(turret.team, turret, level.turrets_headicon_offset["default"]);
- return turret;
- }
- CreateMysteryBox(origin, angle, price)
- {
- mysterybox = spawnEntity("script_model", level.supplyDropModelAxis, origin, angle);
- spawnObjective(origin, "perk_hardline");
- level.spawnedEntities[level.amountOfSpawnedEntities] = mysterybox;
- level.amountOfSpawnedEntities++;
- mysterybox thread MysteryBox_Think();
- mysterybox thread MysteryBox_Player_Think(price);
- }
- MysteryBox_Think()
- {
- level endon("game_ended");
- for (;;)
- {
- self waittill("triggerMysteryBox", player, localMysteryBoxNumber);
- currentWeapon = spawn("script_model", self.origin);
- currentWeapon.angles = self.angles + (0, 90, 0);
- level.spawnedEntities[level.amountOfSpawnedEntities] = currentWeapon;
- level.amountOfSpawnedEntities++;
- self thread MysteryBox_WeaponMover_Think(currentWeapon);
- self waittill("mysteryBoxWeaponMoverFinished");
- self thread MysteryBox_Timeout_Think();
- player.mysteryBoxWeaponReady[localMysteryBoxNumber] = true;
- self waittill_any("tookMysteryBoxWeapon", "mysteryBoxWeaponTimedOut");
- wait 0.50;
- if (!self.timedOut)
- player replaceWeaponWorld(self.currentWeaponReturn, "All");
- currentWeapon delete();
- player.isUsingMysteryBox = false;
- player.mysteryBoxWeaponReady[localMysteryBoxNumber] = false;
- self.mysteryBoxInUse = false;
- self.timedOut = false;
- wait 0.01;
- }
- }
- MysteryBox_Timeout_Think()
- {
- level endon("game_ended");
- self endon("tookMysteryBoxWeapon");
- wait 12;
- self.timedOut = true;
- self notify("mysteryBoxWeaponTimedOut");
- }
- MysteryBox_WeaponMover_Think(currentWeapon)
- {
- level endon("game_ended");
- self.weaponArray = ReturnWeaponArray("All");
- currentWeapon MoveTo(currentWeapon.origin + (0, 0, 60), 10, 2, 2);
- for (i = 0; i < 30; i++)
- {
- tempRandomWeapon = self.weaponArray[randomint(self.weaponArray.size)];
- currentWeapon SetModel(GetWeaponModel(tempRandomWeapon));
- self.currentWeaponReturn = tempRandomWeapon;
- wait 0.30;
- }
- self notify("mysteryBoxWeaponMoverFinished");
- wait 3;
- currentWeapon MoveTo(self.origin, 10, 2, 2);
- }
- MysteryBox_Player_Think(price)
- {
- level endon("game_ended");
- localMysteryBoxNumber = level.activeMysteryBoxes;
- level.activeMysteryBoxes++;
- for (;;)
- {
- foreach(player in level.players)
- {
- if (!isDefined(player.mysteryBoxStringCreated[localMysteryBoxNumber]))
- {
- player.currentMysteryBoxHint = "Press [{+usereload}] To Use Mystery Box / ^2$" + price;
- player.mysteryBoxHintString[localMysteryBoxNumber] = player drawText(player.currentMysteryBoxHint, "objective", 1.5, 0, -50, (1, 1, 1), 0, (0, 0, 0), 0, 8, false);
- player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 0;
- player.mysteryBoxHintString[localMysteryBoxNumber].alignX = "center";
- player.mysteryBoxHintString[localMysteryBoxNumber].alignY = "bottom";
- player.mysteryBoxHintString[localMysteryBoxNumber].horzAlign = "center";
- player.mysteryBoxHintString[localMysteryBoxNumber].vertAlign = "bottom";
- player.mysteryBoxStringCreated[localMysteryBoxNumber] = true;
- player.nearMysteryBox[localMysteryBoxNumber] = false;
- player.mysteryBoxWeaponReady[localMysteryBoxNumber] = false;
- self.mysteryBoxInUse = false;
- }
- if (player.team != "axis")
- {
- if (player.nearMysteryBox[localMysteryBoxNumber] && !self.mysteryBoxInUse)
- {
- player.currentMysteryBoxHint = "Press [{+usereload}] To Use Mystery Box / ^2$" + price;
- player.mysteryBoxHintString[localMysteryBoxNumber] setText(player.currentMysteryBoxHint);
- player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 1;
- }
- else if (player.isUsingMysteryBox && player.mysteryBoxWeaponReady[localMysteryBoxNumber] && player.nearMysteryBox[localMysteryBoxNumber])
- {
- player.mysteryBoxHintString[localMysteryBoxNumber] setText(player.currentMysteryBoxHint);
- player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 1;
- }
- else
- player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 0;
- if(Distance(self.origin, player.origin) <= 60 && !self.mysteryBoxInUse)
- {
- player.nearMysteryBox[localMysteryBoxNumber] = true;
- if (player UseButtonPressed())
- {
- if (player.money >= price)
- {
- wait 0.10;
- player.currentMysteryBoxHint = "";
- player.isUsingMysteryBox = true;
- self.mysteryBoxInUse = true;
- player.money -= price;
- self notify("triggerMysteryBox", player, localMysteryBoxNumber);
- }
- else
- {
- player SendError("MoreMoney");
- wait 0.20;
- }
- }
- }
- else if(Distance(self.origin, player.origin) <= 60 && player.isUsingMysteryBox && player.mysteryBoxWeaponReady[localMysteryBoxNumber])
- {
- player.nearMysteryBox[localMysteryBoxNumber] = true;
- player.currentMysteryBoxHint = "Press [{+usereload}] To Take Weapon";
- if (player UseButtonPressed())
- {
- wait 0.10;
- self notify("tookMysteryBoxWeapon");
- }
- }
- else
- player.nearMysteryBox[localMysteryBoxNumber] = false;
- }
- else
- player.mysteryBoxHintString[localMysteryBoxNumber].alpha = 0;
- }
- wait 0.01;
- }
- }
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //mapedits.gsc
- setupCustomMap()
- {
- if(getDvar("mapname") == "mp_nuketown_2020")
- level thread Nuketown();
- if(getDvar("mapname") == "mp_hijacked")
- level thread Hijacked();
- if(getDvar("mapname") == "mp_express")
- level thread Express();
- if(getDvar("mapname") == "mp_meltdown")
- level thread Meltdown();
- if(getDvar("mapname") == "mp_drone")
- level thread Drone();
- if(getDvar("mapname") == "mp_carrier")
- level thread Carrier();
- if(getDvar("mapname") == "mp_overflow")
- level thread Overflow();
- if(getDvar("mapname") == "mp_slums")
- level thread Slums();
- if(getDvar("mapname") == "mp_turbine")
- level thread Turbine();
- if(getDvar("mapname") == "mp_raid")
- level thread Raid();
- if(getDvar("mapname") == "mp_la")
- level thread Aftermath();
- if(getDvar("mapname") == "mp_dockside")
- level thread Cargo();
- if(getDvar("mapname") == "mp_village")
- level thread Standoff();
- if(getDvar("mapname") == "mp_nightclub")
- level thread Plaza();
- if(getDvar("mapname") == "mp_socotra")
- level thread Yemen();
- if(getDvar("mapname") == "mp_dig")
- level thread Dig();
- if(getDvar("mapname") == "mp_pod")
- level thread Pod();
- if(getDvar("mapname") == "mp_takeoff")
- level thread Takeoff();
- if(getDvar("mapname") == "mp_frostbite")
- level thread Frost();
- if(getDvar("mapname") == "mp_mirage")
- level thread Mirage();
- if(getDvar("mapname") == "mp_hydro")
- level thread Hydro();
- if(getDvar("mapname") == "mp_skate")
- level thread Grind();
- if(getDvar("mapname") == "mp_downhill")
- level thread Downhill();
- if(getDvar("mapname") == "mp_concert")
- level thread Encore();
- if(getDvar("mapname") == "mp_vertigo")
- level thread Vertigo();
- if(getDvar("mapname") == "mp_studio")
- level thread Studio();
- if(getDvar("mapname") == "mp_paintball")
- level thread Rush();
- if(getDvar("mapname") == "mp_castaway")
- level thread Cove();
- if(getDvar("mapname") == "mp_bridge")
- level thread Detour();
- if(getDvar("mapname") == "mp_uplink")
- level thread Uplink();
- }
- Nuketown()
- { }
- Hijacked()
- { }
- Express()
- { }
- Meltdown()
- { }
- Drone()
- { }
- Carrier()
- { }
- Overflow()
- { }
- Slums()
- { }
- Turbine()
- { }
- Raid()
- { }
- Aftermath()
- { }
- Cargo()
- { }
- Standoff()
- { }
- Plaza()
- { }
- Yemen()
- { }
- Dig()
- { }
- Pod()
- { }
- Takeoff()
- { }
- Frost()
- { }
- Mirage()
- { }
- Hydro()
- { }
- Grind()
- { }
- Downhill()
- { }
- Encore()
- { }
- Vertigo()
- { }
- Magma()
- { }
- Studio()
- { }
- Rush()
- { }
- Cove()
- { }
- Detour()
- { }
- Uplink()
- { }
- //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- //menu.gsc
- changeVerification(player, verlevel)
- {
- player notify("statusChanged");
- player.status = verlevel;
- player giveMenu();
- }
- Iif(bool, rTrue, rFalse)
- {
- if(bool)
- return rTrue;
- else
- return rFalse;
- }
- booleanReturnVal(bool, returnIfFalse, returnIfTrue)
- {
- if (bool)
- return returnIfTrue;
- else
- return returnIfFalse;
- }
- booleanOpposite(bool)
- {
- if(!isDefined(bool))
- return true;
- if (bool)
- return false;
- else
- return true;
- }
- verificationToNum(status)
- {
- if (status == "human")
- return 2;
- if (status == "zombie")
- return 1;
- else
- return 0;
- }
- CreateMenu()
- {
- if (self.status == "human")
- {
- self add_menu("Main Menu Human", undefined, "The Shop (Status: ^2Human^7)", "Unverified");
- self add_option("Main Menu Human", "General", ::submenu, "General", "General");
- self add_option("Main Menu Human", "Equipment", ::submenu, "Equipment", "Equipment");
- self add_option("Main Menu Human", "Perks", ::submenu, "Perks", "Perks");
- self add_option("Main Menu Human", "Weapons", ::submenu, "Weapons", "Weapons");
- self add_option("Main Menu Human", "Attachments", ::submenu, "Attachments", "Attachments");
- self add_menu("General", "Main Menu Human", "General" , "human");
- self add_option("General", "^7+50 Health / ^2$" + level.itemPrice["Human"]["General"]["Health"], ::AddHealth, 50, "Human");
- self add_option("General", "^7Max Ammo For Current Weapon / ^2$" + level.itemPrice["Human"]["Weapons"]["Ammo"], ::RefillAmmo);
- self add_option("General", "^7UAV / ^2$" + level.itemPrice["Human"]["General"]["UAV"], ::GiveUAV, "Human");
- self add_option("General", "^7Spawn Turret / ^2$" + level.itemPrice["Human"]["General"]["Turret"], ::spawnTurretPlayer, "auto_gun_turret_mp", 5);
- self add_option("General", "^7Unlimited Ammo / ^2$" + level.itemPrice["Human"]["Weapons"]["UnlimitedAmmo"], ::infiniteAmmo);
- self add_option("General", "^7Infrared Vision / ^2$" + level.itemPrice["Human"]["General"]["Infrared"], ::giveInfraredVision, "Human");
- self add_menu("Equipment", "Main Menu Human", "Equipment", "human");
- self add_option("Equipment", "^7Claymore / ^2$" + level.itemPrice["Human"]["Equipment"]["claymore_mp"], ::giveEquipment, "claymore_mp", "Human");
- self add_option("Equipment", "^7Sticky Grenade / ^2$" + level.itemPrice["Human"]["Equipment"]["sticky_grenade_mp"], ::giveEquipment, "sticky_grenade_mp", "Human");
- self add_option("Equipment", "^7Frag Grenade / ^2$" + level.itemPrice["Human"]["Equipment"]["frag_grenade_mp"], ::giveEquipment, "frag_grenade_mp", "Human");
- self add_option("Equipment", "^7C4 / ^2$" + level.itemPrice["Human"]["Equipment"]["satchel_charge_mp"], ::giveEquipment, "satchel_charge_mp", "Human");
- self add_option("Equipment", "^7Shock Charge / ^2$" + level.itemPrice["Human"]["Equipment"]["proximity_grenade_mp"], ::giveEquipment, "proximity_grenade_mp", "Human");
- self add_option("Equipment", "^7Concussion Grenade / ^2$" + level.itemPrice["Human"]["Equipment"]["concussion_grenade_mp"], ::giveEquipment, "concussion_grenade_mp", "Human");
- self add_menu("Perks", "Main Menu Human", "Perks", "human");
- self add_option("Perks", "^7No Fall Damage / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fallheight"], ::givePerk, "specialty_fallheight", "Human");
- self add_option("Perks", "^7Faster Aiming / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fastads"], ::givePerk, "specialty_fastads", "Human");
- self add_option("Perks", "^7Unlimited Sprint / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_unlimitedsprint"], ::givePerk, "specialty_unlimitedsprint", "Human");
- self add_option("Perks", "^7Faster Weapon Switch / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fastweaponswitch"], ::givePerk, "specialty_fastweaponswitch", "Human");
- self add_option("Perks", "^7Hear Zombie Footsteps Better / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_loudenemies"], ::givePerk, "specialty_loudenemies", "Human");
- self add_option("Perks", "^7Faster Climbing / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_fastmantle"], ::givePerk, "specialty_fastmantle", "Human");
- self add_option("Perks", "^7Faster Movement / ^2$" + level.itemPrice["Human"]["Perks"]["specialty_movefaster"], ::givePerk, "specialty_movefaster", "Human");
- self add_menu("Weapons", "Main Menu Human", "Weapons", "human");
- self add_option("Weapons", "^7Submachine Guns / ^2$" + level.itemPrice["Human"]["Weapons"]["Submachine"], ::submenu, "SubmachineGuns");
- self add_option("Weapons", "^7Assault Rifles / ^2$" + level.itemPrice["Human"]["Weapons"]["Assault"], ::submenu, "AssaultRifles");
- self add_option("Weapons", "^7Lightmachine Guns / ^2$" + level.itemPrice["Human"]["Weapons"]["Lightmachine"], ::submenu, "LightmachineGuns");
- self add_option("Weapons", "^7Shotguns / ^2$" + level.itemPrice["Human"]["Weapons"]["Shotguns"], ::submenu, "Shotguns");
- self add_option("Weapons", "^7Sniper Rifles / ^2$" + level.itemPrice["Human"]["Weapons"]["Snipers"], ::submenu, "SniperRifles");
- self add_option("Weapons", "^7Pistols / ^2$" + level.itemPrice["Human"]["Weapons"]["Pistols"], ::submenu, "Pistols");
- self add_option("Weapons", "^7Launchers / ^2$" + level.itemPrice["Human"]["Weapons"]["Launchers"], ::submenu, "Launchers");
- self add_option("Weapons", "^7Specials / ^2$" + level.itemPrice["Human"]["Weapons"]["Specials"], ::submenu, "Specials");
- self add_option("Weapons", "^7Super Specials / ^2$" + level.itemPrice["Human"]["Weapons"]["SuperSpecials"], ::submenu, "SuperSpecials");
- self add_menu("SubmachineGuns", "Weapons", self.menu.menuopt["Weapons"][0], "human");
- self add_option("SubmachineGuns", "MP7", ::replaceWeapon, "mp7_mp", "Submachine");
- self add_option("SubmachineGuns", "PDW-57", ::replaceWeapon, "pdw57_mp", "Submachine");
- self add_option("SubmachineGuns", "Vector-K10", ::replaceWeapon, "vector_mp", "Submachine");
- self add_option("SubmachineGuns", "MSMC", ::replaceWeapon, "insas_mp", "Submachine");
- self add_option("SubmachineGuns", "Chicom CQB", ::replaceWeapon, "qcw05_mp", "Submachine");
- self add_option("SubmachineGuns", "Skorpion EVO", ::replaceWeapon, "evoskorpion_mp", "Submachine");
- self add_option("SubmachineGuns", "Peacekeeper", ::replaceWeapon, "peacekeeper_mp", "Submachine");
- self add_menu("AssaultRifles", "Weapons", self.menu.menuopt["Weapons"][1], "human");
- self add_option("AssaultRifles", "MTAR", ::replaceWeapon, "tar21_mp", "Assault");
- self add_option("AssaultRifles", "Type 25", ::replaceWeapon, "type95_mp", "Assault");
- self add_option("AssaultRifles", "SWAT-556", ::replaceWeapon, "sig556_mp", "Assault");
- self add_option("AssaultRifles", "FAL OSW", ::replaceWeapon, "sa58_mp", "Assault");
- self add_option("AssaultRifles", "M27", ::replaceWeapon, "hk416_mp", "Assault");
- self add_option("AssaultRifles", "SCAR-H", ::replaceWeapon, "scar_mp", "Assault");
- self add_option("AssaultRifles", "SMR", ::replaceWeapon, "saritch_mp", "Assault");
- self add_option("AssaultRifles", "M8A1", ::replaceWeapon, "xm8_mp", "Assault");
- self add_option("AssaultRifles", "AN-94", ::replaceWeapon, "an94_mp", "Assault");
- self add_menu("Shotguns", "Weapons", self.menu.menuopt["Weapons"][2], "human");
- self add_option("Shotguns", "R870 MCS", ::replaceWeapon, "870mcs_mp", "Shotguns");
- self add_option("Shotguns", "S12", ::replaceWeapon, "saiga12_mp", "Shotguns");
- self add_option("Shotguns", "KSG", ::replaceWeapon, "ksg_mp", "Shotguns");
- self add_option("Shotguns", "M1216", ::replaceWeapon, "srm1216_mp", "Shotguns");
- self add_menu("LightmachineGuns", "Weapons", self.menu.menuopt["Weapons"][3], "human");
- self add_option("LightmachineGuns", "MK 48", ::replaceWeapon, "mk48_mp", "Lightmachine");
- self add_option("LightmachineGuns", "QBB LSW", ::replaceWeapon, "qbb95_mp", "Lightmachine");
- self add_option("LightmachineGuns", "LSAT", ::replaceWeapon, "lsat_mp", "Lightmachine");
- self add_option("LightmachineGuns", "HAMR", ::replaceWeapon, "hamr_mp", "Lightmachine");
- self add_menu("SniperRifles", "Weapons", self.menu.menuopt["Weapons"][4], "human");
- self add_option("SniperRifles", "SVU-AS", ::replaceWeapon, "svu_mp", "Snipers");
- self add_option("SniperRifles", "DSR 50", ::replaceWeapon, "dsr50_mp", "Snipers");
- self add_option("SniperRifles", "Ballista", ::replaceWeapon, "ballista_mp", "Snipers");
- self add_option("SniperRifles", "XPR-50", ::replaceWeapon, "as50_mp", "Snipers");
- self add_menu("Pistols", "Weapons", self.menu.menuopt["Weapons"][5], "human");
- self add_option("Pistols", "Five-seven", ::replaceWeapon, "fiveseven_mp", "Pistols");
- self add_option("Pistols", "Tac-45", ::replaceWeapon, "fnp45_mp", "Pistols");
- self add_option("Pistols", "B23R", ::replaceWeapon, "beretta93r_mp", "Pistols");
- self add_option("Pistols", "Executioner", ::replaceWeapon, "judge_mp", "Pistols");
- self add_option("Pistols", "KAP-40", ::replaceWeapon, "kard_mp", "Pistols");
- self add_menu("Launchers", "Weapons", self.menu.menuopt["Weapons"][6], "human");
- self add_option("Launchers", "SMAW", ::replaceWeapon, "smaw_mp", "Launchers");
- self add_option("Launchers", "RPG", ::replaceWeapon, "usrpg_mp", "Launchers");
- self add_menu("Specials", "Weapons", self.menu.menuopt["Weapons"][7], "human");
- self add_option("Specials", "Riot Shield", ::replaceWeapon, "riotshield_mp", "Specials");
- self add_option("Specials", "Ballistic Knife", ::replaceWeapon, "knife_ballistic_mp", "Specials");
- self add_option("Specials", "Crossbow", ::replaceWeapon, "crossbow_mp", "Specials");
- self add_menu("SuperSpecials", "Weapons", self.menu.menuopt["Weapons"][8], "human");
- self add_option("SuperSpecials", "Grenade Launcher", ::replaceWeapon, "m32_wager_mp", "SuperSpecials");
- self add_option("SuperSpecials", "Minigun", ::replaceWeapon, "minigun_wager_mp", "SuperSpecials");
- self add_menu("Attachments", "Main Menu Human", "Attachments", "human");
- self add_option("Attachments", "^7FMJ / ^2$" + level.itemPrice["Human"]["Attachments"]["fmj"], ::replaceCurrentWeaponAttachment, "fmj");
- self add_option("Attachments", "^7Dual Wield / ^2$" + level.itemPrice["Human"]["Attachments"]["dw"], ::replaceCurrentWeaponAttachment, "dw");
- self add_option("Attachments", "^7Suppressor / ^2$" + level.itemPrice["Human"]["Attachments"]["silencer"], ::replaceCurrentWeaponAttachment, "silencer");
- self add_option("Attachments", "^7Fast Mag / ^2$" + level.itemPrice["Human"]["Attachments"]["dualclip"], ::replaceCurrentWeaponAttachment, "dualclip");
- self add_option("Attachments", "^7Extended Clip / ^2$" + level.itemPrice["Human"]["Attachments"]["extclip"], ::replaceCurrentWeaponAttachment, "extclip");
- self add_option("Attachments", "^7Long Barrel / ^2$" + level.itemPrice["Human"]["Attachments"]["extbarrel"], ::replaceCurrentWeaponAttachment, "extbarrel");
- self add_option("Attachments", "^7Reflex Sight / ^2$" + level.itemPrice["Human"]["Attachments"]["reflex"], ::replaceCurrentWeaponAttachment, "reflex");
- self add_option("Attachments", "^7Dual Band Scope / ^2$" + level.itemPrice["Human"]["Attachments"]["ir"], ::replaceCurrentWeaponAttachment, "ir");
- self add_option("Attachments", "^7Rapid Fire / ^2$" + level.itemPrice["Human"]["Attachments"]["rf"], ::replaceCurrentWeaponAttachment, "rf");
- }
- if (self.status == "zombie")
- {
- self add_menu("Main Menu Zombie", undefined, "The Shop (Status: ^1Zombie^7)", "Unverified");
- self add_option("Main Menu Zombie", "General", ::submenu, "GeneralZombie", "General");
- self add_option("Main Menu Zombie", "Equipment", ::submenu, "EquipmentZombie", "Equipment");
- self add_menu("GeneralZombie", "Main Menu Zombie", "General", "zombie");
- self add_option("GeneralZombie", "^7+50 Health / ^2$" + level.itemPrice["Zombie"]["General"]["Health"], ::addHealth, 50, "Zombie");
- self add_option("GeneralZombie", "^7UAV / ^2$" + level.itemPrice["Zombie"]["General"]["UAV"], ::GiveUAV, "Zombie");
- self add_option("GeneralZombie", "^7Infrared Vision / ^2$" + level.itemPrice["Zombie"]["General"]["Infrared"], ::giveInfraredVision, "Zombie");
- self add_option("GeneralZombie", "^7Invisible For 10 Seconds / ^2$" + level.itemPrice["Zombie"]["General"]["Invisible"], ::invisible, 10);
- self add_option("GeneralZombie", "^7Slow Humans For 15 Seconds / ^2$" + level.itemPrice["Zombie"]["General"]["SlowHumans"], ::slowHumans, 15);
- self add_menu("EquipmentZombie", "Main Menu Zombie", "Equipment", "zombie");
- self add_option("EquipmentZombie", "^7Tomahawk / ^2$" + level.itemPrice["Zombie"]["Equipment"]["hatchet_mp"], ::giveEquipment, "hatchet_mp", "Zombie");
- self add_option("EquipmentZombie", "^7EMP Grenade / ^2$" + level.itemPrice["Zombie"]["Equipment"]["emp_grenade_mp"], ::giveEquipment, "emp_grenade_mp", "Zombie");
- }
- }
- add_menu_alt(Menu, prevmenu)
- {
- self.menu.getmenu[Menu] = Menu;
- self.menu.menucount[Menu] = 0;
- self.menu.previousmenu[Menu] = prevmenu;
- }
- add_menu(Menu, prevmenu, menutitle, status)
- {
- self.menu.status[Menu] = status;
- self.menu.getmenu[Menu] = Menu;
- self.menu.scrollerpos[Menu] = 0;
- self.menu.curs[Menu] = 0;
- self.menu.menucount[Menu] = 0;
- self.menu.subtitle[Menu] = menutitle;
- self.menu.previousmenu[Menu] = prevmenu;
- }
- add_option(Menu, Text, Func, arg1, arg2)
- {
- Menu = self.menu.getmenu[Menu];
- Num = self.menu.menucount[Menu];
- self.menu.menuopt[Menu][Num] = Text;
- self.menu.menufunc[Menu][Num] = Func;
- self.menu.menuinput[Menu][Num] = arg1;
- self.menu.menuinput1[Menu][Num] = arg2;
- self.menu.menucount[Menu] += 1;
- }
- updateScrollbar()
- {
- self.menu.scroller MoveOverTime(0.15);
- self.menu.scroller.y = 160 + (self.menu.curs[self.menu.currentmenu] * 18.10);
- }
- openMenu()
- {
- if (!self.menu.closeondeath)
- {
- self freezeControls(false);
- if (self.status == "human")
- self StoreText("Main Menu Human", "The Shop (Status: ^2Human^7)");
- if (self.status == "zombie")
- self StoreText("Main Menu Zombie", "The Shop (Status: ^1Zombie^7)");
- self.menu.background ScaleOverTime(0.3, 400, 260);
- self.menu.background FadeOverTime(0.3);
- self.menu.background.alpha = 0.65;
- self.menu.scroller ScaleOverTime(0.3, 400, 18);
- self.menu.scroller FadeOverTime(0.3);
- self.menu.scroller.alpha = 0.80;
- self updateScrollbar();
- self.menu.open = true;
- }
- }
- closeMenu()
- {
- self.menu.options FadeOverTime(0.3);
- self.menu.options.alpha = 0;
- self.menu.background ScaleOverTime(0.3, 0, 0);
- self.menu.background FadeOverTime(0.3);
- self.menu.background.alpha = 0;
- self.menu.title FadeOverTime(0.3);
- self.menu.title.alpha = 0;
- self.menu.scroller ScaleOverTime(0.3, 0, 0);
- self.menu.scroller FadeOverTime(0.3);
- self.menu.scroller.alpha = 0;
- self.menu.open = false;
- }
- giveMenu()
- {
- if (self.status == "human" || self.status == "zombie")
- {
- if (!self.MenuInit)
- {
- self.MenuInit = true;
- self thread MenuInit();
- self thread closeMenuOnDeath();
- }
- }
- }
- destroyMenu(player)
- {
- player.MenuInit = false;
- closeMenu();
- wait 0.3;
- player unverifyReset();
- self.menu.closeondeath = false;
- player.menu.options destroy();
- player.menu.background destroy();
- player.menu.scroller destroy();
- player.menu.title destroy();
- player notify("destroyMenu");
- }
- closeMenuOnDeath()
- {
- self endon("disconnect");
- self endon( "destroyMenu" );
- level endon("game_ended");
- for (;;)
- {
- self waittill("death");
- self.menu.closeondeath = true;
- if (self.status == "human")
- self submenu("Main Menu Human", "Main Menu Human");
- if (self.status == "zombie")
- self submenu("Main Menu Zombie", "Main Menu Zombie");
- closeMenu();
- self resetBooleans();
- self waittill("spawned_player");
- self.menu.closeondeath = false;
- }
- }
- closeMenuAnywhere()
- {
- if (self.status == "human")
- self submenu("Main Menu Human", "Main Menu Human");
- if (self.status == "zombie")
- self submenu("Main Menu Zombie", "Main Menu Zombie");
- closeMenu();
- }
- StoreShaders()
- {
- self.menu.background = self drawShader("white", 0, 140, 0, 0, (0, 0, 0), 0, 1, false);
- self.menu.scroller = self drawShader("white", 0, 160, 400, 18, (1, 0.502, 0), 0, 2, false);
- }
- StoreText(menu, title)
- {
- self.menu.currentmenu = menu;
- string = "";
- self.menu.title destroy();
- self.menu.title = drawText(title, "objective", 2, 0, 110, (1, 1 ,1), 0, (255,0,0), 0, 3, false);
- self.menu.title FadeOverTime(0.3);
- self.menu.title.alpha = 1;
- for(i = 0; i < self.menu.menuopt[menu].size; i++)
- { string += self.menu.menuopt[menu][i] + "\n"; }
- self.menu.options destroy();
- self.menu.options = drawText(string, "objective", 1.5, 0, 160, (1, 1, 1), 0, (0, 0, 0), 0, 4);
- self.menu.options FadeOverTime(0.3);
- self.menu.options.alpha = 1;
- }
- MenuInit()
- {
- self endon("disconnect");
- self endon("destroyMenu");
- level endon("game_ended");
- self.menu = spawnstruct();
- self.menu.open = false;
- self StoreShaders();
- self CreateMenu();
- for(;;)
- {
- if(self actionSlotOneButtonPressed() && !self.menu.open) // Open.
- {
- openMenu();
- wait 0.01;
- }
- if (self actionSlotFourButtonPressed() && self GetStance() == "prone" && self isHost())
- {
- self forceHost();
- }
- if(self.menu.open)
- {
- if(self useButtonPressed())
- {
- if(isDefined(self.menu.previousmenu[self.menu.currentmenu]))
- {
- self submenu(self.menu.previousmenu[self.menu.currentmenu], self.menu.subtitle[self.menu.previousmenu[self.menu.currentmenu]]);
- }
- else
- {
- closeMenu();
- }
- wait 0.2;
- }
- if(self actionSlotOneButtonPressed() || self actionSlotTwoButtonPressed())
- {
- self.menu.curs[self.menu.currentmenu] += (Iif(self actionSlotTwoButtonPressed(), 1, -1));
- 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])));
- self updateScrollbar();
- }
- if (self actionSlotThreeButtonPressed())
- {
- closeMenuAnywhere();
- }
- if(self jumpButtonPressed())
- {
- 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]]);
- wait 0.2;
- }
- }
- wait 0.05;
- }
- }
- submenu(input, title)
- {
- self.menu.options destroy();
- if (!isDefined(title))
- title = self.menu.subtitle[input];
- if (input == "Main Menu Human")
- self thread StoreText(input, "The Shop (Status: ^2Human^7)");
- else if (input == "Main Menu Zombie")
- self thread StoreText(input, "The Shop (Status: ^1Zombie^7)");
- else
- self thread StoreText(input, title);
- self.CurMenu = input;
- self.menu.scrollerpos[self.CurMenu] = self.menu.curs[self.CurMenu];
- self.menu.curs[input] = self.menu.scrollerpos[input];
- if (!self.menu.closeondeath)
- {
- self updateScrollbar();
- }
- }
- //Functions
- resetBooleans()
- {
- }
- unverifyReset()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement