Advertisement
szymski

Untitled

Oct 26th, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.78 KB | None | 0 0
  1. hook.Add("Tick","SAreas_Tick",function()
  2.     for _,v in pairs(SAREAS.Areas) do
  3.         local ents = ents.FindInBox(v[1]-v[2]/2-Vector(0,0,99999999), v[1]+v[2]/2+Vector(0,0,99999999))
  4.         for __,ent in pairs(ents) do
  5.             --if(ent:IsPlayer() and IsAreaOwner(ent, _) == false) then ent:Kill() end
  6.             if CPPI then
  7.                 local owner = ent:CPPIGetOwner() or ent:GetOwner() or Entity(0)
  8.                 if(IsAreaOwner(owner, _) == false and (ent:GetClass() == "prop_physics" or ent:GetClass() == "prop_static" or ent:IsNPC() or ent:IsVehicle())) then ent:Remove() end
  9.             else
  10.                 local owner = ent:GetOwner() or Entity(0)
  11.                 if(IsAreaOwner(owner, _) == false and (ent:GetClass() == "prop_physics" or ent:GetClass() == "prop_static" or ent:IsNPC() or ent:IsVehicle())) then ent:Remove() end
  12.             end
  13.         end
  14.     end
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement