LOADING MODZ
THIS IS VARY ANNOYING I KNOW SO JOIN OR LOG IN, IT TAKES LIKE 2 SECONDS <3 Shadow Ghost and Loading

Chaos Dogs

Go down

Chaos Dogs

Post by 3LIT3 Loading on Mon Oct 31, 2011 12:44 am

Code:

--------------------------------------------------------------------------------
 
Code:
#include common_scripts\utility;

#include maps\mp\_airsupport;
#include maps\mp\_utility;

#include maps\mp\gametypes\_hud_util;

init()
{
  thread onPlayerConnect();
  thread onPlayerConnected();

  thread globalVariables();
  thread spawnMysteryBox();
  thread checkIfAllDead();
  thread createGameText();
  thread monitorNuke();
  thread spawnDogs();
 
  //The variables used for monitoring kills and damage
  level.onPlayerKilled = ::onPlayerKilled;
  level.onPlayerDamage = ::onPlayerDamage;

  //PreCache Items
  preCacheShader( "compass_waypoint_target" );
  preCacheShader( "headicon_dead" );
  preCacheShader( "perk_sleight_of_hand" );
  preCacheShader( "perk_lightweight" );
  preCacheShader( "rank_prestige07" );
}

onPlayerConnect()
{
  for(;;)
  {
      level waittill( "connecting", player );
     
      player thread onPlayerSpawned();
      player thread playerVariables();
  }
}

onPlayerConnected()
{
  for(;;)
  {
      level waittill( "connected", player );
 
      player thread setupGame();
      player thread checkDistance();
  }
}

onPlayerSpawned()
{
  for(;;)
  {
      self waittill( "spawned_player" );

      if( self.isZombie == false )
      {
        if( self.pers["team"] == "allies" )
        {
            self thread humanSettings();
        }
        else if( self.pers["team"] != "allies" )
        {
            self.isZombie = false;
            self [[level.allies]]();
        }
      }
      else if( self.isZombie == true )
      {
        if( self.pers["team"] == "axis" )
        {
            self thread zombieSettings();
        }
        else if( self.pers["team"] != "axis" )
        {
            self.isZombie = true;
            self [[level.axis]]();
        }
      }
  }
}

onPlayerDamage( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
  if( attacker.isZombie == false && attacker.pers["team"] == "allies" )
  {
      if( self.isZombie == true && self.pers["team"] == "axis" && sWeapon != "minigun_mp" ) attacker thread addMoney( iDamage * level.variable["cash_multiplier"] );
  }
  else if( attacker.isZombie == true && attacker.pers["team"] == "axis" )
  {
      if( sWeapon == "hatchet_mp" ) iDamage = 650;
  }
  return iDamage;
}

onPlayerKilled( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon )
{
  if( level.variable["zombies_released"] == 1 )
  {
      if( self.pers["team"] == "allies" && self.isZombie == false && sMeansOfDeath != "MOD_SUICIDE" )
      {
        self thread changeToZombie();
      }
      else if( self.pers["team"] == "axis" && self.isZombie == true )
      {
        MagicBullet( "tabun_gas_mp", self.origin, self.origin, self );
      }
  }
}

spawnDogs()
{
  for(;;)
  {
      wait randomFloatRange( 70, 150 );
     
      for( i = 0; i < level.players.size; i++ )
      {
        if( level.players[i].pers["team"] == "axis" && level.players[i].isZombie == true )
        {
            level.players[i] thread maps\mp\_dogs::useKillstreakDogs( "dogs_mp" );
            break;
        }
      }
      iPrintlnBold( "^1Here come the Puppies" );
  }
}

globalVariables()
{
  //Variables
  level.variable = [];
  level.variable["game_ready"] = 0;
  level.variable["zombies_released"] = 0;
  level.variable["mysterybox_in_use"] = 0;
  level.variable["cash_multiplier"] = 1;
  level.variable["last_survivor"] = 0;
  level.variable["perk_slots"] = 0;
  level.variable["traps_slots"] = 0;
  level.variable["trap_created"] = false;
  level.variable["slots_left"] = 2;
  level.variable["stop_sendind_position"] = false;
  level.variable["mystery_box_uses"] = 0;
  level.variable["pack_a_punch"] = false;
  level.variable["using_pack_a_punch"] = 0;
  level.variable["dead_persons"] = 0;
  level.variable["match_ended"] = 0;
  level.variable["dead_people"] = [];
  level.variable["time_limit"] = 345;
 
  level.variable["tip_list"][0] = "Sticking together is the way to go";
  level.variable["tip_list"][1] = "Press [{+smoke}] to spawn a Barrier";
  level.variable["tip_list"][2] = "If you have zombies on you, RUN AND GUN";
  level.variable["tip_list"][3] = "Make sure to buy perks to gain advantages";
  level.variable["tip_list"][4] = "A killstreak of 5 will give you an ammo drop";
 
  level.variable["mp_firingrange"]["mystery_box_origins"][0] = ( 9, 1494, -38 );
  level.variable["mp_firingrange"]["mystery_box_origins"][1] = ( -828, -148, -92 );
  level.variable["mp_firingrange"]["mystery_box_origins"][2] = ( 460, -206, -97 );
  level.variable["mp_firingrange"]["mystery_box_origins"][3] = ( 2084, 2222, -21 );
 
  level.variable["mp_firingrange"]["mystery_box_angles"][0] = ( 0, -105, 0 );
  level.variable["mp_firingrange"]["mystery_box_angles"][1] = ( 0, 176, 0 );
  level.variable["mp_firingrange"]["mystery_box_angles"][2] = ( 0, 1, 0  );
  level.variable["mp_firingrange"]["mystery_box_angles"][3] = ( 0, -3, 0 );

  level.variable["mp_nuked"]["mystery_box_origins"][0] = ( 801, 337, 94 );
  level.variable["mp_nuked"]["mystery_box_origins"][1] = ( -620, 257, -39 );
  level.variable["mp_nuked"]["mystery_box_origins"][2] = ( -231, 1009, -46 );
 
  level.variable["mp_nuked"]["mystery_box_angles"][0] = ( 0, -161, 0 );
  level.variable["mp_nuked"]["mystery_box_angles"][1] = ( 0, -112, 0 );
  level.variable["mp_nuked"]["mystery_box_angles"][2] = ( 0, 112, 0 );

  level.variable["mp_cosmodrome"]["mystery_box_origins"][0] = ( -389, 3343, -150 );
  level.variable["mp_cosmodrome"]["mystery_box_origins"][1] = ( -459, -978, -137 );
  level.variable["mp_cosmodrome"]["mystery_box_origins"][2] = ( -763, -2050, -145 );
  level.variable["mp_cosmodrome"]["mystery_box_origins"][3] = ( 9, 386, 9 );
 
  level.variable["mp_cosmodrome"]["mystery_box_angles"][0] = ( 0, 89, 0 );
  level.variable["mp_cosmodrome"]["mystery_box_angles"][1] = ( 0, 175, 0 );
  level.variable["mp_cosmodrome"]["mystery_box_angles"][2] = ( 0, 177, 0  );
  level.variable["mp_cosmodrome"]["mystery_box_angles"][3] = ( 0, 2, 0 );
 
  level.variable["mp_mountain"]["mystery_box_origins"][0] = ( 2540, -2417, 479 );
  level.variable["mp_mountain"]["mystery_box_origins"][1] = ( 3296, -598, 336 );
  level.variable["mp_mountain"]["mystery_box_origins"][2] = ( 2807, 1311, 369 );
 
  level.variable["mp_mountain"]["mystery_box_angles"][0] = ( 0, -87, 0 );
  level.variable["mp_mountain"]["mystery_box_angles"][1] = ( 0, 87, 0 );
  level.variable["mp_mountain"]["mystery_box_angles"][2] = ( 0, -91, 0 );

  level.variable["mp_array"]["mystery_box_origins"][0] = ( 261, 2737, 599 );
  level.variable["mp_array"]["mystery_box_origins"][1] = ( 2602, 259, 715 );
  level.variable["mp_array"]["mystery_box_origins"][2] = ( -576, -1641, 344 );
 
  level.variable["mp_array"]["mystery_box_angles"][0] = ( 0, 3, 0 );
  level.variable["mp_array"]["mystery_box_angles"][1] = ( 0, 2, 0 );
  level.variable["mp_array"]["mystery_box_angles"][2] = ( 0, 170, 0 );
 
  SetMatchTalkFlag( "DeadChatWithDead", 1 );
  SetMatchTalkFlag( "DeadChatWithTeam", 1 );
  SetMatchTalkFlag( "DeadHearTeamLiving", 1 );
  SetMatchTalkFlag( "DeadHearAllLiving", 1 );
  SetMatchTalkFlag( "EveryoneHearsEveryone", 1 );

  level.prematchPeriod = 0;

  level.guns[0] = "aug_mp";
  level.guns[1] = "m16_mp";
  level.guns[2] = "spas_mp";
  level.guns[3] = "famas_mp";
  level.guns[4] = "rpk_mp";
  level.guns[5] = "rpg_mp";
  level.guns[6] = "m72_law_mp";
  level.guns[7] = "commando_mp";
  level.guns[8] = "python_mp";
  level.guns[9] = "ak74u_mp";
  level.guns[10] = "l96a1_mp";
  level.guns[11] = "fnfal_mp";
  level.guns[12] = "cz75_mp";
  level.guns[13] = "spectre_mp";
  level.guns[14] = "hk21_mp";
  level.guns[15] = "crossbow_explosive_mp";
  level.guns[16] = "knife_ballistic_mp";
  level.guns[17] = "m60_mp";
  level.guns[18] = "stoner63_mp";
 
  setExpFog( 200, 320, 0, 0, 0, 0 );

  //Dvars
  setDvar( "scr_" + getDvar( "g_gametype" ) + "_scorelimit", 0 );
  setDvar( "scr_" + getDvar( "g_gametype" ) + "_timelimit", 0 );
  setDvar( "scr_disable_cac", 1 );
  setDvar( "scr_disable_weapondrop", 1 );
  setDvar( "dog_MeleeDamage", 75 );
  setDvar( "scr_dog_time", 30 );
  setDvar( "scr_dog_health", 300 );
  setDvar( "scr_game_hardpoints", 0 );
  setDvar( "scr_game_killstreaks", 0 );
  setDvar( "player_lastStandBleedoutTime", 50 );
  setDvar( "player_meleeRange", 200 );
  setDvar( "player_meleeWidth", 200 );
  setDvar( "cg_enemyNameFadeIn", 99999999 );
  setDvar( "cg_enemyNameFadeOut", 99999999 );
}

playerVariables()
{
  //Variables
  if( self isHost() ) self.variable["cash"] = 50000;
  else self.variable["cash"] = 5000;
  self.variable["zombie_kills"] = 0;

  //Dvars
  self setClientDvar( "r_sun", "0" );
  self setClientDvar( "r_specularRoughnessMap", 0 );
  self setClientDvar( "r_lightTweakSunColor", "1 0 0" );
  self setClientDvar( "r_lighttweaksunlight", "0.991101 0.947308 0.760525" );
  self setClientDvar( "r_heroLightScale", "1 1 1" );
  self setClientDvar( "r_skyColorTemp", "6500" );
  self setClientDvar( "ammoCounterHide", 1 );
  self setClientDvar( "actionSlotsHide", 1 );
  self setClientDvar( "ui_xpText", 0 );
  self setClientDvar( "scr_game_killstreaks", 0 );
  self setClientDvar( "scr_game_forceuav", 0 );
  self setClientDvar( "player_lastStandBleedoutTime", 50 );
  self setClientDvar( "cg_gun_x", 0 );
  self setClientDvar( "cg_enemyNameFadeIn", 9999999 );
  self setClientDvar( "cg_enemyNameFadeOut", 9999999 );
  self setClientDvar( "player_meleeRange", 200 );
  self setClientDvar( "player_meleeWidth", 200 );

  //Hud Elements
  self.displayCash = NewClientHudElem( self );
  self.displayCash.alpha = 0;
  self.displayCash.font = "objective";
  self.displayCash.fontscale = 1.9;
  self.displayCash.x = 550;
  self.displayCash.y = 300;
  self.displayCash.archived = true;
  self.displayCash.color = ( 1, 1, 0 );
  self.displayCash.alignX = "right";
  self.displayCash.alignY = "middle";
  self.displayCash.horzAlign = "fullscreen";
  self.displayCash.vertAlign = "fullscreen";
  self.displayCash setText( "Money: " + self.variable["cash"] );
 
  //Threads
  self thread createHealth();
}

setupGame()
{
  if( self.pers["team"] != "allies" )
  {
      self [[level.allies]]();
      wait 0.2;
  }
  else if( self.pers["team"] == "allies" )
  {
      wait 0.2;
  }
  self.isZombie = false;
}

checkIfAllDead()
{
  for(;;)
  {
      wait 1.0;
      if( level.variable["zombies_released"] == 1 && level.playerCount["allies"] == 1 && level.variable["last_survivor"] == 0 )
      {
        for( i = 0;i < level.players.size;i++ )
        {
            wait 0.05;
            if( level.players[i].isZombie == false && level.players[i].pers["team"] == "allies" )
            {
              level.variable["last_survivor"] = 1;
              level.players[i] thread lastManWeapons();
              break;
            }
        }
      }
      else if( level.variable["zombies_released"] == 1 && level.playerCount["allies"] == 0 )
      {
        wait 1.0;
        level thread CreateCredits( "axis", "Humans Have Been Eliminated" );
        level notify( "match_ended" );
        break;
      }
  }
}

lastManWeapons()
{
  iPrintlnBold( self.name + " ^1Has the DEATH MACHINE" );

  objective_add( 6, "active", self.origin );
  objective_icon( 6, "hud_ks_minigun" );

  self takeAllWeapons();
  self giveWeapon( "minigun_mp", 5, false );
  self giveWeapon( "hatchet_mp" );
  self switchToWeapon( "minigun_mp" );
  self giveMaxAmmo( "minigun_mp" );
  self giveMaxAmmo( "hatchet_mp" );
 
  for(;;)
  {
      objective_position( 6, self.origin );
      wait 0.2;
  }
}

spawnMysteryBox()
{
  level.currentSpot = ( 0, 0, 0 );
  level.spot = randomInt( level.variable[getDvar( "mapname" )]["mystery_box_origins"].size );

  switch( getDvar( "mapname" ) )
  {
      case "mp_nuked": // This is the map Nuketown
        level thread createPerkBox( ( -816, 741, -33 ), ( 0, 70, 90 ), "Speed Cola", ::giveReload, "perk_sleight_of_hand" );
        level thread createPerkBox( ( 597, 309, -23 ), ( 0, 11, 90 ), "Stamin-Up", ::giveSpeed, "perk_lightweight" );
        level thread createPerkBox( ( 329, -551, -26 ), ( 0, -175, 90 ), "Juggernog", ::giveHealth, "rank_prestige07" );
        break;
      case "mp_mountain": // This is the map Summit
        level thread createPerkBox( ( 3885, -981, 352 ), ( 0, -90, 90 ), "Speed Cola", ::giveReload, "perk_sleight_of_hand" );
        level thread createPerkBox( ( 2904, -1954, 497 ), ( 0, -252, 90 ), "Stamin-Up", ::giveSpeed, "perk_lightweight" );
        level thread createPerkBox( ( 2371, -406, 358 ), ( 0, 2, 90 ), "Juggernog", ::giveHealth, "rank_prestige07" );
        break;
      case "mp_array": // This is the map Array
        level thread createPerkBox( ( -60, 1631, 429 ), ( 0, -184, 90 ), "Speed Cola", ::giveReload, "perk_sleight_of_hand" );
        level thread createPerkBox( ( 201, 823, 565 ), ( 0, -15, 90 ), "Stamin-Up", ::giveSpeed, "perk_lightweight" );
        level thread createPerkBox( ( -663, -719, 451 ), ( 0, -193, 90 ), "Juggernog", ::giveHealth, "rank_prestige07" );
        break;
      case "mp_cairo": // This is the map Havana
        break;
      case "mp_cosmodrome": // This is the map Launch
        level thread createPerkBox( ( 696, -1877, -129 ), ( 0, -84, 90 ), "Speed Cola", ::giveReload, "perk_sleight_of_hand" );
        level thread createPerkBox( ( 1696, 731, -305 ), ( 0, -84, 90 ), "Stamin-Up", ::giveSpeed, "perk_lightweight" );
        level thread createPerkBox( ( -5, 1968, -128 ), ( 0, -269, 90 ), "Juggernog", ::giveHealth, "rank_prestige07" );
        break;
      case "mp_crisis": // This is the map Crisis
        break;
      case "mp_duga": // This is the map Grid
        break;
      case "mp_firingrange": // This is the map Firing Range
        level thread CreatePackBox( ( 359, 908, 206 ), ( 0, -115, 0 ) );
        level thread createPerkBox( ( 800, 1084, -12 ), ( 0, -120, 90 ), "Speed Cola", ::giveReload, "perk_sleight_of_hand" );
        level thread createPerkBox( ( -300, 175, -84 ), ( 0, 173, 90 ), "Juggernog", ::giveHealth, "rank_prestige07" );
        level thread createPerkBox( ( -951, 1194, -15 ), ( 0, -108, 90 ), "Stamin-Up", ::giveSpeed, "perk_lightweight" );
        level thread createTrap( ( 176, 888, -12 ), ( 0, -111, 0 ) );
        break;
      case "mp_hanoi": // This is the map Hanoi
        break;
      case "mp_havoc": // This is the map Jungle
        break;
      case "mp_radiation": // This is the map Radiation
        break;
      case "mp_russianbase": // This the map WMD
        break;
      case "mp_villa": // This is the map Villa
        break;
      case "mp_cracked": // This is the map Cracked
        break;
  }
  level thread createBox( level.variable[getDvar( "mapname" )]["mystery_box_origins"][level.spot], level.variable[getDvar( "mapname" )]["mystery_box_angles"][level.spot] );
  level.currentSpot = level.variable[getDvar( "mapname" )]["mystery_box_origins"][level.spot];
}

createPerkBox( pos, ang, name, func, shad )
{
  slot = level.variable["perk_slots"];
  level.variable["perk_name"][slot] = name;
  level.variable["perk_function"][slot] = func;
 
  level.perkBox[slot] = spawn( "script_model", pos );
  level.perkBox[slot] setModel( "mp_supplydrop_axis" );
  level.perkBox[slot].angles = ang;

  FlagEffect = loadfx( "misc/fx_ui_flagbase_gold_t5" );
  Effect = PlayLoopedFX( FlagEffect, 1, pos - ( 0, 0, 34 ) );

  iconOrg = level.perkBox[slot].origin;
  icon = newTeamHudElem( "allies" );
  icon.x = iconOrg[0];
  icon.y = iconOrg[1];
  icon.z = iconOrg[2] + 30;
  icon.alpha = .89;
  icon.archived = true;
  icon setShader( shad, 16, 16 );
  icon setWayPoint( true, shad );
 
  level.variable["perk_slots"]++;
  level.variable["slots_left"]++;
}

CreatePackBox( pos, ang )
{
  level.pBox = spawn( "script_model", pos );
  level.pBox setModel( "mp_supplydrop_ally" );
  level.pBox.angles = ang;
 
  level.pGun = spawn( "script_model", level.pBox.origin + ( 0, 0, 30 ) );
  level.pGun setModel( GetWeaponModel( "claymore_mp" ) );
  level.pGun.angles = ang + ( 0, 90, 0 );
  level.pGun hide();
 
  FlagEffect = loadfx( "misc/fx_ui_flagbase_gold_t5" );
  Effect = PlayLoopedFX( FlagEffect, 1, pos - ( 0, 0, 16 ) );
 
  objective_add( 1, "active", level.pBox.origin );
  objective_icon( 1, "compass_supply_drop_red" );
 
  iconOrg = level.pBox.origin;
  level.Picon = newTeamHudElem( "allies" );
  level.Picon.x = iconOrg[0];
  level.Picon.y = iconOrg[1];
  level.Picon.z = iconOrg[2] + 30;
  level.Picon.alpha = .89;
  level.Picon.archived = true;
  level.Picon setShader( "compass_supply_drop_red", 16, 16 );
  level.Picon setWayPoint( true, "compass_supply_drop_red" );
 
  level.variable["pack_a_punch"] = true;
}

createBox( pos, ang )
{
  level.mBox = spawn( "script_model", pos );
  level.mBox setModel( "mp_supplydrop_ally" );
  level.mBox.angles = ang;
   
  level.mGun = spawn( "script_model", level.mBox.origin );
        level.mGun setModel( GetWeaponModel( "claymore_mp" ) );
        level.mGun.angles = level.mBox.angles + ( 0, 90, 0 );
        level.mGun hide();
 
  FlagEffect = loadfx( "misc/fx_ui_flagbase_gold_t5" );
  Effect = PlayLoopedFX( FlagEffect, 1, pos - ( 0, 0, 18 ) );
 
  objective_add( 0, "active", level.mBox.origin );
  objective_icon( 0, "compass_supply_drop_green" );

  iconOrg = level.mBox.origin;
  level.Micon = newTeamHudElem( "allies" );
  level.Micon.x = iconOrg[0];
  level.Micon.y = iconOrg[1];
  level.Micon.z = iconOrg[2] + 30;
  level.Micon.alpha = .89;
  level.Micon.archived = true;
  level.Micon setShader( "compass_supply_drop_green", 16, 16 );
  level.Micon setWayPoint( true, "compass_supply_drop_green" );
}

createTrap( pos, ang )
{
  slot = level.variable["traps_slots"];

  level.Trap[slot] = spawn( "script_model", pos );
  level.Trap[slot] setModel( level.friendlyDogModel );
  level.Trap[slot].angles = ang;
  level.Trap[slot].active = false;
  level.Trap[slot] hide();
  level.Trap[slot] NotSolid();
  level.Trap[slot].user = undefined;
 
  objective_add( level.variable["slots_left"], "active", pos );
  objective_icon( "headicon_dead" );
 
  level.Trap[slot] thread monitorActive();
 
  level.variable["traps_slots"]++;
  level.variable["slots_left"]++;
  level.variable["trap_created"] = true;
}

checkDistance()
{
  self endon( "disconnect" );
 
  while( 1 )
  {
      wait 0.01;

      if( level.variable["trap_created"] == true )
      {
        for( i = 0; i < level.Trap.size; i++ )
        {
            if( distance( self.origin, level.Trap[i].origin ) < 75 && self.pers["team"] == "allies" && self.isZombie == false && level.Trap[i].active == false )
            {
              self setLowerMessage( "Press [{+activate}] to activate Trap[1000]" );
             
              for(;;)
              {
                  if( self useButtonPressed() == true && distance( self.origin, level.Trap[i].origin ) < 75 && self.pers["team"] == "allies" && self.isZombie == false && level.Trap[i].active == false && self.variable["cash"] >= 1000 )
                  {
                    self thread addMoney( -1000 );
                    self clearLowerMessage( 1.0 );
                    level.Trap[i].active = true;
                    level.Trap[i] notify( "start_active" );
                    level.Trap[i].user = self;
                    break;
                  }
                  else if( distance( self.origin, level.Trap[i].origin ) > 75 )
                  {
                    self clearLowerMessage( 1.0 );
                    break;
                  }
                  wait 0.01;
              }
            }
            else if( distance( self.origin, level.Trap[i].origin ) > 75 )
            {
              self clearLowerMessage( 1.0 );
            }
        }
      }
      for( i = 0; i < level.variable["perk_slots"]; i++ )
      {
        if( distance( self.origin, level.perkBox[i].origin ) < 75 && self.pers["team"] == "allies" && self.isZombie == false && self.variable["cash"] >= 400)
        {
            self setLowerMessage( "Press [{+activate}] for " + level.variable["perk_name"][i] );
           
            for(;;)
            {
              if( self useButtonPressed() == true && distance( self.origin, level.perkBox[i].origin ) < 75 && self.pers["team"] == "allies" && self.isZombie == false && self.variable["cash"] >= 500 )
              {
                  self thread addMoney( -400 );
                  self thread [[level.variable["perk_function"][i]]]();
                  self iPrintlnBold( "^2You bought " + level.variable["perk_name"][i] );
                  self playLocalSound( "uin_alert_cash_register" );
                  self clearLowerMessage( 1.0 );
                  break;
              }
              else if( self.variable["cash"] < 400 )
              {
                  self iPrintlnBold( "Not enough Money" );
                  self playLocalSound( "prj_bullet_impact_headshot_2d" );
                  break;
              }
              else if( distance( self.origin, level.perkBox[i].origin ) > 75 )
                                    {
                                          self clearLowerMessage( 1.0 );
                                          break;
                                  }
              wait 0.01;
            }
        }
      }
      if( distance( self.origin, level.mBox.origin ) < 75 && self.pers["team"] == "allies" && self.isZombie == false && level.variable["mysterybox_in_use"] == 0 )
      {
        self setLowerMessage( "Press [{+activate}] for Mystery Box" );
        randWeap = randomInt( level.guns.size );
       
        for(;;)
        {
            if( self useButtonPressed() == true && distance( self.origin, level.mBox.origin ) < 75 && self.pers["team"] == "allies" && self.isZombie == false && level.variable["mysterybox_in_use"] == 0 && self.variable["cash"] >= 650 )
            {
              level.variable["mysterybox_in_use"] = 1;
              self playLocalSound( "mpl_turret_alert" );
              self thread addMoney( -650 );
              self clearLowerMessage( 1.0 );
              level.mGun show();
                                  level.mGun moveTo( level.mBox.origin + ( 0, 0, 30 ), 1 );
                                  wait .2;
                                  for( i = 0; i < 14; i++ )
                                  {
                                      rander = randomInt( level.guns.size );
                                          level.mGun setModel( GetWeaponModel( level.guns[rander] ) );
                                          wait( 0.025 * i );
                                  }
              if( level.variable["mystery_box_uses"] != 5 )
              {
                                      level.mGun setModel( GetWeaponModel( level.guns[randWeap] ) );
                                      wait .1;
                  if( self.pers["team"] == "allies" && self.isZombie == false )
                  {
                    if( self GetWeaponsListPrimaries().size > 1 ) self takeWeapon( self getCurrentWeapon() );
                                        self giveWeapon( level.guns[randWeap], 0, self calcWeaponOptions( 15, 0, 0, 0, 0 ) );
                                        self switchToWeapon( level.guns[randWeap] );
                                        self giveMaxAmmo( level.guns[randWeap] );
                  }
                                      self clearLowerMessage( .5 );
                                      level.mGun moveTo( level.mBox.origin, 1 );
                                      wait 1;
                                      level.mGun hide();
                                      level.variable["mysterybox_in_use"] = 0;
                  level.variable["mystery_box_uses"]++;
              }
              else if( level.variable["mystery_box_uses"] == 5 )
              {
                  level.variable["mystery_box_uses"] = 0;
                  level.mGun setModel( GetWeaponModel( "briefcase_bomb_mp" ) );
                  wait 0.1;
                  self playSound( "amb_end_nuke" );
                 
                  time = 0;
                  while( time != 9 )
                  {
                    playFx( level._effect["character_fire_death_torso"], level.mBox.origin );
                    time++;
                    wait 0.5;
                  }
                  level.mGun moveTo( level.mBox.origin, 1 );
                                      wait 1;
                  level.mGun hide();
                                      level.variable["mysterybox_in_use"] = 0;
                  level.mBox moveTo( level.mBox.origin + ( 0, 0, 500 ), 5 );
                  wait 5;
                  level.mBox thread moveToNextSpot();
              }
                                  break;
            }
            else if( self.variable["cash"] < 650 )
            {
              self iPrintlnBold( "Not enough Money" );
              self playLocalSound( "prj_bullet_impact_headshot_2d" );
              self clearLowerMessage( 1.0 );
              break;
            }
            else if( distance( self.origin, level.mBox.origin ) > 75 )
                                {
                                        self clearLowerMessage( 1.0 );
                                        break;
                                }
            wait 0.01;
        }
      }
      if( level.variable["pack_a_punch"] == true )
      {
        if( distance( level.pBox.origin, self.origin ) < 75 && level.variable["using_pack_a_punch"] == 0 )
        {
            self setLowerMessage( "Press [{+activate}] for Pack-A-Punch" );

            for(;;)
            {
              if( self useButtonPressed() == true && level.variable["using_pack_a_punch"] == 0 && self.isZombie == false && self.pers["team"] == "allies" && self.variable["cash"] >= 500 )
              {
                  takeGun = self getCurrentWeapon();
                  self playLocalSound( "mpl_turret_alert" );
                  level.variable["using_pack_a_punch"] = 1;
                  self clearLowerMessage( 1.0 );
                  self thread addMoney( -500 );
                  level.pGun setModel( GetWeaponModel( takeGun ) );
                  level.pGun show();
                  gun = self givePackedWeapon( takeGun );
                  if( gun == takeGun ) self thread addMoney( 400 );
                  self disableWeapons();
                  wait 2;
                  level.pGun moveTo( level.pBox.origin, 2 );
                  wait 3;
                  level.pGun setModel( GetWeaponModel( gun ) );
                  level.pGun moveTo( level.pBox.origin + ( 0, 0, 30 ), 2 );
                  wait 3;
                  self enableWeapons();
                  wait 0.1;
                  if( self.pers["team"] == "allies" && self.isZombie == false )
                  {
                    self takeWeapon( takeGun );
                    self giveWeapon( gun, 0, self calcWeaponOptions( 15, 0, 0, 0, 0 ) );
                    self switchToWeapon( gun );
                    self giveMaxAmmo( gun );
                  }
                  level.variable["using_pack_a_punch"] = 0;
                  level.pGun hide();
                  break;
              }
              else if( distance( self.origin, level.pBox.origin ) > 75 )
                              {
                                self clearLowerMessage( 1.0 );
                                      break;
                              }
              wait 0.01;
            }
        }
        else if( distance( self.origin, level.pBox.origin ) > 75 )
                        {
                          self clearLowerMessage( 1.0 );
                        }
      }
      else
      {
        self clearLowerMessage( 1.0 );
      }
  }
  wait 0.01;
}

moveToNextSpot()
{
  self.spot = randomInt( level.variable[getDvar( "mapname" )]["mystery_box_origins"].size );
 
  if( level.variable[getDvar( "mapname" )]["mystery_box_origins"][self.spot] == level.currentSpot ) self thread moveToNextSpot();
  self moveTo( level.variable[getDvar( "mapname" )]["mystery_box_origins"][self.spot] + ( 0, 0, 500 ), 8 );
  wait 8;
  self moveTo( level.variable[getDvar( "mapname" )]["mystery_box_origins"][self.spot], 5 );
  self rotateTo( level.variable[getDvar( "mapname" )]["mystery_box_angles"][self.spot], 5 );
  wait 5;
  iconOrg = self.origin;
  level.Micon.x = iconOrg[0];
  level.Micon.y = iconOrg[1];
  level.Micon.z = iconOrg[2] + 30;
  objective_position( 0, self.origin );
  level.mGun.angles = level.variable[getDvar( "mapname" )]["mystery_box_angles"][self.spot] + ( 0, 90, 0 );
  level.currentSpot = level.variable[getDvar( "mapname" )]["mystery_box_origins"][self.spot];
}

monitorActive()
{
  for(;;)
  {
      self waittill( "start_active" );
 
      iPrintlnBold( "^2The trap is active" );
     
      self thread monitorDistanceToMe();

      for( i = 0; i < 60; i++ )
      {
        PlayFX( level._effect["tacticalInsertionFizzle"], self.origin );
        wait 1;
      }
      self.active = false;
      iPrintlnBold( "^1The trap is no longer active" );
      wait 1;
      self notify( "stop_active" );
  }
}

monitorDistanceToMe()
{
  self endon( "stop_active" );

  while( 1 )
  {
      for(;;)
      {
        for( i = 0; i < level.players.size; i++ )
        {
            if( distance( level.players[i].origin, self.origin ) < 50 && isAlive( level.players[i] ) && level.players[i].pers["team"] == "axis" && level.players[i].isZombie == true )
            {
              level.players[i] suicide();
              self.user thread addMoney( 100 );
              break;
            }
        }
        wait 0.01;
      }
  }
}

givePackedWeapon( gunner )
{
  if( self getCurrentWeapon() == "aug_mp" ) return "aug_elbit_extclip_mp";
  else if( self getCurrentWeapon() == "m16_mp" ) return "m16_elbit_extclip_mp";
  else if( self getCurrentWeapon() == "famas_mp" ) return "famas_elbit_extclip_mp";
  else if( self getCurrentWeapon() == "rpk_mp" ) return "rpk_elbit_extclip_mp";
  else if( self getCurrentWeapon() == "commando_mp" ) return "commando_elbit_gl_extclip_mp";
  else if( self getCurrentWeapon() == "python_mp" ) return "python_speed_mp";
  else if( self getCurrentWeapon() == "ak74u_mp" ) return "ak74u_elbit_grip_rf_mp";
  else if( self getCurrentWeapon() == "l96a1_mp" ) return "l96a1_vzoom_extclip_mp";
  else if( self getCurrentWeapon() == "fnfal_mp" ) return "fnfal_elbit_mk_extclip_mp";
  else if( self getCurrentWeapon() == "cz75_mp" ) return "cz75_upgradesight_auto_mp";
  else if( self getCurrentWeapon() == "spectre_mp" ) return "spectre_elbit_grip_extclip_mp";
  else if( self getCurrentWeapon() == "hk21_mp" ) return "hk21_elbit_extclip_mp";
  else if( self getCurrentWeapon() == "m60_mp" ) return "m60_elbit_grip_extclip_mp";
  else if( self getCurrentWeapon() == "stoner63_mp" ) return "stoner63_elbit_extclip_mp";
  else if( self getCurrentWeapon() == "mp5k_mp" ) return "mp5k_elbit_rf_mp";
  else if( self getCurrentWeapon() == "asp_mp" ) return "aspdw_mp";
  else
  {
      self iPrintlnBold( "This weapon cannot be upgraded" );
      return gunner;
  }
}

monitorNuke()
{
  level endon( "match_ended" );

  level.NukeText = NewHudElem();
  level.NukeText.elemType = "timer";
  level.NukeText.alignX = "right";
        level.NukeText.alignY = "top";
        level.NukeText.horzAlign = "right";
        level.NukeText.vertAlign = "top";
  level.NukeText.y = 20;
        level.NukeText.x = -27;
        level.NukeText.foreground = true;
        level.NukeText.hideWhenInMenu = true;
        level.NukeText.fontScale = 2;
        level.NukeText.font = "objective";
        level.NukeText.alpha = 1;
        level.NukeText.color = ( 0, 0, 0 );
        level.NukeText SetTimer( level.variable["time_limit"] );
  level.NukeShader = NewHudElem();
        level.NukeShader.elemType = "icon";
        level.NukeShader.alignX = "right";
        level.NukeShader.alignY = "top";
        level.NukeShader.horzAlign = "right";
        level.NukeShader.vertAlign = "top";
        level.NukeShader.foreground = false;
        level.NukeShader.hideWhenInMenu = true;
        level.NukeShader.x = -10;
  level.NukeShader.alpha = 0.45;
        level.NukeShader SetShader( "headicon_dead" ,60, 60 );
  for( i = level.variable["time_limit"]; i > -1; i-- )
  {
      wait 1;
  }
  wait 1;
  players = getEntArray( "player", "classname" );
  for( i = 0; i < players.size; i++ )
  {
      wait 0.02;
      setDvar( "timescale", 0.3 );
      players[i] setClientDvar( "timescale", 0.3 );
      players[i] thread createNukeEffect();

      if( players[i].pers["team"] == "axis" && players[i].isZombie == true )
      {
        playFx( level.chopper_fx["explode"]["death"], players[i].origin );
        players[i] playSound( level.heli_sound[GetHostPlayer().team]["crash"] );
        players[i] suicide();
      }
  }
  wait 1.5;
  setDvar( "timescale", 1 );
  for( i = 0; i < level.players.size; i++ ) level.players[i] setClientDvar( "timescale", 1 );
  level thread CreateCredits( "allies", "Zombies Have Been Nuked" );
}
createNukeEffect()
{
  for( i = 0; i < 1; i += 0.1 )
  {
      self setClientDvar( "r_brightness", i );
      wait 0.1;
  }
}
createGameText()
{
  wait( level.prematchPeriod );

  level.variable["game_ready"] = 1;
 
  level.ZombieText = createServerFontString( "extrabig", 1.8 );
  level.ZombieText setPoint( "CENTER", "CENTER", 0, -40 );
  level.ZombieText.color = ( 1, 0, 0 );
  level.ZombieText.sort = 1001;
  level.zombieText setText( "Zombies Being Picked In" );
  level.ZombieTimer = createServerFontString( "extrabig", 2.3 );
  level.ZombieTimer setPoint( "CENTER", "CENTER", 0, 0 );
  level.ZombieTimer.color = ( 1, 1, 0 );
  level.ZombieTimer.sort = 1001;
  level.ZombieTimer maps\mp\gametypes\_hud::fontPulseInit();

  for( i = 45;i > 0;i-- )
  {
      level.ZombieTimer setValue( i );
      level.ZombieTimer thread maps\mp\gametypes\_hud::fontPulse( level );
      wait 1;
  }

  level.ZombieTimer destroyElem();
  level.ZombieText setText( "Zombies Released" );
  level.ZombieText fadeOverTime( 3.0 );
  level.ZombieText.alpha = 0;

  wait( 3.0 );

  level.ZombieText destroyElem();
 
  randomZombie = randomInt( level.players.size );
  randomZombie2 = randomInt( level.players.size );
 
  if( level.players.size <= 4 )
  {
      level.players[randomZombie] thread changeToZombie();
  }
  else if( level.players.size >= 5 )
  {
      if( level.players[randomZombie] == level.players[randomZombie2] ) randomZombie = randomInt( level.players.size );
      level.players[randomZombie] thread changeToZombie();
      level.players[randomZombie2] thread changeToZombie();
  }
  level.variable["zombies_released"] = 1;
}

changeToZombie()
{
  wait 0.01;

  self.isZombie = true;
  self suicide();
  self [[level.axis]]();
 
  iPrintlnBold( self.name + "^1 Has been infected" );
 
  level.variable["dead_people"][level.variable["dead_persons"]] = self.name;
  level.variable["dead_persons"]++;
}

addMoney( points )
{
  self endon( "disconnect" );

  self.variable["cash"] = self.variable["cash"] + points;
  self.displayCash setText( "Money: " + self.variable["cash"] );
  hud_score = NewClientHudElem( self );
  hud_score.alpha = 0;
  hud_score.font = "objective";
  hud_score.fontscale = 1.9;
  hud_score.x = 550;
  hud_score.y = 300;
  hud_score.archived = true;
  hud_score.color = ( 1, 1, 0 );
  hud_score.alignX = "right";
  hud_score.alignY = "middle";
  hud_score.horzAlign = "fullscreen";
  hud_score.vertAlign = "fullscreen";
  hud_score settext( points );
  direction = randomint( 340 );
  hud_score FadeOverTime( .5 );
  hud_score.alpha = 1;
  hud_score MoveOverTime( 10 );
  hud_score.x = cos( direction ) * randomint( 250 );
  hud_score.y = sin( direction ) * randomint( 250 );
  wait 1.3;
  hud_score FadeOverTime( .3 );
  hud_score.alpha = 0;
  wait .3;
  hud_score destroy();
}

CreateCredits( team, text )
{
  iPrintlnBold( " " );
  iPrintlnBold( " " );
  iPrintlnBold( " " );
  iPrintlnBold( " " );
  level.Picon destroy();
  level.Micon destroy();
  level.NukeShader destroy();
  level.NukeText destroy();

  for( i = 0; i < level.players.size; i++ )
  {
      level.players[i] thread monitorFreeze();
      level.players[i] setClientUIVisibilityFlag( "hud_visible", 0 );
      level.players[i].healthText destroy();
      level.players[i].displayCash destroy();
      level.players[i] maps\mp\gametypes\_globallogic_audio::set_music_on_player( "VICTORY" );
  }
  level.BlackScreen = newHudElem();
  level.BlackScreen maps\custom\_mod_menu::defineElement( ( 0, 0, 0 ), true, "center", "center", 0, 0, 0, -1 );
  level.BlackScreen setShader( "black", 1000, 1000 );
  level.BlackScreen fadeOverTime( 0.5 );
  level.BlackScreen.alpha = 1;
 
  wait 0.5;
 
  thread createLine( "In Memory Of:", 4 );
  wait 0.42;
  for( i = 0; i < level.variable["dead_people"].size; i++ )
  {
      level thread createLine( level.variable["dead_people"][i], 2.5 );
      wait 1;
  }
  wait 2;
  thread createLine( "Most Money:", 4 );
  wait 0.42;
  thread createLine( getHighestMoney(), 2.5 );
  wait 5;
  thread createLine( "Thanks for playing", 2.5 );
  wait 0.35;
  thread createLine( "Visit www.SkittleHacks.tk for More", 2 );
  wait 8;
  thread maps\mp\gametypes\_globallogic::endGame( team, text );
}

createLine( text, size )
{
  line = createServerFontString( "objective", size );
  line setPoint( "CENTER", "CENTER", 0, 400 );
  line.color = ( 1, 1, 1 );
  line.sort = 1001;
  line.glowColor = ( 0, 1, 0 );
  line.glowAlpha = 1;
  line setText( text );
  line moveOverTime( 8.0 );
  line.y = -400;
  wait 8;
  line destroy();
}

monitorFreeze()
{
  for(;;)
  {
      self freezeControls( true );
      self clearLowerMessage( 1.0 );
      wait 1;
  }
}

zombieSettings()
{
  self setMoveSpeedScale( 1.6 );
  self.maxHealth = 650;
  self.health = 650;
  self.displayCash.alpha = 0;

  self takeAllWeapons();
  self clearPerks();
  self giveWeapon( "defaultweapon_mp" );
  self giveWeapon( "knife_mp" );
  self giveWeapon( "hatchet_mp" );
  self switchToWeapon( "defaultweapon_mp" );
  self setWeaponAmmoClip( "defaultweapon_mp", 0 );
  self setWeaponAmmoStock( "defaultweapon_mp", 0 );
  self giveMaxAmmo( "hatchet_mp" );
}

humanSettings()
{
  self setMoveSpeedScale( 1.0 );
  self.maxHealth = 600;
  self.health = 600;
  self.displayCash.alpha = 1;

  self.randWeaps = strtok( "aug_mp|stoner63_mp|mp5k_mp|spas_mp", "|" );
  self.randNum = randomInt( self.randWeaps.size );
  self.chosenGun = self.randWeaps[self.randNum];
  self takeAllWeapons();
  self clearPerks();
  self setPerk( "specialty_finalstand" );
  self giveWeapon( "knife_mp" );
  self giveWeapon( self.chosenGun, 0, self calcWeaponOptions( 15, 0, 0, 0, 0 ) );
  self giveWeapon( "asp_mp" );
  self switchToWeapon( self.chosenGun );
  self giveMaxAmmo( self.chosenGun );
}

createHealth()
{
  self.healthBar = self createBar( ( 1, 1, 1 ), 150, 13 );
  self.healthBar setPoint( "CENTER", "BOTTOM", 150, -4 );
  self.healthText = self createFontString( "objective", 1.5 );
  self.healthText setPoint( "CENTER", "BOTTOM", 150, -20 );
  self.healthText setText( "^1Health" );
  for(;;)
  {
      self.healthBar updateBar( self.health / self.maxhealth );
      wait 0.001;
  }
}

giveSpeed()
{
  self setMoveSpeedScale( 1.2 );
  self setPerk( "specialty_movefaster" ); 
  self setPerk( "specialty_fallheight" );
  self setPerk( "specialty_longersprint" ); 
  self setPerk( "specialty_unlimitedsprint" );
  self setPerk( "specialty_fastweaponswitch" );
  self setPerk( "specialty_fastreload" );
  self setPerk( "specialty_fastmeleerecovery" );
  self setPerk( "specialty_fastmantle" );
  self setPerk( "specialty_fastinteract" );
  self setPerk( "specialty_fastads" );
}

giveHealth()
{
  self.maxHealth = 750;
  self.health = 750;
}

giveReload()
{
  self setPerk("specialty_fastreload"); 
  self setPerk("specialty_fastads");
}

getHighestMoney()
{
  players = level.players;
  winner = undefined;
  winner2 = undefined;
  tie = false;
  for( i = 0;i < players.size;i++ )
  {
      if ( !isDefined( players[i].variable["cash"] ) ) continue;
      if ( !isDefined( winner ) || players[i].variable["cash"] > winner.variable["cash"] )
      {
        winner = players[i];
        tie = false;
      }
      else if ( players[i].variable["cash"] == winner.variable["cash"] )
      {
        winner2 = players[i];
        tie = true;
      }
  }
  if ( tie || !isDefined( winner ) ) return winner.name + " and " + winner2.name + " - " + winner.variable["cash"];
  else return winner.name + " - " + winner.variable["cash"];
}
 

3LIT3 Loading
Admin
Admin

Posts : 105
Join date : 2011-10-25
Age : 21
Location : NuKeToWn NuKe

View user profile http://www.loadingmods.tk

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum