SHARE
TWEET

Untitled

a guest Jul 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (SERVER) then
  2. function SCHEMA:startCCTV( ply )
  3.     for k,v in pairs(ents.FindByClass("nut_security_campanel")) do
  4.         if ply:GetPos():Distance(v:GetPos()) <= self.cctvDistance then
  5.             netstream.Start(ply, "cctvStart")
  6.             return
  7.         end
  8.     end
  9.     nut.util.Notify("You must be within "..self.cctvDistance.." units of a CCTV Prompt!", ply)
  10. end
  11.  
  12. if (SERVER) then
  13.     function SCHEMA:saveSecurityCameraPanel()
  14.         local data = {}
  15.  
  16.         for k, v in ipairs(ents.FindByClass("nut_security_campanel")) do
  17.             data[#data + 1] = {v:GetPos(), v:GetAngles()}
  18.         end
  19.  
  20.         nut.data.set("securitycampanel", data)
  21.     end
  22.  
  23.  
  24. if (SERVER) then
  25.     function SCHEMA:saveSecurityCamera()
  26.         local data = {}
  27.  
  28.         for k, v in ipairs(ents.FindByClass("nut_security_cam")) do
  29.             data[#data + 1] = {v:GetPos(), v:GetAngles()}
  30.         end
  31.  
  32.         nut.data.set("securitycam", data)
  33.     end
  34.  
  35.  
  36.     function SCHEMA:loadSecurityCameraPanel()
  37.         local data = nut.data.get("securitycampanel") or {}
  38.  
  39.         for k, v in ipairs(data) do
  40.             local entity = ents.Create("nut_security_campanel")
  41.             entity:SetPos(v[1])
  42.             entity:SetAngles(v[2])
  43.             entity:Spawn()
  44.         end
  45.     end
  46.  
  47.     function SCHEMA:loadSecurityCamera()
  48.         local data = nut.data.get("securitycam") or {}
  49.  
  50.         for k, v in ipairs(data) do
  51.             local entity = ents.Create("nut_security_cam")
  52.             entity:SetPos(v[1])
  53.             entity:SetAngles(v[2])
  54.             entity:Spawn()
  55.         end
  56.     end
  57. end
  58. end
  59. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top