CTakeDamageInfo.SetDamage
From GMod Wiki
Function | |
Syntax | DamageInfo:SetDamage( Integer damage ) |
Description: | |
Sets (overrides) the damage in a DamageInfo. | |
Returns: | nil |
In Object: | Damage |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.SetDamage]CTakeDamageInfo.SetDamage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | This makes players take no damage from NPCs. |
---|---|
Used on | |
Code | function GM:ScalePlayerDamage(ply,hitgroup,dmginfo) if dmginfo:GetAttacker():IsNPC() then dmginfo:SetDamage (0) end end |
Output | N/A |