CTakeDamageInfo
From GMod Wiki
"CTakeDamageInfo" is a class describing damage to be applied, or being applied to an entity.
Object Methods
CTakeDamageInfo:__index
CTakeDamageInfo:AddDamage
CTakeDamageInfo:GetAmmoType
CTakeDamageInfo:GetAttacker
CTakeDamageInfo:GetBaseDamage
CTakeDamageInfo:GetDamage
CTakeDamageInfo:GetDamageForce
CTakeDamageInfo:GetDamagePosition
CTakeDamageInfo:GetDamageType
CTakeDamageInfo:GetInflictor
CTakeDamageInfo:GetMaxDamage
CTakeDamageInfo:GetReportedPosition
CTakeDamageInfo:IsBulletDamage
CTakeDamageInfo:IsDamageType
CTakeDamageInfo:IsExplosionDamage
CTakeDamageInfo:IsFallDamage
CTakeDamageInfo:ScaleDamage
CTakeDamageInfo:SetAttacker
CTakeDamageInfo:SetDamage
CTakeDamageInfo:SetDamageForce
CTakeDamageInfo:SetDamagePosition
CTakeDamageInfo:SetDamageType
CTakeDamageInfo:SetInflictor
CTakeDamageInfo:SetMaxDamage
CTakeDamageInfo:SubtractDamage
Additional Notes
| CTakeDamageInfo.AddDamage | Adds Damage to the current damage amount |
| CTakeDamageInfo.GetMaxDamage | Returns the maximum damage possible.*** |
| CTakeDamageInfo.GetAttacker | Returns the attacker |
| CTakeDamageInfo.GetDamage | Returns the current damage amount |
| CTakeDamageInfo.GetReportedPosition | Where is the bullet hitpos.* ** |
| CTakeDamageInfo.GetDamageForce | Returns the force that the bullet (or whatever) has. |
| CTakeDamageInfo.GetDamagePosition | Origin of the damage |
| CTakeDamageInfo.GetInflictor | Returns the Inflictor, in most cases the Attacker. |
| CTakeDamageInfo.GetDamageType | Returns the damage type as a Damagetype Enum. |
| CTakeDamageInfo.GetBaseDamage | Gets the base damage. Appears to return the same value as GetDamage. |
| CTakeDamageInfo.GetAmmoType | Returns the ammo type that did it |
| CTakeDamageInfo.IsExplosionDamage | Returns true if an explosion did it |
| CTakeDamageInfo.IsFallDamage | Returns true if a fall did it |
| CTakeDamageInfo.IsBulletDamage | Returns true if a bullet did it |
| CTakeDamageInfo.IsDamageType | Returns true if the specified damagetype enum did it |
| CTakeDamageInfo.ScaleDamage | Scales the damage by the number given |
| CTakeDamageInfo.SetDamagePosition | Set the position returned by GetDamagePosition |
| CTakeDamageInfo.SetMaxDamage | Set the maximum damage |
| CTakeDamageInfo.SetDamageType | Set the damage type |
| CTakeDamageInfo.SetDamageForce | Set the damage force |
| CTakeDamageInfo.SetInflictor | Set the inflictor |
| CTakeDamageInfo.SetAttacker | Set the attacker |
| CTakeDamageInfo.SetDamage | Set the damage amount |
| CTakeDamageInfo.SubtractDamage | Remove this much damage from the damage amount |
* Seems to be broken.
** For HL2 grenades this returns the position of the player who threw the grenade.
*** This will return max damage based on distance - In otherwords, the further you walk away, the less damage you take - Imagine point_hurt