Author Topic: Most Up-to-date Ammo System Script?  (Read 5785 times)

For my gun that I am soon to release, I want to implement an ammo system with my reload animation. The gun has 2 animations: Reload and Fire. Could someone please post a ammo script and instructions on how to implement it into my gun. Please forgive my laziness and dumbness... Thank you!

BUMP!!!! The quicker this gets done, the quicker you guys get the gun and the updated G18!

The script I made for clip-based reloading (infinite reserve ammo) probably has the best example with Bushido's Tier+Tactical pack.


The script I made for clip-based reloading (infinite reserve ammo) probably has the best example with Bushido's Tier+Tactical pack.

Ok... I've previously looked through that but It confuses the heck outa me with references to the ammo everywhere :/ Could it be possible to just have it in one solid bit of code that i just need to insert somewere?

Ok... I've previously looked through that but It confuses the heck outa me with references to the ammo everywhere :/ Could it be possible to just have it in one solid bit of code that i just need to insert somewere?
if you want to insert that code into every single gun then sure

I don't know if it is already done this way, but has anyone considered defining a few generic ammo functions and then simply using those? .hasAmmo(%type) .useAmmo(%type) .addAmmo(%type) .depleteAmmo(%type), each with an optional number, defaulting to 1 if ommited, and returning the ammount of ammo actually used/added/removed?

Then, adding the condition of "must have ammo to fire" without a clip system, would be, in pseudocode,

ammoitem::onpickup
   %player.addAmmo(%type, %contents)

gunimage::onfire
    if(%player.useAmmo("gunshells"))
      parent::onfire
    else
      tellPlayer("Not enough ammo")

I don't know if it is already done this way, but has anyone considered defining a few generic ammo functions and then simply using those? .hasAmmo(%type) .useAmmo(%type) .addAmmo(%type) .depleteAmmo(%type), each with an optional number, defaulting to 1 if ommited, and returning the ammount of ammo actually used/added/removed?

Then, adding the condition of "must have ammo to fire" without a clip system, would be, in pseudocode,

ammoitem::onpickup
   %player.addAmmo(%type, %contents)

gunimage::onfire
    if(%player.useAmmo("gunshells"))
      parent::onfire
    else
      tellPlayer("Not enough ammo")


ok... sounds good, but im no scripter, ill need a confirmed and finished up-to-date ammo system

ok... sounds good, but im no scripter, ill need a confirmed and finished up-to-date ammo system
Space Guy's Is...

what about the CnS firearms reloading system?

I love auto glocks is it from gmod?

Auto glocks are NOT from Gmod-Automatic machine Pistols have been around longer than you think.

G18 for example-You CANNOT find that ANYWHERE in a civilian firearms store.

VEB-Machine Pistol-same thing.

BUMP!!!! The quicker this gets done, the quicker you guys get the gun and the updated G18!

what about the CnS firearms reloading system?

But I would also increase the amount of reserve ammo that one could hold


EX: Glock holds-30 rounds
Reserve ammo-150 rounds

It's only reasonable.

You should use spaceguy's ammo mod