{"title":"GM:DoPlayerDeath","wikiName":"Garry\u0027s Mod Wiki","wikiIcon":"https://files.facepunch.com/garry/822e60dc-c931-43e4-800f-cbe010b3d4cc.png","wikiUrl":"gmod","tags":"event member realm-server","address":"GM:DoPlayerDeath","createdTime":"2020-01-21T17:09:42.8+00:00","updateCount":8,"markup":"\u003Cfunction name=\u0022DoPlayerDeath\u0022 parent=\u0022GM\u0022 type=\u0022hook\u0022\u003E\r\n\t\u003Cdescription\u003E\r\nHandles the player\u0027s death.\r\n\r\nThis hook is **not** called if the player is killed by \u003Cpage\u003EPlayer:KillSilent\u003C/page\u003E. See \u003Cpage\u003EGM:PlayerSilentDeath\u003C/page\u003E for that.\r\n\r\n* \u003Cpage\u003EGM:PlayerDeath\u003C/page\u003E is called after this hook\r\n* \u003Cpage\u003EGM:PostPlayerDeath\u003C/page\u003E is called after that\r\n\r\n\u003Cnote\u003E\u003Cpage\u003EPlayer:Alive\u003C/page\u003E will return false in this hook.\u003C/note\u003E\r\n\r\n\t\u003C/description\u003E\r\n\t\u003Crealm\u003EServer\u003C/realm\u003E\r\n\t\u003Cfile line=\u002239-L57\u0022\u003Egamemodes/base/gamemode/init.lua\u003C/file\u003E\r\n\t\u003Cargs\u003E\r\n\t\t\u003Carg name=\u0022ply\u0022 type=\u0022Player\u0022\u003EThe player\u003C/arg\u003E\r\n\t\t\u003Carg name=\u0022attacker\u0022 type=\u0022Entity\u0022\u003EThe entity that killed the player\u003C/arg\u003E\r\n\t\t\u003Carg name=\u0022dmg\u0022 type=\u0022CTakeDamageInfo\u0022\u003EDamage info\u003C/arg\u003E\r\n\t\u003C/args\u003E\r\n\u003C/function\u003E\r\n\r\n","html":"\u003Cdiv class=\u0022function hook realm-server\u0022\u003E\r\n\u003Cdiv class=\u0022function_line\u0022\u003E\u003Ca href=\u0022/gmod/States\u0022 class=\u0022realm_icon\u0022 title=\u0022This function is available in server state(s)\u0022\u003E\u0026nbsp;\u003C/a\u003E \u003Ca class=\u0022subject\u0022 href=\u0022/gmod/GM_Hooks\u0022\u003EGM\u003C/a\u003E:DoPlayerDeath( \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/Player\u0022\u003EPlayer\u003C/a\u003E ply,  \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/Entity\u0022\u003EEntity\u003C/a\u003E attacker,  \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/CTakeDamageInfo\u0022\u003ECTakeDamageInfo\u003C/a\u003E dmg )\u003C/div\u003E\u003Cdiv class=\u0022function_links\u0022\u003E\r\n\u003Ca href=\u0022https://github.com/Facepunch/garrysmod/blob/master/garrysmod/gamemodes/base/gamemode/init.lua#L39-L57\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022mdi mdi-source-branch\u0022\u003E\u003C/i\u003E View Source\u003C/a\u003E\r\n\u003Ca href=\u0022https://github.com/Facepunch/garrysmod/search?utf8=%E2%9C%93\u0026q=GM:DoPlayerDeath\u0022 target=\u0022_blank\u0022\u003E\u003Ci class=\u0022mdi mdi-github-box\u0022\u003E\u003C/i\u003E Search Github\u003C/a\u003E\r\n\u003C/div\u003E\r\n\u003Ch1\u003EDescription\u003Ca class=\u0022anchor\u0022 href=\u0022#description\u0022\u003E\u003Ci class=\u0022mdi mdi-link-variant\u0022\u003E\u003C/i\u003E\u003C/a\u003E\u003Ca name=\u0022description\u0022 class=\u0022anchor_offset\u0022\u003E\u003C/a\u003E\u003C/h1\u003E\r\n\u003Cdiv class=\u0022description_section function_description section\u0022\u003E\u003Cp\u003EHandles the player\u0027s death.\u003C/p\u003E\n\u003Cp\u003EThis hook is \u003Cstrong\u003Enot\u003C/strong\u003E called if the player is killed by \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/Player:KillSilent\u0022\u003EPlayer:KillSilent\u003C/a\u003E. See \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/GM:PlayerSilentDeath\u0022\u003EGM:PlayerSilentDeath\u003C/a\u003E for that.\u003C/p\u003E\n\u003Cul\u003E\n\u003Cli\u003E\u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/GM:PlayerDeath\u0022\u003EGM:PlayerDeath\u003C/a\u003E is called after this hook\u003C/li\u003E\n\u003Cli\u003E\u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/GM:PostPlayerDeath\u0022\u003EGM:PostPlayerDeath\u003C/a\u003E is called after that\u003C/li\u003E\n\u003C/ul\u003E\n\u003Cdiv class=\u0022note\u0022\u003E\u003Cdiv class=\u0022inner\u0022\u003E\u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/Player:Alive\u0022\u003EPlayer:Alive\u003C/a\u003E will return false in this hook.\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003Ch1\u003EArguments\u003Ca class=\u0022anchor\u0022 href=\u0022#arguments\u0022\u003E\u003Ci class=\u0022mdi mdi-link-variant\u0022\u003E\u003C/i\u003E\u003C/a\u003E\u003Ca name=\u0022arguments\u0022 class=\u0022anchor_offset\u0022\u003E\u003C/a\u003E\u003C/h1\u003E\r\n\u003Cdiv class=\u0022function_arguments section\u0022\u003E\u003Cdiv\u003E\u003Cspan class=\u0022numbertag\u0022\u003E1\u003C/span\u003E \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/Player\u0022\u003EPlayer\u003C/a\u003E \u003Cspan class=\u0022name\u0022\u003Eply\u003C/span\u003E\u003Cdiv class=\u0022numbertagindent\u0022\u003EThe player\u003C/div\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Cspan class=\u0022numbertag\u0022\u003E2\u003C/span\u003E \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/Entity\u0022\u003EEntity\u003C/a\u003E \u003Cspan class=\u0022name\u0022\u003Eattacker\u003C/span\u003E\u003Cdiv class=\u0022numbertagindent\u0022\u003EThe entity that killed the player\u003C/div\u003E\u003C/div\u003E\u003Cdiv\u003E\u003Cspan class=\u0022numbertag\u0022\u003E3\u003C/span\u003E \u003Ca class=\u0022link-page exists\u0022 href=\u0022/gmod/CTakeDamageInfo\u0022\u003ECTakeDamageInfo\u003C/a\u003E \u003Cspan class=\u0022name\u0022\u003Edmg\u003C/span\u003E\u003Cdiv class=\u0022numbertagindent\u0022\u003EDamage info\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E\u003C/div\u003E","footer":"Page views: 50,476\u003Cbr\u003EUpdated: A Long Time Ago","revisionId":563698,"pageLinks":[{"url":"/gmod/GM:DoPlayerDeath","label":"View","icon":"file","description":""},{"url":"/gmod/GM:DoPlayerDeath~edit","label":"Edit","icon":"pencil","description":""},{"url":"/gmod/GM:DoPlayerDeath~history","label":"History","icon":"history","description":""}]}