if not CLIENT then return false end -- Clientside only :)

--[[
made by:
 ____ _______                    _
|  __|__   __|_  _ __   ____  __| |
 \ \    | |/ _ \| '_ \ / __ )/ _` |
 _\ \   | | (_) | | | | (___| (_| |
|____|  |_|\___/|_| |_|\__,_)\__,_|

]]

Xmas = {}
Xmas.Players = {}
local enabled = CreateClientConVar("xmas_enabled",1,true,false)

function Xmas.Trace()
	local trace = LocalPlayer():GetEyeTraceNoCursor()
	local ent = trace.Entity
	if ent:IsValid() and ent:IsPlayer() then
		return true, ent
	else
		return false
	end
end

function Xmas.Think()
	local bool, ent = Xmas.Trace()
	if bool and ent and enabled:GetBool() and !table.HasValue(Xmas.Players,ent)then
		Xmas.Players[#Xmas.Players + 1] = ent
		RunConsoleCommand("say","Happy X-Mas "..ent:Name())
	end
end
hook.Add("Think","Happy X-Mas!",Xmas.Think)