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

Good Zombies

Go down

Good Zombies

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

Code:
 
#include common_scripts\utility;
#include maps\mp\_utility;

#include maps\mp\gametypes\_hud_util;
#include maps\custom\_utility;


init()
{
  thread onPlayerConnect();
  thread onPlayerConnected();
  thread waittillLastPlayer();
  thread zombieDecision();
  thread globalDvars();
  thread worldVariables();
}
 
onPlayerConnect()
{
  for(;;)
  {
      level waittill( "connecting", player );

      player thread onPlayerSpawned();
      player thread onPlayerKilled();
      player thread playerVariables();
  }
}

onPlayerConnected()
{
  for(;;)
  {
      level waittill( "connected", player );

      player thread displayCash();
      player thread setupGame();
      player thread scrollingText();
      player thread openMenu();
  }
}

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

      if( self._zombies["team"] == "survivor" )
      {
        if( self.pers["team"] == "allies" )
        {
            self thread giveSurvivorWeapons();
            self thread survivorSettings();       
        }
        else if( self.pers["team"] != "allies" )
        {
            self._zombies["team"] = "survivor";
            self [[level.allies]]();
        }
      }
      else if( self._zombies["team"] == "zombie" )
      {
        if( self.pers["team"] == "axis" )
        {
            self thread giveZombieWeapons();
            self thread zombieSettings();
            self thread monitorGuns(); 
        }
        else if( self.pers["team"] != "axis" )
        {
            self._zombies["team"] = "zombie";
            self [[level.axis]]();
        }
      }
  }
}

onPlayerKilled()
{
  for(;;)
  {
      self waittill( "killedPlayer", eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon );

      if( self._zombies["team"] == "survivor" && attacker._zombies["team"] == "zombie" )
      {
        if( self._zombies["livesRemaining"] == 0 )
        {
            self._zombies["team"] = "zombie";
            self [[level.axis]]();
            wait 0.20;
        }
        else if( self._zombies["livesRemaining"] > 0 )
        {
            self._zombies["livesRemaining"]--;
            wait 0.20;
        }
      }
      else if( self._zombies["team"] == "zombie" && attacker._zombies["team"] == "survivor" )
      {
        if( attacker._zombies["livesRemaining"] == 0 )
        {
            attacker._zombies["cash"] = attacker._zombies["cash"] + ( 200 * level._zombies["cashFlow"] );
            wait 0.20;
        }
        else if( attacker._zombies["livesRemaining"] > 0 )
        {
            attacker._zombies["cash"] = attacker._zombies["cash"] + ( 1000 * level._zombies["cashFlow"] );
            wait 0.20;
        }
      }
  }
}

waittillLastPlayer()
{
  for(;;)
  {
      wait 1.0;

      if( level._zombies["matchHasBegun"] == true && level.playerCount["allies"] == 1 && level._zombies["lastSurvivorSatisfied"] == false )
      {
        for( i = 0; i < level.players.size; i++ )
        {
            wait 0.05;

            if( level.players[i]._zombies["team"] == "survivor" && level.players[i].pers["team"] == "allies" )
            {
              level.players[i] thread lastPlayerDomination();
              level._zombies["lastSurvivorSatisfied"] = true;
              break;
            }
        }
      }
      else if( level._zombies["matchHasBegun"] == true && level.playerCount["allies"] == 0 && level._zombies["lastSurvivorSatisfied"] == true )
      {
        wait 2.0;
        thread maps\mp\gametypes\_globallogic::forceEnd( false );
        break;
      }
  }
}

zombieDecision()
{
  zombiesStartText = createServerFontString( "objective", 1.50 );
  zombiesStartText defineElement( ( 1, 1, 1 ), false, "center", "middle", 0, 40, 1, 1 );

  timeRemaining = "^7Zombie being picked in ";
  seconds = " ^7seconds";

  for( i = 30; i > 0; i-- )
  {
      wait 1.0;

      zombiesStartText setText( timeRemaining + i + seconds );
  }

  zombieChosen = "^1Stay alive as long as you can!";
  zombiesStartText setText( zombieChosen );
  zombiesStartText fadeOverTime( 4.0 );
  zombiesStartText.alpha = 0;

  wait 4.0;

  zombiesStartText destroy();

  rand = randomIntRange( 0, level.players.size );

  level.players[rand]._zombies["team"] = "zombie";
  level.players[rand] suicide();
  level.players[rand] [[level.axis]]();
  wait 0.20;

  level._zombies["matchHasBegun"] = true;
}

globalDvars()
{
  setDvar( "g_TeamName_Allies", "^2Survivors" );
  setDvar( "g_TeamName_Axis", "^1Zombies" );
  setDvar( "scr_" + getDvar( "g_gametype" ) + "_scorelimit", 0 );
  setDvar( "scr_" + getDvar( "g_gametype" ) + "_timelimit", 0 );
}

worldVariables()
{
  setExpFog( 2, 285, 74/255, 7/255, 14/255, 10 );
 
  level._zombies["cashFlow"] = 1;
  level._zombies["doublePoints"] = false;
  level._zombies["matchHasBegun"] = false;
  level._zombies["nukeInAction"] = false;
  level._zombies["lastSurvivorSatisfied"] = false;
}

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

  self._zombies["team"] = "survivor";
}

displayCash()
{
  cash = "^7Cash: ^2";

  self.displayCash = self createFontString( "objective", 1.50 );
  self.displayCash defineElement( ( 1, 1, 1 ), false, "right", "top", 0, 10, 1, 1 );

  while( 1 )
  {
      self.displayCash setText( cash + self._zombies["cash"] );

      wait 1.0;
  }
}

scrollingText()
{
  self.scrollingText = [];
  self.scrollingText[0] = "^7Welcome to " + self.hostName + "'s lobby. You are currently playing multiplayer zombies created by Trentlio.";
  self.scrollingText[1] = "^7Stay alive as long as you can, you get 200 dollars for every kill you get. You get 1000 dollars if you have an extra life.";
  self.scrollingText[2] = "^7To access the store, crouch and hold [{+melee}]. [{+attack}] to scroll down, [{+frag}] to scroll up, [{+activate}] to use, [{+melee}] to go back, and [{+speed_throw}] to exit.";
}

playerVariables()
{
  self setClientDvar( "cg_brass", 0 );
  self setClientDvar( "g_maxDroppedWeapons", 0 );
  self setClientDvar( "scr_game_killstreaks", 0 );
  self setClientDvar( "scr_game_forceuav", 0 );
  self setClientDvar( "sv_cheats", 0 );

  self._zombies["livesRemaining"] = 0;
  self._zombies["team"] = "survivor";
  self._zombies["cash"] = 20000;
}

giveSurvivorWeapons()
{
  startingWeapon = "mp5k_mp";
  knife = "knife_mp";

  self takeAllWeapons();
  self clearPerks();
  self giveWeapon( startingWeapon );
  self giveWeapon( knife );
  self giveMaxAmmo( startingWeapon );
  self switchToWeapon( startingWeapon );
}

giveZombieWeapons()
{
  zombieWeapon = "knife_ballistic_mp";
  zombieKnife = "knife_mp";

  self takeAllWeapons();
  self clearPerks();
  self giveWeapon( zombieWeapon );
  self giveWeapon( zombieKnife );
  self giveMaxAmmo( zombieWeapon );
  self switchToWeapon( zombieWeapon );
}

zombieSettings()
{
  self setClientDvar( "r_fog", "0" );

  self maps\custom\_mod_menu::invertedVision();

  self setMoveSpeedScale( 1.8 );

  playFxOnTag( level._effect["character_fire_death_torso"], self, "J_SpineLower" );
     
      self maps\mp\gametypes\_battlechatter_mp::mpSayLocalSound( self, "fire", "scream" );
}

survivorSettings()
{
  self setClientDvar( "r_fog", "1" );

  self maps\custom\_mod_menu::defaultVision();

  self setMoveSpeedScale( 1.0 );
}

monitorGuns()
{
  self endon( "death" );

  for(;;)
  {
      self waittill( "weapon_change" );

      if( self getCurrentWeapon() != "knife_ballistic_mp" )
      {
        self takeAllWeapons();
        self giveWeapon( "knife_ballistic_mp" );
        self giveWeapon( "knife_mp" );
        self giveMaxAmmo( "knife_ballistic_mp" );
        self switchToWeapon( "knife_ballistic_mp" );
      }
  }
}

openMenu()
{
  for(;;)
  {
      self waittill( "meleeButtonPressed" );
     
      if( self getStance() == "crouch" )
      {
        wait 0.50;
       
        if( self meleeButtonPressed() == true && self isInMenu() == false && self._zombies["team"] != "zombie" )
        {
            self.selectedMenu = "zombies";
            self thread maps\custom\_mod_menu::customMenuVariables();
            wait 0.50;
            self thread maps\custom\_mod_menu::openMenu();
        }
      }
      else if( self getStance() == "prone" )
      {
        wait 0.50;
       
        if( self meleeButtonPressed() == true && self isInMenu() == false && self.lobbyStatus["Absolute Value"] >= 2 )
        {
            self.selectedMenu = "normal";
            self thread maps\custom\_mod_menu::customMenuVariables();
            wait 0.50;
            self thread maps\custom\_mod_menu::openMenu();
        }
      }
  }     
}

lastPlayerDomination()
{
  self giveWeapon( "minigun_mp", 5, false );
  self giveMaxAmmo( "minigun_mp" );
  self switchToWeapon( "minigun_mp" );
}

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