• Custom Ammo Handling Script BETA
    4 replies, posted
  • Avatar of ReignofTerr0r
  • 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. [U][B]What does it do? [/B][/U] 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. [B][U]Instructions[/U][/B] To create a new ammo type, all you need to do is this: [CODE]// --------------------------------------------------------------------------------------------- // 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") // ---------------------------------------------------------------------------------------------[/CODE] There are long descriptions of each usable function in the actual script so take a look. [B][U]Current Bugs [/U][/B][B]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.[/B] 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. [B][U]Change-log [/U][/B] 1.1 - Fixed player:Give("class") not returning the entity given. 1.0 - First Release [B][U]Download[/U][/B] [B]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. [URL="http://adf.ly/8NgYp"]Ad-Supported Download Link[/URL] (Makes me money [/B]:dance:[B]) [/B]- [URL="http://xisles.net/ReignofTerr0rScripts/CustomAmmoHandling_1.1Beta.zip"]Direct Link[/URL] (Doesn't make me money) If you are prompted for a username and password, they are both "facepunchpublic". [B][U]Donations [/U]If this script really helped you, why not show your support and make a small donation? [/B]:wink: [URL="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QJGLFU3488HG6"][IMG]https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif[/IMG][/URL] [B][/B]
  • Avatar of ReignofTerr0r
  • [QUOTE=KillerLUA;35905540]Nice, great first release but the dl link requires a password?[/QUOTE] It makes people actually read the post, haha.
  • Avatar of mac338
  • -snip- [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. (?)