Garry's Mod Wiki

GM:PlayerDisconnected

GM:PlayerDisconnected( Player ply )

Description

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

Player:SteamID, Player:SteamID64, and the like can return nil here.
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

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

Page Links


Special Pages


Wikis

?

Render Time: 91ms

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