Garry's Mod Wiki

GM:PlayerShouldTakeDamage

boolean GM:PlayerShouldTakeDamage( Player ply, Entity attacker )

Description

Returns true if the player should take damage from the given attacker.

Arguments

1 Player ply
The player
2 Entity attacker
The attacker

Returns

1 boolean
Allow damage

Example

Block damages between two players on the same team.

hook.Add( "PlayerShouldTakeDamage", "AntiTeamkill", function( ply, attacker ) return ply:Team() != attacker:Team() -- that will return false if attacker and ply is on the same team. end )

Page Links


Special Pages


Wikis

?

Render Time: 32ms

DB GetPage 4
Generate Html 4
SaveChanges (1) 10
Render Body 0
Render Sidebar 12