game.AddAmmoType

From Garry's Mod
Jump to: navigation, search
 game.AddAmmoType( )

Contents

Description

Adds a new ammo type to the game.

You can find a list of default ammo types here.

WARNING

This function must be called shared or you will have unexpected problems.

NOTE

This function must be called in GM:Initialize.

NOTE

There is a limit of 128 ammo types, including the default ones.

BUG

This will have unpredictable results when registering ammo types with the same name but different capitalisation.

Pull Request: #1487

Arguments

table ammoData

The attributes of the ammo. See the AmmoData structure.

Examples

Example

Add an ammo type

game.AddAmmoType({
	name = "ammo_9mm_max",
	dmgtype = DMG_BULLET,
	tracer = TRACER_LINE,
	plydmg = 0,
	npcdmg = 0,
	force = 2000,
	minsplash = 10,
	maxsplash = 5
})


Personal tools
Navigation