Author Topic: Constant Ammo Leech  (Read 321 times)

Is it possible to make it so when a player equips an item, the amount of ammo it has is leeched from it, and when unequipped, the leech stops?

You mean like a constant ammo drain of some sort when a player is wielding the weapon? If yes, then this can be done quite easily.

edit: This is one way to do it.

package something
{
   function weaponImage::onMount(%this,%player,%a)
   {
      parent::onMount(%this,%player,%a);
      if(%this.getName() $= "someWeaponImage")
      {
         //Some code to start leeching
      }
   }

   function weaponImage::onUnMount(%this,%player,%a)
   {
      if(%this.getName() $= "someWeaponImage")
      {
         //Some code to stop leeching
      }
      parent::onUnMount(%this,%player,%a);
   }
};
activatePackage(something);

« Last Edit: August 06, 2011, 07:59:10 PM by infiniteLoop »

Ah, thanks. Will see if I can get this to work.