GM:PlayerHurt

From Garry's Mod
Jump to: navigation, search
 GM:PlayerHurt( )

Contents

Description

Called when a player gets hurt.

Arguments

Player victim

Victim

Arguments

Entity attacker

Attacker Entity

Arguments

number healthRemaining

Remaining Health

Arguments

number damageTaken

Damage Taken

Examples

Example

Show players attacker in Chat.

function GM:PlayerHurt(victim, attacker)
    if ( attacker:IsPlayer() ) then
        victim:ChatPrint("You were attacked by : " .. attacker:Nick())
    end
end


Personal tools
Navigation