1. Hello, so I've been working in a new gamemode for Event Manager, similar to Black Ops 1's One in the Chamber, but I don't seem to able to correctly find the player's correct held weapon and change it's contents, this is my method:
    Getting player held weapon:
    Code:
    BaseProjectile heldWeapon = hitinfo?.Weapon?.GetItem()?.GetHeldEntity() as BaseProjectile ?? null;
    Changing the contents:
    Code:
    heldWeapon.primaryMagazine.contents = (heldWeapon.primaryMagazine.capacity-(heldWeapon.primaryMagazine.capacity-1));
    Thanks in advance!
     
  2. Wow. First of all, you're doing it far too complexly. If you're just wanting to reduce the amount,
    Code:
    projectile.primaryMagazine.contents -= 1;
    should work, no need to do all that other stuff, just a simple int.

    If you want to change the max it can hold,
    Code:
    projectile.primaryMagazine.capacity = 1;
     
  3. Thank you for helping me keep my code clean and in a simple way, but I'm still having the issue where I can't change the held weapon's contents. I'm doing hooking it to OnPlayerAttack and checking if the projectile hit a player entity, if that happens the held weapon's content empties for 5 seconds and goes back to 1 again.
     
  4. Still not changing? Hmm... What do you mean by it's not letting you? Changing it to 1 just doesn't do anything, or what exactly? You say "the held weapon's content empties for 5 seconds and goes back to 1 again." Is this intended, or is this the issue? I'm just not sure I entirely understand.

    You may have to do
    Code:
    heldWeapon.SendNetworkUpdateImmediate();
    for it to take effect properly.
     
  5. The intended effect is for it to be empty for 5 seconds if the person does not hit a player, but the issue was that I wasn't even able to change the weapon's contents, will try your solution though.