CTakeDamageInfo.SetDamage

From GMod Wiki

Revision as of 12:45, 31 December 2010 by Cube334 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax DamageInfo:SetDamage( Integer damage )
Description:
Sets (overrides) the damage in a DamageInfo.
Returns: nil
In Object: Damage
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.SetDamage]CTakeDamageInfo.SetDamage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis makes players take no damage from NPCs.
Used onNewerServer.png
Code
function GM:ScalePlayerDamage(ply,hitgroup,dmginfo)
   if dmginfo:GetAttacker():IsNPC() then
      dmginfo:SetDamage (0)
   end
end
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox