HEALINGPADMODEL = "models/props_combine/health_charger001.mdl"
_EntPrecacheModel(HEALINGPADMODEL)
HEALINGPADPRICE = 200

function CreateHealPad(userid)
	PlayerLookTrace(userid, 300)
	local prop = _EntCreate("prop_physics")
	if prop > 0 then
		_EntSetKeyValue(prop, "model", HEALINGPADMODEL)
		_EntSetPos(prop, vecAdd(_TraceEndPos(), vector3(0,0,70)))
		_EntSpawn(prop)
		_EntSetName(prop, "unfrozenprop")
		_EntSetMaterial(prop, "gmod/wireframe")
		local n = _PlayerInfo(userid, "team")
		PhysProps[prop] = {}
		PhysProps[prop].Owner = userid
		PhysProps[prop].Team = n
		teams[n].props = teams[n].props+1
		_EntFire(prop, "color", teams[n].color.r.." "..teams[n].color.g.." "..teams[n].color.b, 0)
	end
end

function Doheal(userid)
	if _PlayerInfo(userid, "alive") and _PlayerInfo(userid, "health") < _EntGetMaxHealth(userid) then
		_PlayerSetHealth(userid, _PlayerInfo(userid, "health")+3)
		_PlaySoundPlayer(userid, "common/bugreporter_succeeded.wav")
		if _PlayerInfo(userid, "health") > _EntGetMaxHealth(userid) then
			_PlayerSetHealth(userid, _EntGetMaxHealth(userid))
		end
	end
end
