add sborka
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
-- 76561198219964944
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
local pos = self:GetPos()
|
||||
local ang = self:GetAngles()
|
||||
ang:RotateAroundAxis(ang:Up(), 0)
|
||||
ang:RotateAroundAxis(ang:Forward(), 85)
|
||||
if LocalPlayer():GetPos():DistToSqr(self:GetPos()) < 200 ^ 2 then
|
||||
cam.Start3D2D(pos + ang:Up()*0, Angle(0, LocalPlayer():EyeAngles().y-90, 90), 0.025)
|
||||
draw.SimpleTextOutlined(Realistic_Police.BailerName, "rpt_font_22", -50, -3000, Realistic_Police.Colors["white"] , TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 0, Realistic_Police.Colors["white"] );
|
||||
cam.End3D2D()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/Humans/Group01/Female_02.mdl")
|
||||
self:SetHullType(HULL_HUMAN)
|
||||
self:SetHullSizeNormal()
|
||||
self:SetNPCState(NPC_STATE_SCRIPT)
|
||||
self:SetSolid(SOLID_BBOX)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
end
|
||||
function ENT:Use(activator)
|
||||
if Realistic_Police.CheckJailPos() then
|
||||
RPTTableBailer = RPTTableBailer or {}
|
||||
for k ,v in pairs(RPTTableBailer) do
|
||||
if not IsValid(RPTTableBailer[k]["vEnt"]) or not timer.Exists("rpt_timerarrest"..RPTTableBailer[k]["vEnt"]:EntIndex()) then
|
||||
print(RPTTableBailer[k]["vEnt"])
|
||||
RPTTableBailer[k] = nil
|
||||
end
|
||||
end
|
||||
-- 76561198219964944
|
||||
|
||||
if #RPTTableBailer != 0 then
|
||||
net.Start("RealisticPolice:HandCuff")
|
||||
net.WriteString("Bailer")
|
||||
net.WriteTable(RPTTableBailer)
|
||||
net.Send(activator)
|
||||
else
|
||||
Realistic_Police.SendNotify(activator, Realistic_Police.GetSentence("noArrestedPlayer"))
|
||||
end
|
||||
else
|
||||
Realistic_Police.SendNotify(activator, Realistic_Police.GetSentence("noJailPositions"))
|
||||
end
|
||||
end
|
||||
function ENT:OnTakeDamage()
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_ai"
|
||||
ENT.Type = "ai"
|
||||
ENT.PrintName = "Bailer"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
-- 76561198219964944
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
-- d4ec95c252515613de193db925956fba07d4ff50f580a4b42b7f507f9c716945
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar( "Bool", 0, "RptCam" )
|
||||
self:NetworkVar( "String", 1, "RptRotate" )
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
-- 55698bd11dd4b187c328ffc9200a97bcc7d15bb56979457ac0aeb39001de0521
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
/*
|
||||
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
|
||||
ENT.Editable = true
|
||||
function ENT:Initialize()
|
||||
self:SetModel( "models/wasted/wasted_kobralost_camera.mdl" )
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
local RealisticPolicePhys = self:GetPhysicsObject()
|
||||
RealisticPolicePhys:EnableMotion(false)
|
||||
RealisticPolicePhys:EnableGravity(true)
|
||||
RealisticPolicePhys:Wake()
|
||||
self.HealthEntity = Realistic_Police.CameraHealth
|
||||
self.DestroyCam = false
|
||||
self.RotateBack = false
|
||||
self:SetRptRotate("nil")
|
||||
end
|
||||
function ENT:OnTakeDamage(dmg)
|
||||
self:TakePhysicsDamage(dmg)
|
||||
if(self.HealthEntity <= 0) then return end
|
||||
self.HealthEntity = self.HealthEntity - dmg:GetDamage()
|
||||
if(self.HealthEntity <= 0) then
|
||||
Realistic_Police.BrokeCamera(self)
|
||||
end
|
||||
end
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
function ENT:Think()
|
||||
if self:GetRptRotate() != "nil" then
|
||||
if self:GetRptRotate() == "Left" then
|
||||
if not isnumber(self.RotateAngleY) then
|
||||
self.RotateAngleY = 0
|
||||
end
|
||||
if self.RotateAngleY < 50 then
|
||||
self.RotateAngleY = self.RotateAngleY + 2
|
||||
self:ManipulateBoneAngles( 2, Angle(self.RotateAngleY,0,0) )
|
||||
end
|
||||
end
|
||||
if self:GetRptRotate() == "Right" then
|
||||
if not isnumber(self.RotateAngleY) then
|
||||
self.RotateAngleY = 0
|
||||
end
|
||||
if self.RotateAngleY > -50 then
|
||||
self.RotateAngleY = self.RotateAngleY - 2
|
||||
self:ManipulateBoneAngles( 2, Angle(self.RotateAngleY,0,0) )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:SetupDataTables()
|
||||
self:NetworkVar( "Bool", 0, "RptCam" )
|
||||
self:NetworkVar( "String", 1, "RptRotate" )
|
||||
end
|
||||
function ENT:UpdateTransmitState()
|
||||
return TRANSMIT_ALWAYS
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Camera"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
|
||||
|
||||
|
||||
-- 76561198219964937
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
/*
|
||||
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
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Police Computer"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
-- dcb587233a6e567b06ae4da5655e3e9649694e7946f4d648e8f3181d8bc95b5f
|
||||
|
||||
-- dcb587233a6e567b06ae4da5655e3e9649694e7946f4d648e8f3181d8bc95b5f
|
||||
@@ -0,0 +1,5 @@
|
||||
include("shared.lua")
|
||||
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
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
|
||||
@@ -0,0 +1,11 @@
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "SBU Computer"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
function ENT:IsSBU()
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
-- 55698bd11dd4b187c328ffc9200a97bcc7d15bb56979457ac0aeb39001de0521
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
local pos = self:GetPos()
|
||||
local ang = self:GetAngles()
|
||||
ang:RotateAroundAxis(ang:Up(), 0)
|
||||
ang:RotateAroundAxis(ang:Forward(), 85)
|
||||
if LocalPlayer():GetPos():DistToSqr(self:GetPos()) < 200 ^ 2 then
|
||||
cam.Start3D2D(pos + ang:Up()*0, Angle(0, LocalPlayer():EyeAngles().y-90, 90), 0.025)
|
||||
draw.SimpleTextOutlined(Realistic_Police.JailerName, "rpt_font_22", -50, -3000, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 0, Realistic_Police.Colors["white"] );
|
||||
cam.End3D2D()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile("cl_init.lua")
|
||||
AddCSLuaFile("shared.lua")
|
||||
include("shared.lua")
|
||||
-- 55698bd11dd4b187c328ffc9200a97bcc7d15bb56979457ac0aeb39001de0521
|
||||
function ENT:Initialize()
|
||||
self:SetModel("models/Humans/Group01/Female_02.mdl")
|
||||
self:SetHullType(HULL_HUMAN)
|
||||
self:SetHullSizeNormal()
|
||||
self:SetNPCState(NPC_STATE_SCRIPT)
|
||||
self:SetSolid(SOLID_BBOX)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
end
|
||||
function ENT:Use(activator)
|
||||
if Realistic_Police.CheckJailPos() then
|
||||
if IsValid(activator.WeaponRPT["Drag"]) && activator.WeaponRPT["Drag"]:IsPlayer() then
|
||||
if Realistic_Police.CanCuff[Realistic_Police.GetPlayerJob(activator)] then
|
||||
net.Start("RealisticPolice:HandCuff")
|
||||
net.WriteString("Jailer")
|
||||
net.WriteString(activator.WeaponRPT["Drag"]:GetName())
|
||||
net.Send(activator)
|
||||
end
|
||||
else
|
||||
Realistic_Police.SendNotify(activator, Realistic_Police.GetSentence("needHoldPlayerToArrest"))
|
||||
end
|
||||
else
|
||||
Realistic_Police.SendNotify(activator, Realistic_Police.GetSentence("noJailPositions"))
|
||||
end
|
||||
end
|
||||
function ENT:OnTakeDamage()
|
||||
return 0
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_ai"
|
||||
ENT.Type = "ai"
|
||||
ENT.PrintName = "Jailer"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
-- 76561198219964944
|
||||
-- 76561198219964937
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
-- 55698bd11dd4b187c328ffc9200a97bcc7d15bb56979457ac0aeb39001de0521
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
function ENT:Draw()
|
||||
self:DrawModel()
|
||||
self:SetColor(Realistic_Police.Colors["green"])
|
||||
self:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
self:SetMaterial("models/wireframe")
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
/*
|
||||
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
|
||||
-- dcb587233a6e567b06ae4da5655e3e9649694e7946f4d648e8f3181d8bc95b5f
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
function ENT:Initialize()
|
||||
self:SetModel( "models/hunter/blocks/cube05x05x05.mdl" )
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
local RealisticPolicePhys = self:GetPhysicsObject()
|
||||
RealisticPolicePhys:EnableMotion(false)
|
||||
RealisticPolicePhys:EnableGravity(true)
|
||||
RealisticPolicePhys:Wake()
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Jail Pos"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = false
|
||||
ENT.AdminSpawnable = false
|
||||
|
||||
-- 76561198219964944
|
||||
|
||||
-- d4ec95c252515613de193db925956fba07d4ff50f580a4b42b7f507f9c716945
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
local function GetCameras()
|
||||
local TableEnt = {}
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if not IsValid(v:CPPIGetOwner()) then
|
||||
if IsValid(v) then
|
||||
table.insert(TableEnt, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
return TableEnt
|
||||
end
|
||||
|
||||
function ENT:Draw()
|
||||
if IsValid(self) && IsEntity(self) then
|
||||
self:DrawModel()
|
||||
local pos = self:GetPos() + self:GetAngles():Forward() * 6.1 + self:GetAngles():Up() * 37 + self:GetAngles():Right() * 29
|
||||
local ang = self:GetAngles()
|
||||
ang:RotateAroundAxis( ang:Up(), -90 )
|
||||
ang:RotateAroundAxis( ang:Right(), 180 )
|
||||
ang:RotateAroundAxis( ang:Forward(), 270 )
|
||||
|
||||
cam.Start3D2D(pos, ang, 0.25)
|
||||
if self:GetPos():DistToSqr(LocalPlayer():GetPos()) < 250^2 then
|
||||
local cameras = GetCameras()
|
||||
|
||||
if self.CreateMaterialRPT == nil && self.RenderTarget == nil then
|
||||
self:CameraRender(cameras)
|
||||
end
|
||||
|
||||
if istable(cameras) then
|
||||
if IsValid(cameras[self:GetNWInt("CameraId")]) then
|
||||
if not cameras[self:GetNWInt("CameraId")]:GetRptCam() then
|
||||
surface.SetDrawColor(Realistic_Police.Colors["white"])
|
||||
surface.SetMaterial(self.CreateMaterialRPT)
|
||||
surface.DrawTexturedRect(0, 0, 227, 146)
|
||||
else
|
||||
draw.RoundedBox(0, 0, 0, 227, 146, Realistic_Police.Colors["black20"])
|
||||
draw.DrawText(Realistic_Police.GetSentence("noSignal"), "rpt_font_19", 113.5, 53, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER)
|
||||
draw.DrawText(Realistic_Police.GetSentence("connectionProblem"), "rpt_font_19", 113.5, 73, Realistic_Police.Colors["red"], TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if self.CreateMaterialRPT != nil && self.RenderTarget != nil then
|
||||
hook.Remove( "HUDPaint", "RPTCamera:Render"..self:EntIndex() )
|
||||
self.CreateMaterialRPT = nil
|
||||
self.RenderTarget = nil
|
||||
end
|
||||
end
|
||||
cam.End3D2D()
|
||||
end
|
||||
end
|
||||
|
||||
function ENT:CameraRender(camera)
|
||||
self.RenderTarget = GetRenderTarget("rptcamera1"..self:EntIndex(), 500, 500, true)
|
||||
self.CreateMaterialRPT = CreateMaterial("rptcamera1"..self:EntIndex(), "UnlitGeneric", {["$basetexture"] = self.RenderTarget,})
|
||||
|
||||
timer.Create("rptcamera1"..self:EntIndex(), Realistic_Police.CameraUpdateRate, 0, function()
|
||||
if not IsValid(self) then
|
||||
timer.Remove("rptcamera1"..self:EntIndex())
|
||||
return
|
||||
end
|
||||
|
||||
local cameraId = self:GetNWInt("CameraId")
|
||||
|
||||
if not istable(camera) then return end
|
||||
if not IsValid(self) then return end
|
||||
if not isnumber(cameraId) then return end
|
||||
if not IsValid(camera[cameraId]) then return end
|
||||
|
||||
RPTPlayerDraw = false
|
||||
|
||||
render.PushRenderTarget(self.RenderTarget)
|
||||
cam.Start2D()
|
||||
render.OverrideAlphaWriteEnable( true, true )
|
||||
|
||||
render.ClearDepth()
|
||||
render.Clear( 0, 0, 0, 0 )
|
||||
local ang = camera[cameraId]:GetAngles()
|
||||
ang:RotateAroundAxis(ang:Up(), -90)
|
||||
local pos = camera[cameraId]:GetPos() + ang:Forward() * 25 + ang:Up() * 10
|
||||
|
||||
render.RenderView({
|
||||
x = 0,
|
||||
y = 0,
|
||||
w = 1920,
|
||||
h = 1080,
|
||||
origin = pos,
|
||||
angles = ang,
|
||||
viewid = 2,
|
||||
})
|
||||
render.OverrideAlphaWriteEnable( false )
|
||||
cam.End2D()
|
||||
render.PopRenderTarget()
|
||||
-- d4ec95c252515613de193db925956fba07d4ff50f580a4b42b7f507f9c716945
|
||||
|
||||
if IsValid(self) then
|
||||
if self.RenderTarget != nil then
|
||||
self.CreateMaterialRPT:SetTexture( '$basetexture', self.RenderTarget )
|
||||
end
|
||||
end
|
||||
RPTPlayerDraw = false
|
||||
end)
|
||||
end
|
||||
function ENT:Initialize()
|
||||
self:CameraRender()
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
/*
|
||||
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
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
local function GetCameras()
|
||||
local Tbl = {}
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if not IsValid(v:CPPIGetOwner()) then
|
||||
if IsValid(v) then
|
||||
Tbl[#Tbl + 1] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
return Tbl
|
||||
end
|
||||
-- 76561198219964944
|
||||
|
||||
function ENT:Initialize()
|
||||
self:SetModel( "models/props/cs_office/tv_plasma.mdl" )
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetNWInt("CameraId", 1)
|
||||
timer.Create("rpt_refresh_camera:"..self:EntIndex(), 3, 0, function()
|
||||
if not IsValid(self) then return end
|
||||
for k,v in pairs(ents.FindInSphere(self:GetPos(), 100)) do
|
||||
if IsValid(v) && v:IsPlayer() then
|
||||
v.RPTShowEntity = GetCameras()[self:GetNWInt("CameraId")]
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:Use(activator)
|
||||
local getCameras = GetCameras()
|
||||
|
||||
if self:GetNWInt("CameraId") < #getCameras then
|
||||
self:SetNWInt("CameraId", self:GetNWInt("CameraId") + 1)
|
||||
else
|
||||
self:SetNWInt("CameraId", 1)
|
||||
end
|
||||
activator.RPTShowEntity = getCameras[self:GetNWInt("CameraId")]
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Police Screen"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
-- 76561198219964937
|
||||
|
||||
-- 76561198219964937
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
include("shared.lua")
|
||||
|
||||
local function GetCameras(Players)
|
||||
local TableEnt = {}
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if IsValid(v:CPPIGetOwner()) then
|
||||
if v:CPPIGetOwner() == Players then
|
||||
if IsValid(v) then
|
||||
table.insert(TableEnt, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return TableEnt
|
||||
end
|
||||
function ENT:Draw()
|
||||
if IsValid(self) && IsEntity(self) then
|
||||
self:DrawModel()
|
||||
local pos = self:GetPos() + self:GetAngles():Forward() * 6.1 + self:GetAngles():Up() * 37 + self:GetAngles():Right() * 29
|
||||
local ang = self:GetAngles()
|
||||
ang:RotateAroundAxis( ang:Up(), -90 )
|
||||
ang:RotateAroundAxis( ang:Right(), 180 )
|
||||
ang:RotateAroundAxis( ang:Forward(), 270 )
|
||||
|
||||
cam.Start3D2D(pos, ang, 0.25)
|
||||
if self:GetPos():DistToSqr(LocalPlayer():GetPos()) < 250^2 then
|
||||
if self.CreateMaterialRPT == nil && self.RenderTarget == nil then
|
||||
self:CameraRender()
|
||||
end
|
||||
if IsValid(self:CPPIGetOwner()) && self:CPPIGetOwner():IsPlayer() then
|
||||
local cameras = GetCameras(self:CPPIGetOwner())
|
||||
if istable(cameras) then
|
||||
if IsValid(cameras[self:GetNWInt("CameraId")]) then
|
||||
if not cameras[self:GetNWInt("CameraId")]:GetRptCam() then
|
||||
surface.SetDrawColor(Realistic_Police.Colors["white"])
|
||||
surface.SetMaterial( self.CreateMaterialRPT )
|
||||
surface.DrawTexturedRect( 0, 0, 227, 146 )
|
||||
else
|
||||
draw.RoundedBox(0, 0, 0, 227, 146, Realistic_Police.Colors["black20"])
|
||||
draw.DrawText(Realistic_Police.GetSentence("noSignal"), "rpt_font_19", 113.5, 53, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER)
|
||||
draw.DrawText(Realistic_Police.GetSentence("connectionProblem"), "rpt_font_19", 113.5, 73, Realistic_Police.Colors["red"], TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if self.CreateMaterialRPT != nil && self.RenderTarget != nil then
|
||||
hook.Remove( "HUDPaint", "RPTCamera:Render"..self:EntIndex() )
|
||||
self.CreateMaterialRPT = nil
|
||||
self.RenderTarget = nil
|
||||
end
|
||||
end
|
||||
cam.End3D2D()
|
||||
end
|
||||
end
|
||||
function ENT:CameraRender()
|
||||
self.RenderTarget = GetRenderTarget( "rptcamera1"..self:EntIndex(), 500, 500, false )
|
||||
self.CreateMaterialRPT = CreateMaterial( "rptcamera1"..self:EntIndex(), "UnlitGeneric", { ["$basetexture"] = self.RenderTarget, } )
|
||||
timer.Create("rptcamera1"..self:EntIndex(), Realistic_Police.CameraUpdateRate, 0, function()
|
||||
if not IsValid(self) then
|
||||
timer.Remove("rptcamera1"..self:EntIndex())
|
||||
return
|
||||
end
|
||||
|
||||
RPTPlayerDraw = true
|
||||
render.PushRenderTarget( self.RenderTarget )
|
||||
render.ClearDepth()
|
||||
if IsValid(self:CPPIGetOwner()) && self:CPPIGetOwner():IsPlayer() then
|
||||
local cameras = GetCameras(self:CPPIGetOwner())
|
||||
if istable(cameras) then
|
||||
if IsValid( cameras[self:GetNWInt("CameraId")] ) then
|
||||
local Angs = cameras[self:GetNWInt("CameraId")]:GetAngles()
|
||||
Angs:RotateAroundAxis(Angs:Up(), -90)
|
||||
local pos = cameras[self:GetNWInt("CameraId")]:GetPos() + Angs:Forward() * 25 + Angs:Up() * 10
|
||||
|
||||
render.RenderView({
|
||||
x = 0,
|
||||
y = 0,
|
||||
w = 1920,
|
||||
h = 1080,
|
||||
origin = pos,
|
||||
angles = Angs,
|
||||
viewid = 2,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
render.UpdateScreenEffectTexture()
|
||||
render.PopRenderTarget()
|
||||
if IsValid(self) then
|
||||
if self.RenderTarget != nil then
|
||||
self.CreateMaterialRPT:SetTexture( '$basetexture', self.RenderTarget)
|
||||
end
|
||||
end
|
||||
RPTPlayerDraw = false
|
||||
end)
|
||||
end
|
||||
|
||||
function ENT:Initialize()
|
||||
self:CameraRender()
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
|
||||
/*
|
||||
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
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
|
||||
local function GetCameras(Players)
|
||||
local Tbl = {}
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if IsValid(v:CPPIGetOwner()) then
|
||||
if v:CPPIGetOwner() == Players then
|
||||
if IsValid(v) then
|
||||
Tbl[#Tbl + 1] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return Tbl
|
||||
end
|
||||
function ENT:Initialize()
|
||||
self:SetModel( "models/props/cs_office/tv_plasma.mdl" )
|
||||
self:PhysicsInit(SOLID_VPHYSICS)
|
||||
self:SetMoveType(MOVETYPE_VPHYSICS)
|
||||
self:SetSolid(SOLID_VPHYSICS)
|
||||
self:SetUseType(SIMPLE_USE)
|
||||
self:SetNWInt("CameraId", 1)
|
||||
timer.Create("rpt_refresh_camera:"..self:EntIndex(), 3, 0, function()
|
||||
if not IsValid(self) then return end
|
||||
for k,v in pairs(ents.FindInSphere(self:GetPos(), 100)) do
|
||||
if IsValid(v) && v:IsPlayer() then
|
||||
v.RPTShowEntity = GetCameras(v)[self:GetNWInt("CameraId")]
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
function ENT:Use(activator)
|
||||
if IsValid(self:CPPIGetOwner()) then
|
||||
if self:GetNWInt("CameraId") < #GetCameras(self:CPPIGetOwner()) then
|
||||
self:SetNWInt("CameraId", self:GetNWInt("CameraId") + 1)
|
||||
else
|
||||
self:SetNWInt("CameraId", 1)
|
||||
end
|
||||
activator.RPTShowEntity = GetCameras(self:CPPIGetOwner())[self:GetNWInt("CameraId")]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
ENT.Base = "base_gmodentity"
|
||||
ENT.Type = "anim"
|
||||
ENT.PrintName = "Camera Screen"
|
||||
ENT.Category = "Realistic Police"
|
||||
ENT.Author = "Kobralost"
|
||||
ENT.Spawnable = true
|
||||
ENT.AdminSpawnable = true
|
||||
|
||||
|
||||
-- 55698bd11dd4b187c328ffc9200a97bcc7d15bb56979457ac0aeb39001de0521
|
||||
|
||||
-- 76561198219964944
|
||||
Reference in New Issue
Block a user