Garry's Mod Wiki

Player:Kick

  Player:Kick( string reason = "No reason given" )

Description

Kicks the player from the server.

This can not be run before the player has fully joined in. Use game.KickID for that.

Arguments

1 string reason = "No reason given"
Reason to show for disconnection.
This will be shortened to ~512 chars, though this includes the command itself and the player index so will realistically be more around ~498. It is recommended to avoid going near the limit to avoid truncation.

Example

Kick a player with reason "Goodbye"

Entity( 1 ):Kick( "Goodbye" )