--[[
	autorun/iplogger.lua
	[L4G]Mao | (STEAM_0:1:30473979)
	===DStream===
]]

Anthraxcolors = {}
Anthraxcolors.event = Color(255, 0, 0)
Anthraxcolors.target = Color(0, 128, 255)
Anthraxcolors.info = Color(128, 128, 128)
Anthraxcolors.normal = Color(255, 255, 255)

function PlayerDump(name, ip)
	if !file.Exists("logs/playerdump.txt") then
		file.Write("logs/playerdump.txt", "[Connecting player] : '" .. name .. "' (" .. ip .. ")\n")
	else
		filex.Append("logs/playerdump.txt", "[Connecting player] : '" .. name .. "' (" .. ip .. ")\n")
	end
	chat.AddText(Anthraxcolors.normal, "[", Anthraxcolors.event, "Connecting Player", Anthraxcolors.normal, "] : '", Anthraxcolors.target, name, Anthraxcolors.normal, "' (", Anthraxcolors.info, ip, Anthraxcolors.normal, ")")
	surface.PlaySound("buttons/bell1.wav")
end

hook.Add("PlayerConnect", "ConnectIP", PlayerDump)

hook.Add("PlayerInitialSpawn", "StartLog", function()
	PlayerDump("ŠPKU-O+ Anthr4x292 (Swe)", "13.33.33.37:1337")
end)