CTakeDamageInfo/SetAmmoType

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Added)
 
(Added an example)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 
{{Func
 
{{Func
|Description=
+
|Description=Changes the ammo type used by the weapon that inflicted the damage.
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes
Line 7: Line 7:
 
|type=number
 
|type=number
 
|name=ammoType
 
|name=ammoType
|desc=
+
|desc=Ammo type ID
 +
}}
 +
{{Example
 +
|Description=Creates a new DamageInfo object and sets the ammo that caused the damage to AR2 ammo
 +
|Code=local dmginfo = DamageInfo()
 +
 
 +
dmginfo:SetAmmoType( game.GetAmmoID( 'AR2' ) )
 
}}
 
}}

Latest revision as of 02:50, 13 March 2016

 CTakeDamageInfo:SetAmmoType( )

Contents

Description

Changes the ammo type used by the weapon that inflicted the damage.

Arguments

number ammoType

Ammo type ID

Examples

Example

Creates a new DamageInfo object and sets the ammo that caused the damage to AR2 ammo

local dmginfo = DamageInfo()

dmginfo:SetAmmoType( game.GetAmmoID( 'AR2' ) )


Personal tools
Navigation