logs.Register("Verbindungen", false, Color(255, 255, 0))

logs.AddHook("PlayerInitialSpawn", function(ply)
	timer.Simple(0, function()
		if !IsValid(ply) then return end
		logs.Log("Verbindungen", ply:NameID().." ist dem Server beigetreten", {
			["Name"] = ply:Name(),
			["SteamID"]	= ply:SteamID()
		})
	end)
end)

gameevent.Listen("player_disconnect")
logs.AddHook("player_disconnect", function(data)
	local ply = Player(data.userid)
	if !IsValid(ply) then return end
	local reason = data.reason
	if string.find(reason, "YOU ARE BANNED FROM THIS SERVER!") then
		reason = "Banned by admin."
	end
	logs.Log("Verbindungen", ply:NameID().." hat die Verbindung getrennt. Grund: "..reason, {
		["Name"] = ply:Name(),
		["SteamID"]	= ply:SteamID()
	})
end)