Poll

What would you most like to see?

Not break T+T
40 (18.5%)
Ammo system
59 (27.3%)
AR2 energy balls
117 (54.2%)

Total Members Voted: 216

Author Topic: HλLF-LIFE 2 Weapons Pack [v1.1] Pick up that can.  (Read 28825 times)

I really like this pack other than some downfalls. I like the MP7 and the grenade the most

I really like the crowbar.

I must be late... still, this is awesome...

omg u forgot the pistol

Code: [Select]
package AR2AltFire
{
function Armor::onTrigger(%this, %player, %slot, %val)
   {
       if(%player.getMountedImage(0) $= HL2AR2Image.getID() && %slot $= 4 && %val)     // Make sure the "HL2AR2Image" is changed to your weaponImage.
       {
         if(%player.lastAlt !$= "" && getSimTime() - %player.lastAlt < 10000)
         {
    %player.playThread(2, plant);
    serverPlay3D(HL2PistolClickSound,%player.getPosition()); // Unable to fire sound, I used my pistolClick.
             return;
         }

         serverPlay3D(HL2AR2ChargeSound,%player.getPosition()); // This is the charge sound, you can probably just rip this straight out of hl2 for it to work, just make sure it lasts about 1000ms.
%player.schedule(0,0,playThread, 2, shiftLeft);
%player.schedule(111,0,playThread, 2, plant);
%player.schedule(222,0,playThread, 2, shiftRight);
%player.schedule(333,0,playThread, 2, shiftLeft);
%player.schedule(444,0,playThread, 2, plant);
%player.schedule(555,0,playThread, 2, shiftRight);
%player.schedule(666,0,playThread, 2, shiftLeft);
%player.schedule(777,0,playThread, 2, plant);
%player.schedule(888,0,playThread, 2, shiftRight);
%player.schedule(999,0,playThread, 2, plant);
schedule(1000 ,0,HL2AR2AltFire,%this, %player, %slot, %val);
         %player.lastAlt = getSimTime();
       }
       Parent::onTrigger(%this, %player, %slot, %val);
   }
};
ActivatePackage(AR2AltFire);

function HL2AR2AltFire(%this, %player, %slot, %val)
{
%projectile = energyBallProjectile;
         %vector = %player.getMuzzleVector(0);
         %objectVelocity = %player.getVelocity();
         %vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
         %vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
         %velocity = VectorAdd(%vector1,%vector2);
         %p = new Projectile()
         {
             dataBlock = %projectile;
             initialVelocity = %velocity;
             initialPosition = %player.getMuzzlePoint(0);
             sourceObject = %player;
             sourceSlot = 0;
             client = %player.client;
         };
         serverPlay3D(HL2AR2AltFireSound,%player.getPosition()); // Find a fire sound for the AR2 blast.
%player.playThread(2, activate);
         MissionCleanup.add(%p);
         return %p;
}

AR2 Balls anyone? Code segment free to use, just make sure space guy's energy ball is enabled.
EDIT: I just realized I swapped %obj and %player randomly in this code segment, silly me, anyways fixed it.
« Last Edit: July 25, 2013, 03:25:06 PM by Rykuta »

Code: [Select]
package AR2AltFire
{
function Armor::onTrigger(%this, %player, %slot, %val)
    {
      if(%player.getMountedImage(0) $= HL2AR2Image.getID() && %slot $= 4 && %val)     // Make sure the "HL2AR2Image" is changed to your weaponImage.
      {
          if(%player.lastAlt !$= "" && getSimTime() - %player.lastAlt < 10000)
          {
    %player.playThread(2, plant);
    serverPlay3D(HL2PistolClickSound,%player.getPosition()); // Unable to fire sound, I used my pistolClick.
            return;
          }

          serverPlay3D(HL2AR2ChargeSound,%player.getPosition()); // This is the charge sound, you can probably just rip this straight out of hl2 for it to work, just make sure it lasts about 1000ms.
%obj.schedule(0,0,playThread, 2, shiftLeft);
%obj.schedule(111,0,playThread, 2, plant);
%obj.schedule(222,0,playThread, 2, shiftRight);
%obj.schedule(333,0,playThread, 2, shiftLeft);
%obj.schedule(444,0,playThread, 2, plant);
%obj.schedule(555,0,playThread, 2, shiftRight);
%obj.schedule(666,0,playThread, 2, shiftLeft);
%obj.schedule(777,0,playThread, 2, plant);
%obj.schedule(888,0,playThread, 2, shiftRight);
%obj.schedule(999,0,playThread, 2, plant);
%obj.schedule(1000,0,HL2AR2AltFire,%this, %player, %slot, %val);
        %player.lastAlt = getSimTime();
      }
      Parent::onTrigger(%this, %player, %slot, %val);
    }
};
ActivatePackage(AR2AltFire);

function HL2AR2AltFire(%this, %player, %slot, %val)
{
%projectile = energyBallProjectile;
         %vector = %player.getMuzzleVector(0);
         %objectVelocity = %player.getVelocity();
         %vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
         %vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
         %velocity = VectorAdd(%vector1,%vector2);
         %p = new Projectile()
         {
            dataBlock = %projectile;
            initialVelocity = %velocity;
            initialPosition = %player.getMuzzlePoint(0);
            sourceObject = %player;
            sourceSlot = 0;
            client = %player.client;
         };
         serverPlay3D(HL2AR2AltFireSound,%player.getPosition()); // Find a fire sound for the AR2 blast.
%player.playThread(2, activate);
         MissionCleanup.add(%p);
         return %p;
}

AR2 Balls anyone? Code segment free to use, just make sure space guy's energy ball is enabled.
I was already like half-way done coding it :[
Whatever, i'll try my best to push an update today. It will also include support for T+T.


I was already like half-way done coding it :[
Whatever, i'll try my best to push an update today. It will also include support for T+T.
don't make it a part of T+T please


What, why?
i mean, i would like it if it had a seperate support for it. but i don't want it all to be changed.

i mean, i would like it if it had a seperate support for it. but i don't want it all to be changed.
No, I mean you can use it with T+T and have all the weapons from both packs work.

FINALLY. Somebody made a complete HL set.

No, I mean you can use it with T+T and have all the weapons from both packs work.
oh ok.

Maybe re-do the MP7 model, it looks... poopy.

Maybe re-do the MP7 model, it looks... poopy.
The MP7 is the best looking one. Describe 'poopy'.