Custom Ammo Handling Script BETA

Hello everyone on FacePunch! This marks my first ever LUA script release. I have been writing LUA for about 2 years now, and have been coding in other languages for much longer, but enough about me.

**What does it do?
This script simply does what the title says. It allows developers to create custom ammo types, rather that be restricted to ones the Source Engine has built in. The best part is, you don’t have to make any special changes in your gamemode/weapon/entity/etc. Everything should work as it should.


To create a new ammo type, all you need to do is this:

// ---------------------------------------------------------------------------------------------
// Description: Creates and activates the custom ammo type defined with the index of 'name'.
//                If 'languagename' is defined, then it creates a language definition for the
//                custom ammo type. WARNING! Gamemodes like Trouble in Terrorist Town DO NOT
//                use GMod's built in language.Add plugin. You will need to create the proper
//                language definitions for gamemodes if you want ammo names to show up properly.
//                This function NEEDS to be called in a shared lua file (eg; the shared.lua file
//                in a weapon script) or it won't work. Also, do not put any spaces, punctuation,
//                special characters, null characters, etc in the ammo name or it will cause an
//                error.
// Usage:        AMMO:CreateAmmoType(ammoid, name_you_see_when_picked_up)
// Example:        AMMO:CreateAmmoType("flare", "Flare Gun Cartridge")
// ---------------------------------------------------------------------------------------------

There are long descriptions of each usable function in the actual script so take a look.

**Current Bugs
**Please help me make this script better. If you are having problems/errors/etc, describe them and I’ll see what I can do. You aren’t helping if you post without describing the problem.

You don’t pick up ammo when you walk over a spawned weapon. (AKA gm_spawnswep) However, in TTT this does work because of the way it deals with ammo.

1.1 - Fixed player:Give(“class”) not returning the entity given.
1.0 - First Release

**As with most developers, I ask that you please do not re-upload, modify, repackage, duplicate, etc. without my permission. If you want to package it with your gamemode or addon, please contact me here on FacePunch or on Steam.

Ad-Supported Download Link (Makes me money :dance:) **- Direct Link (Doesn’t make me money)

If you are prompted for a username and password, they are both “facepunchpublic”.

If this script really helped you, why not show your support and make a small donation? **:wink:

Nice, great first release but the dl link requires a password?

This is awesome. Good work.

It makes people actually read the post, haha.


[editline]11th May 2012[/editline]

What the fuck, how the shit did my post end up in here? I was posting in Sensationalist Headlines and then suddenly a random thread in a section I never visit what the fuck

[editline]11th May 2012[/editline]

I guess Garry’s doing some weird sorcery or something. (?)