AddCSLuaFile( "cl_init.lua" )
AddCSLuaFile( "shared.lua" )
include( 'shared.lua' )

function ENT:SpawnFunction( ply, tr )
	if ( !tr.Hit ) then return end
		local SpawnPos = tr.HitPos+Vector(0,0,15)
		local ent = ents.Create( "sent_chute" )
			ent:SetPos( SpawnPos )
			ent:Spawn()
			ent:Activate()
			ent.Owner=ply
	return ent
end

function ENT:Initialize()

	local selfent = self.Entity
	
	self.Entity:SetModel("models/props_lab/filecabinet02.mdl")
	self.Entity:PhysicsInit( SOLID_VPHYSICS )
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
	self.Entity:SetSolid( SOLID_VPHYSICS )

	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end	
end

function ENT:Use(ply, acc)
	ply.HasChute=true
	self.Entity:Remove()
	ply:EmitSound(Sound("npc/combine_soldier/zipline_clip1.wav"),100,100)
end
