server_addban
Description
Called when a Player is banned using Player:Ban, banip or the banid command.
If banip was used the networkid will be an empty string.
If banid was used the ip will be an empty string.
If banid was used the ip will be an empty string.
Parameters
Examples
Example
This is a basic template with the purpose of including all arguments / table variables to make it easily known which values can be accessed.
gameevent.Listen( "server_addban" )
hook.Add( "server_addban", "server_addban_example", function( data )
local name = data.name // Same as Player:Nick()
local steamid = data.networkid // Same as Player:SteamID()
local id = data.userid // Same as Player:UserID()
local ip = data.ip // Same as Player:IPAddress()
local duration = data.duration // The Duration of the Ban (in minutes).
local by = data.by // The Person who banned the Player. Can be Console.
local kicked = data.kicked // If the player was kicked or not.
// Called when a Player is banned.
end )