Gamemode.PlayerDeath

From GMod Wiki

(Redirected from PlayerDeath)
Jump to: navigation, search
Event Hook
Hook NamePlayerDeath
SyntaxGM:PlayerDeath( Player Victim, Entity Inflictor, Player Killer )
DescriptionCalled whenever a player dies.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.PlayerDeath]Gamemode.PlayerDeath [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints the message "player <playername> has died." into the console of the server
Used onNewerServer.png
Code
function playerDies( victim, weapon, killer )
 
	Msg( "Player " .. victim:GetName() .. " has died.\n" )
end
 
hook.Add( "PlayerDeath", "playerDeathTest", playerDies )
OutputN/A


Additional Notes

See Also


Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox