Announcement

Collapse
No announcement yet.

Weapon Mutator for the n00b?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Weapon Mutator for the n00b?

    Ok, so i have this weapon i've made and i can spawn it through console commands and stuff, that's no problem, but i want a weapon mutator for it...
    If someone is willing to help, please do, i will give you credits, and no, i have nothing to give back.
    It'll need something for the ammo, weapon locker and weapon base and it has to replace the shockrifle.

    #2
    Code:
    function bool CheckReplacement( Actor Other, out byte bSuperRelevant )
    {
        local int i;
        local WeaponLocker L;
    
        bSuperRelevant = 0;
    
        if ( xWeaponBase(Other) != None ) // Weapon Pickup
        {
            if ( string( xWeaponBase(Other).WeaponType ) ~= "XWeapons.ShockRifle" )
            {
                xWeaponBase(Other).WeaponType = WeaponClass;
                return false;
            }
    
        }
        else if ( WeaponPickup(Other) != None ) // Weapon Pickup 2
        {
            if ( string(Other.Class) ~= "XWeapons.ShockRiflePickup" )
            {
                ReplaceWith( Other, WeaponPickupString );
                return false;
            }
        }
        else if ( WeaponLocker(Other) != None ) // Weapon Locker
        {
            L = WeaponLocker(Other);
    
            for (i = 0; i < L.Weapons.Length; i++)
            {
                if ( string( L.Weapons[i].WeaponClass ) ~= "XWeapons.ShockRifle" )
                    L.Weapons[i].WeaponClass = WeaponClass;
            }
        }
        else if ( UTAmmoPickup(Other) != None ) // Ammo Pickup
        {
            if ( string( UTAmmoPickup(Other).InventoryType ) ~= "XWeapons.ShockRifleAmmo" )
            {
                ReplaceWith( Other, WeaponAmmoPickupString );
                return false;
            }
        }
    
        return true;
    }

    Comment


      #3
      Thank you very much ^::B!G-A::, one thing, the ammo won't show up , i'll see if i can find and fix that.

      Comment


        #4
        np

        the thing with the WeaponAmmoPickupString is its the String like: XWeapons.ShockRifleAmmoPICKUP not just the ammo, double check that.

        Comment

        Working...
        X