HolyLib Wiki

Disconnect

  boolean HolyLib.Disconnect( Player ply, string reason, boolean silent = false, boolean nogameevent = false )

Description

Disconnects the given player from the server.

Unlike Gmod's version which internally calls the kickid command,
we directly call the Disconnect function with no delay.

Arguments

1Player ply
the player to disconnect, can be a userid/number
2string reason
the reason to disconnect the client with
3boolean silent = false
if true it will silently close the net channel and sends no disconnect to the client
4boolean nogameevent = false
if true it will stop the player_disconnect gameevent from being created

Returns

1boolean success
returns true if it succeeded in disconnecting the client