CTakeDamageInfo.GetInflictor

From GMod Wiki

Jump to: navigation, search
Function
Syntax CTakeDamageInfo:GetInflictor( )
Description:
Returns the object of the inflictor entity (e.g. the weapon a player used to shoot someone).
Returns: Entity inflictor
In Object: CTakeDamageInfo
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.GetInflictor]CTakeDamageInfo.GetInflictor [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis tells players what they are getting shot with.
Used onNewerServer.png
Code
function GM:ScalePlayerDamage(ply,hitgroup,dmginfo)
   ply:PrintMessage (3, "You were hit by a "..dmginfo:GetInflictor():GetClass().."\n")
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox