CTakeDamageInfo.SetDamagePosition

From GMod Wiki

Jump to: navigation, search
Function
Syntax CTakeDamageInfo:SetDamagePosition( Vector position )
Where is this used?
Description:
Masks/Sets the position of where the Entity was damaged.
Returns: Nil
Part of Library: CTakeDamageInfo
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.SetDamagePosition]CTakeDamageInfo.SetDamagePosition [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


DescriptionMask the position to appear a bit higher.
Used onNewerServer.png
Code
 
local function EntityDamaged(ent, inflictor, attacker, dmginfo)
    dmginfo:SetDamagePosition(dmginfo:GetReportedPosition() + Vector(0, 0, 32))
end
 
hook.Add("EntityTakeDamage", "DamagePositionMask", EntityDamaged)
 
OutputCTakeDamageInfo.GetReportedPosition will now think it's 32 units higher up.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox