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 + tr.HitNormal * 16 local ent = ents.Create( "sent_loudspeaker" ) ent:SetPos( SpawnPos ) ent:Spawn() ent:Activate() return ent end /*--------------------------------------------------------- Name: Initialize ---------------------------------------------------------*/ function ENT:Initialize() self.Entity:SetModel( "models/props_wasteland/speakercluster01a.mdl" ) self.Entity:PhysicsInit(SOLID_VPHYSICS) self.Entity:SetMoveType(MOVETYPE_VPHYSICS) self.Entity:SetSolid(SOLID_VPHYSICS) timer.Simple(self.time, self:Broadcast) end function ENT:OnTakeDamage( dmginfo ) self.Entity:TakePhysicsDamage( dmginfo ) end function ENT:Broadcast() timer.Simple(self.time, self:Broadcast) local find = ents.FindInSphere(self.Entity:GetPos(), self.radius) for k,v in pairs(find) do if v:IsPlayer() then v:PrintMessage(HUD_PRINTCHAT, self.text) end end end