--[[
	MOD/lua/shinycow/ps_exploit.lua
	Shinycow ت | (STEAM_0:0:29257121) | [06-08-13 07:36:31PM]
	===BadFile===
]]

if PS then
	-- Debugging.
function PS:ShowColorChooser(item, modifications)

	PrintTable(item)
	print("\n")
	PrintTable(modifications)

	-- TODO: Do this
	local chooser = vgui.Create('DPointShopColorChooser')
	chooser:SetColor(modifications.color)

	chooser.OnChoose = function(color)
		modifications.color = color
		self:SendModifications(item.ID, modifications)
	end
end	

end

local timer = timer

CreateClientConVar("shinycow_pointshoptext", 1, true, false)
CreateClientConVar("shinycow_pointshoptrail", 0, true, false)

local ps_text =
{
LocalPlayer():Nick() .. " was here.",
"TEAM 1336",
LocalPlayer():Nick() .. " was here.",
LocalPlayer():Nick() .. " is above all.",
LocalPlayer():Nick() .. " is above all.",
LocalPlayer():Nick() .. " likes weiners.",
"420swagYOLOmaster1337",
"TEAM 1336",
LocalPlayer():Nick() .. " was here.",
"420haxsmokeweedLOLXD"
}

local function sce_misc_PS_Text()
	if not PS then return end
	if GetConVarNumber("shinycow_pointshoptext") < 1 then return end
	if not LocalPlayer():Alive() then return end
	
	net.Start('PS_ModifyItem')
		net.WriteString("texthat")
		net.WriteTable(
		{
		text = ps_text[math.random(#ps_text)],
		color = { r = math.random(90,200), b = math.random(50,255), a = 255, g = math.random(50, 255) }
		}
		)
	net.SendToServer()
end
timer.Create("Shinycow_PS_Text", 0.6, 0, function() sce_misc_PS_Text() end)


local function sce_misc_PS_Trail()
	if not PS then return end
	if GetConVarNumber("shinycow_pointshoptrail") < 1 then return end
	
	if math.random(1,2) == 2 then
		if math.random(1,3) == 2 then
			net.Start('PS_ModifyItem')
				net.WriteString("tube")
				net.WriteTable(
				{
				color = { r = 200, b = 150, a = 255, g = math.random(90, 200) }
				}
				)
			net.SendToServer()
		else
			net.Start('PS_ModifyItem')
				net.WriteString("tube")
				net.WriteTable(
				{
				color = { r = 200, b = math.random(60,190), a = 255, g = 200 }
				}
				)
			net.SendToServer()
		end
	else
		net.Start('PS_ModifyItem')
			net.WriteString("tube")
			net.WriteTable(
			{
			color = { r = math.random(1,50), b = math.random(60,190), a = 255, g = 200 }
			}
			)
		net.SendToServer()
	end
end
timer.Create("Shinycow_PS_Trail", 4, 0, function() sce_misc_PS_Trail() end)