InfiniteAmmo

Moved

Total Downloads: 4,448 - First Release: May 30, 2015 - Last Update: Jul 19, 2015

4.38889/5, 18 likes
  1. i ran the unmodified version on my server and it works fine. make sure you have done toggleammo. also, the gun you are using has to have at least 1 bullet in it for it to work.
    if you want to get rid of the warnings, open the cs file and replace any "infinite.ammo" with "infiniteammo.ammo".
    how the plugin works.. to get infinite ammo the player must type /toggleammo to turn infinite ammo on for themselves. to turn it off they would have to /toggleammo again. however, they can not toggle on or off unless they have the permission. once it is toggled on, they have infinite ammo.. even if the permission is removed. be aware of this. if this is a problem then please see Infinite Ammo | Page 9 | Oxide for my workaround. it makes it so you have to have it toggled on + have the permission.
     
  2. 1) Infinite ammunition can be reloaded from weapons in an infinite number!
    For example: I loaded 2 ammo, fired and the counter shows again 30.
    I pull out 28 and repeat the same thing. So players can recycle ammo and receive resources.
    If you will say: just block 556 ammo in inventory with other plugin, so then how to load turrets?
    2) If you are loaded high-velocity ammo to autokit, then after respawn you reload from weapon simple 556 ammo - why?
    3) Here, not only endless ammo, but endless rockets. Maybe you can make switch for ammo
    4) And please: the weapon does not break - make a breakdown switch
     
    Last edited by a moderator: Oct 4, 2017
  3. change this line
    Code:
                projectile.primaryMagazine.contents = projectile.primaryMagazine.capacity;
    to this
    Code:
                projectile.primaryMagazine.contents += 1;
    or maybe don't give infinite ammo to people if you don't want them to have infinite resources.

    i don't think this issue has anything to do with this plugin. infinite ammo doesn't touch the ammo type. what you are describing sounds more like an issue with kits. maybe check your kits data file to look at what exactly is in the autokit

    a switch could be added or you could remove one function to do that. i'd just remove the function if you don't plan on ever using it.

    Code:
            private void OnRocketLaunched(BasePlayer player)
            {
                if (!HasInfiniteAmmo(player) | !permission.UserHasPermission(player.userID.ToString(), "infiniteammo.ammo")) return;
                var weapon = player.GetActiveItem().GetHeldEntity() as BaseProjectile;
                if (weapon == null) return;
                player.GetActiveItem().condition = player.GetActiveItem().info.condition.max;
                if (weapon.primaryMagazine.contents > 0) return;
                weapon.primaryMagazine.contents = weapon.primaryMagazine.capacity;
                weapon.SendNetworkUpdateImmediate();
            }
    remove this line
    Code:
    projectile.GetItem().condition = projectile.GetItem().info.condition.max;
     
  4. Oh very big thanks, man, I think it will be useful for other admins
     
  5. I have seen someone ask this question but I didn't see a reply, Is it possible to make infinite ammo active without typing /toggleammo ?
     
  6. delete this line within onweaponfired.
    if (!HasInfiniteAmmo(player)) return;

    if you want infinite rockets and thrown weapons then you would remove all instances of that line.
     
  7. Hello, how to make a cartridge after the shot, the ammo immediately replenished?
     
  8. private void OnWeaponFired(BaseProjectile projectile, BasePlayer player)
    {
    projectile.GetItem().condition = projectile.GetItem().info.condition.max;
    if (projectile.primaryMagazine.contents > 30) return;
    projectile.primaryMagazine.contents = 30;
    projectile.SendNetworkUpdateImmediate();
    }
     
  9. wher do i find this??? anyone an idea???
     
  10. Wulf

    Wulf Community Admin

    Ctrl+F in a program such as Notepad or Notepad++.
     
  11. in the cs file? i already searched it but can not find exactly "infinite"
    [DOUBLEPOST=1516673289][/DOUBLEPOST]@Wulf can you maybe send me the right one? i am to dumb for this :(
     
  12. can anyone help me please?
     
  13. does this still work
     
  14. works perfectly, well guys you gotta look in the (manual)code to understand how to use/activate it.
    I guess its a "anti noob" protection
     
  15. Is there a way to make it auto-enable and to disable the no reload?
     
  16. Wulf

    Wulf Community Admin

    When would you want it to automatically enable and how? Having no reload would be an entirely different concept, basically just giving the player ammo instead.
     
  17. Automattically enable when a player joins so they don't have to I co own a small Battlefield server. Just wondering how to do it if there is a way?
     
  18. Wulf

    Wulf Community Admin

    I think there is a plugin for automatically running a command when a player connects, but for the 2nd the plugin would need changes. If you want it to be enabled by default automatically, that would require some changes too.

    Automatic Client Commands
     
  19. Thank you!
     
  20. Hey, I'm trying to make it so you have to reload with infinite ammo. I think reloading has something to do with this code on the file. Could you show me how to make it so I have infinite ammo with reload without bullets in my inventory?
    Code:
            private void OnWeaponFired(BaseProjectile projectile, BasePlayer player)
            {
                if (!HasInfiniteAmmo(player)) return;
                projectile.GetItem().condition = projectile.GetItem().info.condition.max;
                if (projectile.primaryMagazine.contents > 0) return;
                projectile.primaryMagazine.contents = projectile.primaryMagazine.capacity;
                projectile.SendNetworkUpdateImmediate();
            }  
    Thank you!