CTakeDamageInfo.GetAttacker

From GMod Wiki

Jump to: navigation, search
Function
Syntax CTakeDamageInfo:GetAttacker( )
Description:
Returns the object of the attacker entity.
Returns: Entity attacker
In Object: CTakeDamageInfo
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=CTakeDamageInfo.GetAttacker]CTakeDamageInfo.GetAttacker [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionThis informs players when they hit stuff.
Used onNewerServer.png
Code
function GM:ScalePlayerDamage(ply,hitgroup,dmginfo)
   if dmginfo:GetAttacker():IsPlayer() then
      dmginfo:GetAttacker():PrintMessage (3, "You hit "..ply:Name().." for "..dmginfo:GetDamage().." damage!\n")
   end
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox