TELEPORTPADMODEL = "models/props_lab/teleplatform.mdl"
TELEPORTPADPRICE = 250
_EntPrecacheModel(TELEPORTPADMODEL)
TeleportPads = {}

function CreateTeleportPad(userid)
	PlayerLookTrace(userid, 300)
	local ents = {}
	for i=1, 2 do
		local prop = _EntCreate("prop_physics")
		if prop > 0 then
			_EntSetModel(prop, TELEPORTPADMODEL)
			_EntSetPos(prop, vecAdd(_TraceEndPos(), vector3(0,0,46+(i*32))))
			_EntSpawn(prop)
			_EntSetName(prop, "unfrozenprop")
			_EntSetMaterial(prop, "gmod/wireframe")
			local n = _PlayerInfo(userid, "team")
			PhysProps[prop] = {}
			PhysProps[prop].Owner = userid
			PhysProps[prop].Team = n
			_EntFire(prop, "color", teams[n].color.r.." "..teams[n].color.g.." "..teams[n].color.b, 0)
			ents[table.getn(ents)+1] = prop
			teams[PhysProps[prop].Team].props = teams[PhysProps[prop].Team].props+1
			DrawCurrentTeamProps(userid)
		end
	end
	TeleportPads[ents[1]] = ents[2]
	TeleportPads[ents[2]] = ents[1]
end
