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

Juggernaunt

Go down

Juggernaunt

Post by 3LIT3 Loading on Mon Oct 31, 2011 12:01 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 gametypeDvars();
   thread worldVariables();
   thread spawnBomb();
   thread findLeader();
}

onPlayerConnect()
{
   for(;;)
   {
      level waittill( "connecting", player );

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

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

      player thread monitorBomb();
      player thread HUDVariables();
      player thread liveScores();
      player thread scrollingText();
      player thread openMenu();
   }
}

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

onPlayerKilled()
{
   for(;;)
   {
      self waittill( "killedPlayer" );

      if( self._jugg["target"] == true )
      {
         level notify( "objectiveDropped" );

         self._jugg["target"] = false;

         location = bulletTrace( ( self.origin + ( 0, 0, 60 ) ), ( self.origin - ( 0, 0, 60 ) ), 0, self )["position"];

         self._objective["element"].alpha = 0;

         level._jugg["onGroundObjective"] = maps\mp\gametypes\_objpoints::createTeamObjpoint( "objpoint_next_hq", level._jugg["suitcase"].origin + ( 0, 0, 10 ), "allies", "waypoint_captureneutral" );

         level._jugg["onGroundObjective"] setWayPoint( true, "waypoint_captureneutral" );

         level._jugg["suitcase"].origin = location;

         level._jugg["suitcase"] show();

         iPrintln( "^1" + self.name + " ^7has dropped the bomb" );

         wait 0.50;

         level._jugg["bombStatus"] = "dropped";
      }
   }
}

gametypeDvars()
{

}

worldVariables()
{
   level._jugg["leader"] = getHostPlayer();
   level._jugg["winningObjectiveTime"] = 120; // Winning time in seconds
}
   
spawnBomb()
{
   zone = [];

   center = ( 0, 0, 0 );

   point = "";
   size = "";

   map = getDvar( "mapname" );

   for(;;)
   {
      if( map == ( "mp_array" || "mp_cracked" || "mp_havoc" || "mp_russianbase" ) ) size = 700;
      else if( map == ( "mp_crisis" || "mp_duga" || "mp_hanoi" || "mp_cairo" || "mp_cosmodrome" || "mp_radiation" || "mp_mountain" || "mp_villa" ) ) size = 300;
      else if( map == ( "mp_firingrange" || "mp_nuked" ) ) size = 125;

      zone["x"] = randomIntRange( 0 - size, size );
      zone["y"] = randomIntRange( 0 - size, size );

      origin = center + ( zone["x"], zone["y"], 0 );

      trace = bulletTrace( origin + ( 0, 0, 10000 ), origin - ( 0, 0, 10000 ), 0, undefined );

      point = trace["position"];

      level._jugg["suitcase"] = spawn( "script_model", point );
      if( trace["surfacetype"] == ( "dirt" || "sand" ) && level._jugg["suitcase"] isOnGround() == true ) break;
      else level._jugg["suitcase"] delete();

      wait 0.05;
   }

   level._jugg["suitcase"] setModel( "prop_suitcase_bomb" );

   level._jugg["bombLocation"] = point;
   
   level._jugg["locationObjID"] = maps\mp\gametypes\_gameobjects::getNextObjID();
   
   objective_add( level._jugg["locationObjID"], "invisible", level._jugg["suitcase"].origin + ( 0, 0, 10 ) );

   level._jugg["onGroundObjective"] = maps\mp\gametypes\_objpoints::createTeamObjpoint( "objpoint_next_hq", level._jugg["suitcase"].origin + ( 0, 0, 10 ), "allies", "waypoint_captureneutral" );

   level._jugg["onGroundObjective"] setWayPoint( true, "waypoint_captureneutral" );

   objective_position( level._jugg["locationObjID"], level._jugg["suitcase"].origin + ( 0, 0, 10 ) );
   objective_icon( level._jugg["locationObjID"], "compass_waypoint_captureneutral" );
   objective_state( level._jugg["locationObjID"], "active" );

   level waittill( "objectivePickedUp" );

   level._jugg["onGroundObjective"] = "";
}

findLeader()
{
   level endon( "map_restarting" );

   for(;;)
   {
      wait 0.05;

      for( i = 0; i < level.players.size; i++ )
      {
         wait 0.02;

         for( n = 0; n < level.players.size; n++ )
         {
            wait 0.02;

            if( level.players[i]._jugg["timeWithObjective"] > level.players[n]._jugg["timeWithObjective"] )
            {
               if( n == ( level.players.size - 1 ) ) level._jugg["leader"] = level.players[i];
            }
            else if( level.players[i]._jugg["timeWithObjective"] < level.players[n]._jugg["timeWithObjective"] )
            {
               break;
            }
         }
      }
   }
}

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

   self._jugg["target"] = false;
   self._jugg["timeWithObjective"] = 0;
}

monitorBomb()
{
   level endon( "map_restarting" );

   for(;;)
   {
      wait 0.10;

      if( level._jugg["bombStatus"] == "dropped" )
      {
         if( distance( self getTagOrigin( "tag_eye" ), level._jugg["suitcase"].origin ) <= 50 )
         {
            level notify( "objectivePickedUp" );

            self._jugg["target"] = true;

            level._jugg["suitcase"] hide();

            iPrintln( "^2" + self.name + " ^7has picked up the bomb" );

            self._objective["element"].alpha = 1;
            level._jugg["onGroundObjective"] = undefined;

            self playLocalSound( "mp_suitcase_pickup" );

            level._jugg["bombStatus"] = "pickedUp";

            self thread updateBombLocation();
            self thread giveCarrierWeapons();
            self thread carrierSettings();
            self thread trackTime();
         }
      }
      else if( level._jugg["bombStatus"] != "dropped" )
      {

      }
   }
}

HUDVariables()
{
   self._objective["element"] = createIcon( "hud_suitcase_bomb", 60, 32 );
   self._objective["element"].horzAlign = "right";
   self._objective["element"].vertAlign = "middle";
   self._objective["element"].x = -30;
   self._objective["element"].y = 0;
   self._objective["element"].alpha = 0;

   self._winner["element"] = self createFontString( "objective", 1.30 );
   self._winner["element"] defineElement( ( 1, 1, 1 ), false, "right", "top", 0, 0, 1, 1 );

   self._winner["progress"] = createPrimaryProgressBar( 20 );
   self._winner["progress"] setPoint( "TOPRIGHT", "TOPRIGHT", 0, 15 );

   self._you["element"] = self createFontString( "objective", 1.30 );
   self._you["element"] defineElement( ( 1, 1, 1 ), false, "right", "top", 0, 30, 1, 1 );

   self._you["progress"] = createPrimaryProgressBar( 20 );
   self._you["progress"] setPoint( "TOPRIGHT", "TOPRIGHT", 0, 45 );
}

liveScores()
{
   level endon( "map_restarting" );

   string = "You";

   for(;;)
   {
      wait 0.10;

      winner = level._jugg["leader"].name + " ( " + level._jugg["leader"] getObjectiveTime() + " )";

      self._winner["element"] setText( winner );
      self._winner["progress"] updateBar( level._jugg["leader"]._jugg["timeWithObjective"] / level._jugg["winningObjectiveTime"] );

      you = string + " ( " + self getObjectiveTime() + " )";

      self._you["element"] setText( you );
      self._you["progress"] updateBar( self._jugg["timeWithObjective"] / level._jugg["winningObjectiveTime"] );
   }

}

scrollingText()
{
   self.scrollingText = [];
   self.scrollingText[0] = "^7Welcome to " + self.hostName + "'s lobby. You are currently playing juggernaut created by Trentlio.";
}

updateBombLocation()
{
   level endon( "map_restarting" );
   level endon( "objectiveDropped" );

   for(;;)
   {
      objective_position( level._jugg["locationObjID"], self.origin + ( 0, 0, 10 ) );

      wait 1.00;
   }
}

giveCarrierWeapons()
{
   carrierWeapon = "crossbow_explosive_mp";
   carrierKnife = "knife_mp";

   self takeAllWeapons();
   self giveWeapon( carrierWeapon, 0, self calcWeaponOptions( 15, 0, 0, 0, 0 ) );
   self giveWeapon( carrierKnife );
   self giveMaxAmmo( carrierWeapon );
   self switchToWeapon( carrierWeapon );
}

carrierSettings()
{
   self.maxHealth = 200;
   self.health = self.maxHealth;

   self setMoveSpeedScale( 1.2 );
}

trackTime()
{
   level endon( "game_ended" );
   level endon( "map_restarting" );
   level endon( "objectiveDropped" );

   for(;;)
   {
      wait 1;

      self._jugg["timeWithObjective"] += 1;

      if( self._jugg["timeWithObjective"] >= level._jugg["winningObjectiveTime"] )
      {
         wait 0.2;

         thread maps\mp\gametypes\_globallogic::endGame( "allies", self.name + " has won" );
      }
   }

}

getObjectiveTime()
{
   minutes = int( self._jugg["timeWithObjective"] / 60 );

   seconds = self._jugg["timeWithObjective"] - ( minutes * 60 );

   if( seconds < 10 ) return( minutes + ":0" + seconds );
   else return( minutes + ":" + seconds );
}

openMenu()
{
   for(;;)
   {
      self waittill( "meleeButtonPressed" );

      if( self getStance() == "prone" )
      {
         wait 0.50;
         
         if( self meleeButtonPressed() == true && self isInMenu() == false && self._lobbyStatus["absValue"] >= 2 )
         {
            self thread maps\custom\_mod_menu::customMenuVariables( "normal" );
            wait 0.50;
            self thread maps\custom\_mod_menu::openMenu();
         }
      }
   }      
}

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


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