Garry's Mod Wiki

Garry's Mod Wiki

  GM:PlayerDisconnected( Player ply )

Description

Called when a player leaves the server. See the player_disconnect gameevent for a shared version of this hook.

This is not called in single-player or listen servers for the host.

Issue Tracker: 3523

Arguments

1 Player ply
the player

Example

Print a message to the chatbox upon player disconnect

hook.Add( "PlayerDisconnected", "Playerleave", function(ply) PrintMessage( HUD_PRINTTALK, ply:Name().. " has left the server. " ) end )
Output: Player1 has left the server.

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...