CTakeDamageInfo.SetDamage

From GMod Wiki

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