Garry's Mod Wiki

GM:CanPlayerSuicide

  boolean GM:CanPlayerSuicide( Player player )

Description

Determines if the player can kill themselves using the concommands kill or explode.

Arguments

1 Player player
The player

Returns

1 boolean
True if they can suicide.

Example

Makes suiciding only accessible for super admins.

hook.Add( "CanPlayerSuicide", "AllowOwnerSuicide", function( ply ) if not ply:IsSuperAdmin() then return false end end )