
/*
    Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
    Version: v1.7.8 (stable)
*/

AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
ENT.AutomaticFrameAdvance = true 

function ENT:Initialize()
	self:SetModel( "models/props/sycreations/workstation.mdl" )
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	self:SetUseType(SIMPLE_USE)
	local RealisticPolicePhys = self:GetPhysicsObject()
    if IsValid(RealisticPolicePhys) then
	    RealisticPolicePhys:EnableMotion(false)
	    RealisticPolicePhys:Wake()
    end
end

function ENT:Use(activator)
    local job = Realistic_Police.GetPlayerJob(activator)
	if (job == "ФСБ  «Вымпел»" or Realistic_Police.HackerJob[job]) then 
		activator.AntiSpam = activator.AntiSpam or CurTime()
		if activator.AntiSpam > CurTime() then return end 
		activator.AntiSpam = CurTime() + 1 

		net.Start("RealisticPolice:Open")
			net.WriteString("OpenMainMenu")
			net.WriteEntity(self)
			net.WriteBool(false)
		net.Send(activator)
	else 
		Realistic_Police.SendNotify(activator, "Этот ПК только для сотрудников ФСБ!")
	end 
end 


