add sborka
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
if SERVER then
|
||||
include("realistic_police/server/sv_rpt_function.lua")
|
||||
include("realistic_police/server/sv_rpt_hook.lua")
|
||||
include("realistic_police/server/sv_rpt_net.lua")
|
||||
include("realistic_police/server/sv_rpt_tool.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_main.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_fonts.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_criminal.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_listreport.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_report.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_firefox.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_camera.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_license.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_cmd.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_fining.lua")
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_handcuff.lua")
|
||||
|
||||
AddCSLuaFile("realistic_police/client/cl_rpt_notify.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_en.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_tr.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_cn.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_fr.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_ptbr.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_ru.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_es.lua")
|
||||
AddCSLuaFile("realistic_police/languages/sh_language_de.lua")
|
||||
AddCSLuaFile("realistic_police/shared/sh_functions.lua")
|
||||
AddCSLuaFile("realistic_police/sh_rpt_materials.lua")
|
||||
AddCSLuaFile("realistic_police/sh_rpt_advanced.lua")
|
||||
AddCSLuaFile("realistic_police/sh_rpt_config.lua")
|
||||
else
|
||||
include("realistic_police/client/cl_rpt_criminal.lua")
|
||||
include("realistic_police/client/cl_rpt_listreport.lua")
|
||||
include("realistic_police/client/cl_rpt_report.lua")
|
||||
include("realistic_police/client/cl_rpt_firefox.lua")
|
||||
include("realistic_police/client/cl_rpt_camera.lua")
|
||||
include("realistic_police/client/cl_rpt_license.lua")
|
||||
include("realistic_police/client/cl_rpt_cmd.lua")
|
||||
include("realistic_police/client/cl_rpt_fining.lua")
|
||||
include("realistic_police/client/cl_rpt_handcuff.lua")
|
||||
|
||||
include("realistic_police/client/cl_rpt_notify.lua")
|
||||
include("realistic_police/client/cl_rpt_main.lua")
|
||||
include("realistic_police/client/cl_rpt_fonts.lua")
|
||||
end
|
||||
|
||||
include("realistic_police/languages/sh_language_en.lua")
|
||||
include("realistic_police/languages/sh_language_tr.lua")
|
||||
include("realistic_police/languages/sh_language_cn.lua")
|
||||
include("realistic_police/languages/sh_language_fr.lua")
|
||||
include("realistic_police/languages/sh_language_ru.lua")
|
||||
include("realistic_police/languages/sh_language_es.lua")
|
||||
include("realistic_police/languages/sh_language_ptbr.lua")
|
||||
include("realistic_police/languages/sh_language_de.lua")
|
||||
include("realistic_police/shared/sh_functions.lua")
|
||||
include("realistic_police/sh_rpt_materials.lua")
|
||||
include("realistic_police/sh_rpt_advanced.lua")
|
||||
include("realistic_police/sh_rpt_config.lua")
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
if Realistic_Police.DefaultJob then
|
||||
TEAM_CAMERAREPAIRER = DarkRP.createJob("Мастер по камерам", {
|
||||
color = Color(252, 133, 0),
|
||||
model = {"models/player/odessa.mdl"},
|
||||
description = [[Ваша задача — ремонтировать городские камеры наблюдения.]],
|
||||
weapons = {"weapon_rpt_wrench"},
|
||||
command = "camerarepairer",
|
||||
max = 2,
|
||||
salary = 20,
|
||||
admin = 0,
|
||||
vote = false,
|
||||
hasLicense = false
|
||||
})
|
||||
end
|
||||
DarkRP.createCategory{
|
||||
name = "Мастер по камерам",
|
||||
categorises = "entities",
|
||||
startExpanded = true,
|
||||
color = Color(252, 133, 0),
|
||||
canSee = function(ply) return true end,
|
||||
sortOrder = 100
|
||||
}
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
|
||||
DarkRP.createEntity("Камера наблюдения", {
|
||||
ent = "realistic_police_camera",
|
||||
model = "models/wasted/wasted_kobralost_camera.mdl",
|
||||
price = 500,
|
||||
max = 10,
|
||||
cmd = "realistic_police_camera",
|
||||
--allowed = TEAM_CAMERAREPAIRER,
|
||||
category = "Мастер по камерам"
|
||||
})
|
||||
|
||||
DarkRP.createEntity("Экран наблюдения", {
|
||||
ent = "realistic_police_screen",
|
||||
model = "models/props/cs_office/tv_plasma.mdl",
|
||||
price = 500,
|
||||
max = 1,
|
||||
cmd = "realistic_police_screen",
|
||||
category = "Мастер по камерам"
|
||||
})
|
||||
-- d4ec95c252515613de193db925956fba07d4ff50f580a4b42b7f507f9c716945
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -0,0 +1,69 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
local MODULE = GAS.Logging:MODULE()
|
||||
MODULE.Category = "Realistic Police"
|
||||
MODULE.Name = "Stungun"
|
||||
MODULE.Colour = Color(44, 91, 240)
|
||||
|
||||
MODULE:Hook("RealisticPolice:Tazz", "RealisticPolice:Tazz", function(ply, owner)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply) .. " was tased by "..GAS.Logging:FormatPlayer(owner))
|
||||
end)
|
||||
|
||||
GAS.Logging:AddModule(MODULE)
|
||||
|
||||
-----------------------------------------------------------------
|
||||
|
||||
local MODULE = GAS.Logging:MODULE()
|
||||
MODULE.Category = "Realistic Police"
|
||||
MODULE.Name = "Cuff / UnCuff"
|
||||
MODULE.Colour = Color(44, 91, 240)
|
||||
|
||||
MODULE:Hook("RealisticPolice:Cuffed", "RealisticPolice:Cuffed", function(ply, officer)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply).. " was cuffed by "..GAS.Logging:FormatPlayer(officer))
|
||||
end)
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
MODULE:Hook("RealisticPolice:UnCuffed", "RealisticPolice:UnCuffed", function(ply, officer)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply).. " was uncuffed by "..GAS.Logging:FormatPlayer(officer))
|
||||
end)
|
||||
|
||||
GAS.Logging:AddModule(MODULE)
|
||||
|
||||
-----------------------------------------------------------------
|
||||
|
||||
local MODULE = GAS.Logging:MODULE()
|
||||
MODULE.Category = "Realistic Police"
|
||||
MODULE.Name = "Jail / UnJail"
|
||||
MODULE.Colour = Color(44, 91, 240)
|
||||
|
||||
MODULE:Hook("RealisticPolice:Jailed", "RealisticPolice:Jailed", function(ply, Time)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply).. " was jailed for "..Time.." s")
|
||||
end)
|
||||
|
||||
MODULE:Hook("RealisticPolice:UnJailed", "RealisticPolice:UnJailed", function(ply, officer)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply).. " was unjailed")
|
||||
end)
|
||||
-- 76561198219964944
|
||||
|
||||
GAS.Logging:AddModule(MODULE)
|
||||
|
||||
-----------------------------------------------------------------
|
||||
|
||||
local MODULE = GAS.Logging:MODULE()
|
||||
MODULE.Category = "Realistic Police"
|
||||
MODULE.Name = "Fining"
|
||||
MODULE.Colour = Color(44, 91, 240)
|
||||
|
||||
MODULE:Hook("RealisticPolice:FinePlayer", "RealisticPolice:FinePlayer", function(ply, rptEnt)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply).. " send a fine to "..GAS.Logging:FormatPlayer(rptEnt))
|
||||
end)
|
||||
|
||||
MODULE:Hook("RealisticPolice:FineVehicle", "RealisticPolice:FineVehicle", function(ply, officer)
|
||||
MODULE:Log(GAS.Logging:FormatPlayer(ply).. " send a fine to a vehicle")
|
||||
end)
|
||||
|
||||
GAS.Logging:AddModule(MODULE)
|
||||
@@ -0,0 +1,550 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
net.Receive("RealisticPolice:SecurityCamera", function()
|
||||
local RPTListCamera = net.ReadTable() or {}
|
||||
if not IsValid(RPTCFrame) then Realistic_Police.OpenCamera(RPTListCamera) end
|
||||
end )
|
||||
|
||||
function Realistic_Police.Camera()
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.SendToServer()
|
||||
end
|
||||
function Realistic_Police.OpenCamera(RPTListCamera)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
local RPTId = 1
|
||||
|
||||
if IsValid(RPTCFrame) then RPTCFrame:Remove() end
|
||||
|
||||
RPTCFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTCFrame:SetSize(RpRespX*0.682, RpRespY*0.675)
|
||||
RPTCFrame:SetPos(RpRespX*0.1569, RpRespY*0.153)
|
||||
RPTCFrame:ShowCloseButton(false)
|
||||
RPTCFrame:SetDraggable(true)
|
||||
RPTCFrame:SetTitle("")
|
||||
RPTCFrame:SetScreenLock( true )
|
||||
RPTCFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w*0.708, h*0.72 )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w*0.708, h*0.053 )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w*0.708, h*0.72 )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("cameraCenter"), "rpt_font_7", RpRespX*0.003, RpRespY*0.0038, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
function RPTCFrame:OnMousePressed()
|
||||
RPTCFrame:RequestFocus()
|
||||
local screenX, screenY = self:LocalToScreen( 0, 0 )
|
||||
if ( self.m_bSizable && gui.MouseX() > ( screenX + self:GetWide() - 20 ) && gui.MouseY() > ( screenY + self:GetTall() - 20 ) ) then
|
||||
self.Sizing = { gui.MouseX() - self:GetWide(), gui.MouseY() - self:GetTall() }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
if ( self:GetDraggable() && gui.MouseY() < ( screenY + 24 ) ) then
|
||||
self.Dragging = { gui.MouseX() - self.x, gui.MouseY() - self.y }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTCFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.12, RpRespY*0.44)
|
||||
RPTScroll:SetPos(RpRespX*0.003, RpRespY*0.04)
|
||||
RPTScroll.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(0,0)
|
||||
|
||||
local DPanel = vgui.Create("DPanel", RPTCFrame)
|
||||
DPanel:SetSize(RpRespX*0.355, RpRespY*0.44)
|
||||
DPanel:SetPos(RpRespX*0.125, RpRespY*0.04)
|
||||
DPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("cameraSecurityOfCity"), "rpt_font_7", RpRespX*0.01, RpRespY*0.014, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
timer.Simple(0.2, function()
|
||||
local DScroll2 = vgui.Create("DScrollPanel", DPanel)
|
||||
DScroll2:SetSize(RpRespX*0.335, RpRespY*0.37)
|
||||
DScroll2:SetPos(RpRespX*0.01, RpRespY*0.055)
|
||||
DScroll2.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black49"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
local x,y = self:LocalToScreen(0, 0)
|
||||
if #RPTListCamera != 0 then
|
||||
local pos, ang = RPTListCamera[RPTId]:GetBonePosition(2)
|
||||
if pos == RPTListCamera[RPTId]:GetPos() then
|
||||
pos = RPTListCamera[RPTId]:GetBoneMatrix(2):GetTranslation()
|
||||
end
|
||||
local VectorBone = pos
|
||||
local Angles = ang
|
||||
if isangle(ang) then
|
||||
Angles:RotateAroundAxis(Angles:Up(), -90)
|
||||
Angles:RotateAroundAxis(Angles:Forward(), -270)
|
||||
Angles:RotateAroundAxis(Angles:Right(), 90)
|
||||
else
|
||||
Angles = RPTListCamera[RPTId]:GetAngles()
|
||||
Angles:RotateAroundAxis(Angles:Up(), -90)
|
||||
end
|
||||
|
||||
local Pos = RPTListCamera[RPTId]:GetPos()
|
||||
Pos = Pos + Angles:Forward() * 25 + Angles:Up() * 10
|
||||
|
||||
if not RPTListCamera[RPTId]:GetRptCam() then
|
||||
render.RenderView( {
|
||||
origin = Pos,
|
||||
angles = Angles,
|
||||
x = x + 7.5, y = y + 7.5,
|
||||
w = w - 15, h = h - 15
|
||||
} )
|
||||
if IsValid(DPanelBroke) then
|
||||
DPanelBroke:Remove()
|
||||
end
|
||||
else
|
||||
if not IsValid(DPanelBroke) then
|
||||
DPanelBroke = vgui.Create("DPanel", DScroll2)
|
||||
DPanelBroke:SetSize(RpRespX*0.335, RpRespY*0.37)
|
||||
DPanelBroke:SetPos(0, 0)
|
||||
DPanelBroke.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black20"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
draw.SimpleText(Realistic_Police.GetSentence("noSignal"), "rpt_font_12", DPanelBroke:GetWide()/2, DPanelBroke:GetTall()/2.5, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(Realistic_Police.GetSentence("connectionProblem"), "rpt_font_13", DPanelBroke:GetWide()/2, DPanelBroke:GetTall()/1.8, Realistic_Police.Colors["red"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local sbar = DScroll2:GetVBar()
|
||||
sbar:SetSize(10,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
if istable(RPTListCamera) then
|
||||
for k,v in pairs(RPTListCamera) do
|
||||
local DButton1 = vgui.Create("DButton", RPTScroll)
|
||||
DButton1:SetSize(0,RpRespY*0.05)
|
||||
if isstring(v:GetNWString("rpt_name_camera")) && #v:GetNWString("rpt_name_camera") > 1 then
|
||||
DButton1:SetText(v:GetNWString("rpt_name_camera"))
|
||||
else
|
||||
DButton1:SetText("Camera "..k)
|
||||
end
|
||||
DButton1:SetFont("rpt_font_7")
|
||||
DButton1:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButton1:Dock(TOP)
|
||||
DButton1:DockMargin(0,5,0,0)
|
||||
DButton1.Paint = function(self,w,h)
|
||||
if self:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25200"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
end
|
||||
DButton1.DoClick = function()
|
||||
RPTId = k
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("ShowCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.SendToServer()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local DButtonLeft = vgui.Create("DButton", DScroll2)
|
||||
DButtonLeft:SetSize(RpRespX*0.03, DScroll2:GetTall()*0.96)
|
||||
DButtonLeft:SetPos(RpRespX*0.001, RpRespY*0.008)
|
||||
DButtonLeft:SetText("〈")
|
||||
DButtonLeft:SetFont("rpt_font_13")
|
||||
DButtonLeft:SetTextColor(Realistic_Police.Colors["white200"])
|
||||
DButtonLeft.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black2510"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
|
||||
if IsValid(RPTListCamera[RPTId]) then
|
||||
if not self:IsHovered() then
|
||||
if #RPTListCamera != 0 then
|
||||
if IsValid(RPTListCamera[RPTId]) then
|
||||
if RPTListCamera[RPTId]:GetRptRotate() != "nil" && RPTListCamera[RPTId]:GetRptRotate() != "Right" then
|
||||
if input.IsMouseDown( MOUSE_LEFT ) then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
DButtonLeft.OnMousePressed = function()
|
||||
if IsValid(RPTListCamera[RPTId]) then
|
||||
local BoneLookUp = RPTListCamera[RPTId]:LookupBone(RPTListCamera[RPTId]:GetBoneName(2))
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("Left")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
DButtonLeft.OnMouseReleased = function()
|
||||
if IsValid(RPTListCamera[RPTId]) then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
|
||||
local DButtonRight = vgui.Create("DButton", DScroll2)
|
||||
DButtonRight:SetSize(RpRespX*0.03, DScroll2:GetTall()*0.96)
|
||||
DButtonRight:SetPos(RpRespX*0.304, RpRespY*0.008)
|
||||
DButtonRight:SetText("〉")
|
||||
DButtonRight:SetFont("rpt_font_13")
|
||||
DButtonRight:SetTextColor(Realistic_Police.Colors["white200"])
|
||||
DButtonRight.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black2510"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
|
||||
if not self:IsHovered() then
|
||||
if IsValid(RPTListCamera[RPTId]) then
|
||||
if #RPTListCamera != 0 then
|
||||
if RPTListCamera[RPTId]:GetRptRotate() != "nil" && RPTListCamera[RPTId]:GetRptRotate() != "Left" then
|
||||
if input.IsMouseDown( MOUSE_LEFT ) then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
DButtonRight.OnMousePressed = function()
|
||||
if IsValid(RPTListCamera[RPTId]) then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("Right")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
DButtonRight.OnMouseReleased = function()
|
||||
if RPTListCamera[RPTId] then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
local RPTResize = vgui.Create("DButton", RPTCFrame)
|
||||
RPTResize:SetSize(RpRespX*0.016, RpRespY*0.026)
|
||||
RPTResize:SetPos(RPTCFrame:GetWide()*0.667, RPTCFrame:GetTall()*0.075)
|
||||
RPTResize:SetText("")
|
||||
RPTResize.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white200"] )
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material8"] )
|
||||
surface.DrawTexturedRect( 0, 0, w, h )
|
||||
end
|
||||
RPTResize.DoClick = function()
|
||||
Realistic_Police.Clic()
|
||||
Realistic_Police.FulLScreenCamera(RPTListCamera)
|
||||
--RPTCFrame:Remove()
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTCFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTCFrame:GetWide()*0.663, RPTCFrame:GetTall()*0.005)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTCFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.FulLScreenCamera(RPTListCamera)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
local RPTId = 1
|
||||
if IsValid(RPTCFrame) then RPTCFrame:Remove() end
|
||||
|
||||
RPTCFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTCFrame:SetSize(RpRespX*1, RpRespY*1)
|
||||
RPTCFrame:ShowCloseButton(false)
|
||||
RPTCFrame:SetDraggable(false)
|
||||
RPTCFrame:SetTitle("")
|
||||
RPTCFrame:SetScreenLock( true )
|
||||
RPTCFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15200"].r, Realistic_Police.Colors["black15200"].g, Realistic_Police.Colors["black15200"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("cameraCenter"), "rpt_font_7", RpRespX*0.008, RpRespY*0.01, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTCFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.12, RpRespY*0.72)
|
||||
RPTScroll:SetPos(RpRespX*0.01, RpRespY*0.04)
|
||||
RPTScroll.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(0,0)
|
||||
|
||||
local DPanel = vgui.Create("DPanel", RPTCFrame)
|
||||
DPanel:SetSize(RpRespX*0.648, RpRespY*0.72)
|
||||
DPanel:SetPos(RpRespX*0.137, RpRespY*0.04)
|
||||
DPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.SendToServer()
|
||||
|
||||
timer.Simple(0.2, function()
|
||||
local DScroll2 = vgui.Create("DScrollPanel", DPanel)
|
||||
DScroll2:SetSize(RpRespX*0.639, RpRespY*0.703)
|
||||
DScroll2:SetPos(RpRespX*0.005, RpRespY*0.008)
|
||||
DScroll2.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black49"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
local x,y = self:LocalToScreen(0, 0)
|
||||
if #RPTListCamera != 0 then
|
||||
local pos, ang = RPTListCamera[RPTId]:GetBonePosition(2)
|
||||
if pos == RPTListCamera[RPTId]:GetPos() then
|
||||
pos = RPTListCamera[RPTId]:GetBoneMatrix(2):GetTranslation()
|
||||
end
|
||||
local VectorBone = pos
|
||||
local Angles = ang
|
||||
|
||||
if isangle(ang) then
|
||||
Angles:RotateAroundAxis(Angles:Up(), -90)
|
||||
Angles:RotateAroundAxis(Angles:Forward(), -270)
|
||||
Angles:RotateAroundAxis(Angles:Right(), 90)
|
||||
else
|
||||
Angles = RPTListCamera[RPTId]:GetAngles()
|
||||
Angles:RotateAroundAxis(Angles:Up(), -90)
|
||||
end
|
||||
|
||||
local Pos = RPTListCamera[RPTId]:GetPos()
|
||||
Pos = Pos + Angles:Forward() * 25 + Angles:Up() * 10
|
||||
|
||||
if not RPTListCamera[RPTId]:GetRptCam() then
|
||||
render.RenderView( {
|
||||
origin = Pos,
|
||||
angles = Angles,
|
||||
x = x + 7.5, y = y + 7.5,
|
||||
w = w - 15, h = h - 15
|
||||
} )
|
||||
if IsValid(DPanelBroke) then
|
||||
DPanelBroke:Remove()
|
||||
end
|
||||
else
|
||||
if not IsValid(DPanelBroke) then
|
||||
DPanelBroke = vgui.Create("DPanel", DScroll2)
|
||||
DPanelBroke:SetSize(RpRespX*0.639, RpRespY*0.703)
|
||||
DPanelBroke:SetPos(0, 0)
|
||||
DPanelBroke.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black20"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
draw.SimpleText(Realistic_Police.GetSentence("noSignal"), "rpt_font_12", DPanelBroke:GetWide()/2, DPanelBroke:GetTall()/2.5, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(Realistic_Police.GetSentence("connectionProblem"), "rpt_font_13", DPanelBroke:GetWide()/2, DPanelBroke:GetTall()/1.8, Realistic_Police.Colors["red"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local sbar = DScroll2:GetVBar()
|
||||
sbar:SetSize(10,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
if istable(RPTListCamera) then
|
||||
for k,v in pairs(RPTListCamera) do
|
||||
local DButton1 = vgui.Create("DButton", RPTScroll)
|
||||
DButton1:SetSize(0,RpRespY*0.05)
|
||||
if isstring(v:GetNWString("rpt_name_camera")) && #v:GetNWString("rpt_name_camera") > 1 then
|
||||
DButton1:SetText(v:GetNWString("rpt_name_camera"))
|
||||
else
|
||||
DButton1:SetText("Camera "..k)
|
||||
end
|
||||
DButton1:SetFont("rpt_font_7")
|
||||
DButton1:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButton1:Dock(TOP)
|
||||
DButton1:DockMargin(0,5,0,0)
|
||||
DButton1.Paint = function(self,w,h)
|
||||
if self:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25200"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
end
|
||||
DButton1.DoClick = function()
|
||||
RPTId = k
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("ShowCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.SendToServer()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
end
|
||||
-- 55698bd11dd4b187c328ffc9200a97bcc7d15bb56979457ac0aeb39001de0521
|
||||
|
||||
local DButtonLeft = vgui.Create("DButton", DScroll2)
|
||||
DButtonLeft:SetSize(RpRespX*0.03, DScroll2:GetTall()*0.96)
|
||||
DButtonLeft:SetPos(RpRespX*0.001, RpRespY*0.008)
|
||||
DButtonLeft:SetText("〈")
|
||||
DButtonLeft:SetFont("rpt_font_13")
|
||||
DButtonLeft:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonLeft.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black2510"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
if not self:IsHovered() then
|
||||
if #RPTListCamera != 0 && IsValid(RPTListCamera[RPTId]) then
|
||||
if RPTListCamera[RPTId]:GetRptRotate() != "nil" && RPTListCamera[RPTId]:GetRptRotate() != "Right" then
|
||||
if input.IsMouseDown( MOUSE_LEFT ) then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
DButtonLeft.OnMousePressed = function()
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("Left")
|
||||
net.SendToServer()
|
||||
end
|
||||
DButtonLeft.OnMouseReleased = function()
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local DButtonRight = vgui.Create("DButton", DScroll2)
|
||||
DButtonRight:SetSize(RpRespX*0.03, DScroll2:GetTall()*0.96)
|
||||
DButtonRight:SetPos(RpRespX*0.605, RpRespY*0.008)
|
||||
DButtonRight:SetText("〉")
|
||||
DButtonRight:SetFont("rpt_font_13")
|
||||
DButtonRight:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonRight.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black2510"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
if not self:IsHovered() then
|
||||
if #RPTListCamera != 0 && IsValid(RPTListCamera[RPTId]) then
|
||||
if RPTListCamera[RPTId]:GetRptRotate() != "nil" && RPTListCamera[RPTId]:GetRptRotate() != "Left" then
|
||||
if input.IsMouseDown( MOUSE_LEFT ) then
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
DButtonRight.OnMousePressed = function()
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("Right")
|
||||
net.SendToServer()
|
||||
end
|
||||
DButtonRight.OnMouseReleased = function()
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("RotateCamera")
|
||||
net.WriteEntity(RPTListCamera[RPTId])
|
||||
net.WriteString("nil")
|
||||
net.SendToServer()
|
||||
end
|
||||
end )
|
||||
local RPTClose = vgui.Create("DButton", RPTCFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTCFrame:GetWide()*0.763, RPTCFrame:GetTall()*0.0052)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTCFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
local Sounds = {
|
||||
[1] = "https://media.vocaroo.com/mp3/5nsksDxB4mJ",
|
||||
[2] = "https://media.vocaroo.com/mp3/hPxWgG4BJTH",
|
||||
[3] = "https://media.vocaroo.com/mp3/BgNxBllRoEE",
|
||||
}
|
||||
function Realistic_Police.HackKey()
|
||||
sound.PlayURL( Sounds[math.random(1, #Sounds)], "",
|
||||
function( station )
|
||||
if IsValid( station ) then
|
||||
station:Play()
|
||||
station:SetVolume(1)
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
local ipNumbers = {
|
||||
[1] = {min = 100, max = 999},
|
||||
[2] = {min = 100, max = 999},
|
||||
[3] = {min = 1, max = 30},
|
||||
[4] = {min = 1, max = 10}
|
||||
}
|
||||
|
||||
local function generateIP()
|
||||
local ipAdress = ""
|
||||
for _, v in ipairs(ipNumbers) do
|
||||
if not isnumber(v.min) then continue end
|
||||
if not isnumber(v.max) then continue end
|
||||
ipAdress = ipAdress == "" and ipAdress..math.random(v.min, v.max) or ipAdress.."."..math.random(v.min, v.max)
|
||||
end
|
||||
return ipAdress
|
||||
end
|
||||
|
||||
function Realistic_Police.Cmd(Frame, Ent)
|
||||
CoultDown = CoultDown or CurTime()
|
||||
if CoultDown > CurTime() then return end
|
||||
CoultDown = CurTime() + 1
|
||||
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
if not Realistic_Police.HackerJob[Realistic_Police.GetPlayerJob(LocalPlayer())] then RealisticPoliceNotify(Realistic_Police.GetSentence("cantDoThat")) return end
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
local TextHack = ""
|
||||
local TextColor = Realistic_Police.Colors["gray220"]
|
||||
local CanWrite = true
|
||||
local FinishHack = false
|
||||
local ipAdress = generateIP()
|
||||
local TableString = {
|
||||
[1] = ""
|
||||
}
|
||||
local RandomWord = Realistic_Police.WordHack[math.random(1, #Realistic_Police.WordHack)]
|
||||
local Progress = 1
|
||||
|
||||
local RPTCMDFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTCMDFrame:SetSize(RpRespX*0.4825, RpRespY*0.486)
|
||||
RPTCMDFrame:ShowCloseButton(false)
|
||||
RPTCMDFrame:SetDraggable(true)
|
||||
RPTCMDFrame:SetTitle("")
|
||||
RPTCMDFrame:Center()
|
||||
RPTCMDFrame:SetKeyboardInputEnabled(true)
|
||||
RPTCMDFrame:RequestFocus()
|
||||
RPTCMDFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.074)
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
local osName = Realistic_Police.GetSentence("osName")
|
||||
draw.DrawText(osName.." CMD", "rpt_font_7", RpRespX*0.003, RpRespY*0.0038, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
|
||||
draw.DrawText(osName.." OS [Version 1.0] \n(c) "..osName.." Corporation 2020", "rpt_font_7", RpRespX*0.003, RpRespY*0.05, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
draw.DrawText("C:/Users/"..osName.."Corporation/cmd", "rpt_font_7", RpRespX*0.003, RpRespY*0.12, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
|
||||
for k,v in pairs(TableString) do
|
||||
if k > 7 then table.remove(TableString, 1) end
|
||||
if not FinishHack then
|
||||
if TableString[k] == "" then
|
||||
draw.DrawText("Write this Word "..RandomWord.." : "..TextHack, "rpt_font_7", RpRespX*0.003, (RpRespY*0.16) * (k*0.25) + RpRespY*0.12, TextColor, TEXT_ALIGN_LEFT)
|
||||
elseif isstring(TableString[k]) then
|
||||
draw.DrawText("Write this Word "..TableString[k].." : "..TableString[k], "rpt_font_7", RpRespX*0.003, (RpRespY*0.16) * (k*0.25) + RpRespY*0.12, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
elseif k != 7 then
|
||||
if isstring(TableString[k]) then
|
||||
draw.DrawText(TableString[k], "rpt_font_7", RpRespX*0.003, (RpRespY*0.16) * (k*0.25) + RpRespY*0.12, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
elseif k == 7 then
|
||||
if isstring(TableString[k]) then
|
||||
draw.DrawText(TableString[k], "rpt_font_7", RpRespX*0.003, (RpRespY*0.16) * (k*0.25) + RpRespY*0.12, TextColor, TEXT_ALIGN_LEFT)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function RPTCMDFrame:OnMousePressed()
|
||||
RPTCMDFrame:RequestFocus()
|
||||
local screenX, screenY = self:LocalToScreen( 0, 0 )
|
||||
if ( self.m_bSizable && gui.MouseX() > ( screenX + self:GetWide() - 20 ) && gui.MouseY() > ( screenY + self:GetTall() - 20 ) ) then
|
||||
self.Sizing = { gui.MouseX() - self:GetWide(), gui.MouseY() - self:GetTall() }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
if ( self:GetDraggable() && gui.MouseY() < ( screenY + 24 ) ) then
|
||||
self.Dragging = { gui.MouseX() - self.x, gui.MouseY() - self.y }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
end
|
||||
local RPTCMDFrameP = vgui.Create( "DProgress", RPTCMDFrame )
|
||||
RPTCMDFrameP:SetPos( 0, RpRespY*0.48 )
|
||||
RPTCMDFrameP:SetSize( RpRespX*0.4825, RpRespY*0.01 )
|
||||
RPTCMDFrameP:SetFraction( 0 )
|
||||
function RPTCMDFrame:OnKeyCodePressed( key )
|
||||
Realistic_Police.HackKey()
|
||||
if CanWrite then
|
||||
if input.GetKeyName( key ) != "BACKSPACE" && input.GetKeyName( key ) != "ENTER" then
|
||||
if CanWrite then
|
||||
if key >= 0 && key <= 36 or key == 59 then
|
||||
TextHack = TextHack..input.GetKeyName( key )
|
||||
elseif key > 36 && key <= 46 then
|
||||
local TableKey = {
|
||||
[37] = 0,
|
||||
[38] = 1,
|
||||
[39] = 2,
|
||||
[40] = 3,
|
||||
[41] = 4,
|
||||
[42] = 5,
|
||||
[43] = 6,
|
||||
[44] = 7,
|
||||
[45] = 8,
|
||||
[46] = 9,
|
||||
}
|
||||
TextHack = TextHack..TableKey[key]
|
||||
end
|
||||
end
|
||||
elseif input.GetKeyName( key ) == "BACKSPACE" then
|
||||
TextHack = string.sub(TextHack, 0, #TextHack-1)
|
||||
elseif input.GetKeyName( key ) == "ENTER" then
|
||||
if RandomWord == TextHack then
|
||||
TextColor = Realistic_Police.Colors["green"]
|
||||
CanWrite = false
|
||||
surface.PlaySound( "UI/buttonclick.wav" )
|
||||
timer.Simple(0.5, function()
|
||||
CanWrite = true
|
||||
TextColor = Realistic_Police.Colors["gray220"]
|
||||
TableString[#TableString] = TextHack
|
||||
TableString[#TableString + 1] = ""
|
||||
TextHack = ""
|
||||
RPTCMDFrameP:SetFraction( Progress * ( 1 / Realistic_Police.WordCount) )
|
||||
Progress = Progress + 1
|
||||
TextHack = ""
|
||||
RandomWord = Realistic_Police.WordHack[math.random(1, #Realistic_Police.WordHack)]
|
||||
if Progress * 0.10 > Realistic_Police.WordCount*0.10 then
|
||||
TableString = {}
|
||||
local Pourcentage = "0"
|
||||
FinishHack = true
|
||||
timer.Create("rpt_access", 0.05, 101, function()
|
||||
Pourcentage = Pourcentage + 1
|
||||
if Pourcentage != 101 then
|
||||
TableString[#TableString + 1] = "$root@"..ipAdress.." - Hack Progress ...... "..Pourcentage.."%"
|
||||
else
|
||||
TableString[#TableString + 1] = "Access Granted to the Computer"
|
||||
timer.Create("rpt_clicker", 0.5, 5, function()
|
||||
if TextColor == Realistic_Police.Colors["gray220"] then
|
||||
TextColor = Realistic_Police.Colors["green"]
|
||||
else
|
||||
TextColor = Realistic_Police.Colors["gray220"]
|
||||
end
|
||||
end )
|
||||
end
|
||||
end )
|
||||
timer.Simple(8, function()
|
||||
if IsValid(RPTCMDFrame) then
|
||||
RPTCMDFrame:SlideUp(0.2)
|
||||
net.Start("RealisticPolice:Open")
|
||||
net.WriteEntity(Ent)
|
||||
net.SendToServer()
|
||||
end
|
||||
end )
|
||||
end
|
||||
end )
|
||||
else
|
||||
if Progress > 1 then
|
||||
Progress = Progress - 1
|
||||
RPTCMDFrameP:SetFraction( (Progress * ( 1 / Realistic_Police.WordCount)) - (1 * ( 1 / Realistic_Police.WordCount)) )
|
||||
end
|
||||
surface.PlaySound( "buttons/combine_button1.wav" )
|
||||
TextColor = Realistic_Police.Colors["red"]
|
||||
CanWrite = false
|
||||
timer.Simple(0.5, function()
|
||||
CanWrite = true
|
||||
TextColor = Realistic_Police.Colors["gray220"]
|
||||
TextHack = ""
|
||||
end )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTCMDFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTCMDFrame:GetWide()*0.938, RPTCMDFrame:GetTall()*0.0068)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTCMDFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,443 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
local function CriminalRecord(ply)
|
||||
net.Start("RealisticPolice:CriminalRecord")
|
||||
net.WriteUInt(0, 10)
|
||||
net.WriteString("SendRecord")
|
||||
net.WriteEntity(ply)
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local function ScrollCriminalRecord(p, RPTCriminalRecord)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
if isstring(p:SteamID64()) then
|
||||
DScroll2:Clear()
|
||||
timer.Simple(0.5, function()
|
||||
if istable(RPTCriminalRecord) then
|
||||
for k,v in pairs(RPTCriminalRecord) do
|
||||
local DPanel = vgui.Create("DPanel", DScroll2)
|
||||
DPanel:SetSize(0,RpRespY*0.05 + ( (RpRespX * 0.01) * ( (string.len(v.Motif.." ("..v.Date..")")/44) - 1) ))
|
||||
DPanel:Dock(TOP)
|
||||
DPanel:DockMargin(0,5,0,0)
|
||||
DPanel.Paint = function(self,w,h)
|
||||
if self:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black240"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
end
|
||||
|
||||
local descriptionLabel = vgui.Create("RichText", DPanel)
|
||||
descriptionLabel:SetSize(RpRespY*0.45, RpRespY*0.05 + ( (RpRespX * 0.011) * ( (string.len(v.Motif.." ("..v.Date..")")/44) - 1) ) )
|
||||
descriptionLabel:SetPos(RpRespY*0.073, RpRespY*0.014)
|
||||
descriptionLabel:SetVerticalScrollbarEnabled(false)
|
||||
descriptionLabel:InsertColorChange(240, 240, 240, 255)
|
||||
descriptionLabel:AppendText(v.Motif.." ("..v.Date..")")
|
||||
function descriptionLabel:PerformLayout(w, h)
|
||||
descriptionLabel:SetContentAlignment(5)
|
||||
self:SetFontInternal("rpt_font_7")
|
||||
end
|
||||
|
||||
local DButton2 = vgui.Create("DButton", DPanel)
|
||||
DButton2:SetSize(RpRespX*0.018,RpRespX*0.018)
|
||||
DButton2:SetPos(RpRespX*0.3, RpRespY*0.01)
|
||||
DButton2:SetText("")
|
||||
DButton2.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white240"] )
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material1"] )
|
||||
surface.DrawTexturedRect( 0, 0, w, h )
|
||||
end
|
||||
DButton2.DoClick = function()
|
||||
if Realistic_Police.JobDeleteRecord[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
if p != LocalPlayer() then
|
||||
net.Start("RealisticPolice:CriminalRecord")
|
||||
net.WriteUInt(k, 10)
|
||||
net.WriteString("RemoveRecord")
|
||||
net.WriteEntity(p)
|
||||
net.SendToServer()
|
||||
DPanel:Remove()
|
||||
Realistic_Police.Clic()
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("cantDeleteSelfSanctions"))
|
||||
end
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("cantDelete"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
end
|
||||
|
||||
net.Receive("RealisticPolice:CriminalRecord", function()
|
||||
local RPTNumber = net.ReadInt(32)
|
||||
local RPTInformationDecompress = util.Decompress(net.ReadData(RPTNumber)) or {}
|
||||
local RPTCriminalRecord = util.JSONToTable(RPTInformationDecompress)
|
||||
local RPTEntity = net.ReadEntity()
|
||||
|
||||
ScrollCriminalRecord(RPTEntity, RPTCriminalRecord)
|
||||
end )
|
||||
|
||||
local antiSpamWanted = 0
|
||||
function Realistic_Police.CriminalRecord(Panel, RPTEntComputer)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
local TablePlayers = player.GetAll()
|
||||
local VisiblePlayers = {}
|
||||
local lp = LocalPlayer()
|
||||
|
||||
local isSBUComputer = IsValid(RPTEntComputer) and RPTEntComputer.IsSBU and RPTEntComputer:IsSBU()
|
||||
|
||||
for _, ply in ipairs(TablePlayers) do
|
||||
local targetChar = ply.GetCharacter and ply:GetCharacter()
|
||||
if not targetChar then continue end
|
||||
|
||||
local faction = targetChar:GetFaction()
|
||||
if isSBUComputer then
|
||||
-- SBU computer only shows Ukraine players
|
||||
if faction != (FACTION_UKRAINE or -1) then
|
||||
continue
|
||||
end
|
||||
else
|
||||
-- FSB computer (default) only shows non-Ukraine players
|
||||
if faction == (FACTION_UKRAINE or -1) then
|
||||
continue
|
||||
end
|
||||
end
|
||||
table.insert(VisiblePlayers, ply)
|
||||
end
|
||||
|
||||
local RPTEntity = VisiblePlayers[1] or lp
|
||||
local CrimeRecordName = IsValid(RPTEntity) and RPTEntity:Name() or "Нет данных"
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
local RPTActivate = false
|
||||
local RPTCriminalP = nil
|
||||
|
||||
local RPTCFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTCFrame:SetSize(RpRespX*0.605, RpRespY*0.486)
|
||||
RPTCFrame:SetPos(RpRespX*0.115, RpRespY*0.15 )
|
||||
RPTCFrame:ShowCloseButton(false)
|
||||
RPTCFrame:SetDraggable(true)
|
||||
RPTCFrame:SetTitle("")
|
||||
RPTCFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.074 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("criminalRecord"), "rpt_font_7", RpRespX*0.003, RpRespY*0.0038, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
function RPTCFrame:OnMousePressed()
|
||||
RPTCFrame:RequestFocus()
|
||||
local screenX, screenY = self:LocalToScreen( 0, 0 )
|
||||
if ( self.m_bSizable && gui.MouseX() > ( screenX + self:GetWide() - 20 ) && gui.MouseY() > ( screenY + self:GetTall() - 20 ) ) then
|
||||
self.Sizing = { gui.MouseX() - self:GetWide(), gui.MouseY() - self:GetTall() }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
if ( self:GetDraggable() && gui.MouseY() < ( screenY + 24 ) ) then
|
||||
self.Dragging = { gui.MouseX() - self.x, gui.MouseY() - self.y }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTCFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.12, RpRespY*0.44)
|
||||
RPTScroll:SetPos(RpRespX*0.003, RpRespY*0.04)
|
||||
RPTScroll.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(0,0)
|
||||
|
||||
local DPanel = vgui.Create("DPanel", RPTCFrame)
|
||||
DPanel:SetSize(RpRespX*0.355, RpRespY*0.44)
|
||||
DPanel:SetPos(RpRespX*0.125, RpRespY*0.04)
|
||||
DPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("recordOf").." : "..CrimeRecordName, "rpt_font_7", RpRespX*0.01, RpRespY*0.015, Realistic_Police.Colors["gray"], TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
DScroll2 = vgui.Create("DScrollPanel", DPanel)
|
||||
DScroll2:SetSize(RpRespX*0.335, RpRespY*0.37)
|
||||
DScroll2:SetPos(RpRespX*0.01, RpRespY*0.055)
|
||||
DScroll2.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black49"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
local sbar = DScroll2:GetVBar()
|
||||
sbar:SetSize(10,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
local RPTPanel = vgui.Create("DPanel", RPTCFrame)
|
||||
RPTPanel:SetSize(RpRespX*0.12, RpRespY*0.44)
|
||||
RPTPanel:SetPos(RpRespX*0.482, RpRespY*0.04)
|
||||
RPTPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
local PanelDModel = vgui.Create("DModelPanel", RPTPanel)
|
||||
PanelDModel:SetSize(RpRespX*0.1, RpRespY*0.3)
|
||||
PanelDModel:SetPos(RpRespX*0.01, RpRespY*0.04)
|
||||
PanelDModel:SetModel(RPTEntity:GetModel())
|
||||
PanelDModel.LayoutEntity = function() end
|
||||
PanelDModel:SetCamPos( Vector( 310, 10, 45 ) )
|
||||
PanelDModel:SetLookAt( Vector( 0, 0, 36 ) )
|
||||
PanelDModel:SetFOV(8)
|
||||
|
||||
local BWanted = vgui.Create("DButton", RPTPanel)
|
||||
BWanted:SetSize(RpRespX*0.115, RpRespY*0.03)
|
||||
BWanted:SetPos(RpRespX*0.003, RPTPanel:GetTall()*0.82)
|
||||
BWanted:SetText(Realistic_Police.GetPlayerJob(RPTEntity))
|
||||
BWanted:SetFont("rpt_font_7")
|
||||
BWanted:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
BWanted.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
BWanted.DoClick = function() end
|
||||
|
||||
if not Realistic_Police.DisableWantedButton then
|
||||
local BWarrant = vgui.Create("DButton", RPTPanel)
|
||||
BWarrant:SetSize(RpRespX*0.115, RpRespY*0.03)
|
||||
BWarrant:SetPos(RpRespX*0.003, RPTPanel:GetTall()*0.90)
|
||||
BWarrant:SetText("Назначить Розыск")
|
||||
BWarrant:SetFont("rpt_font_7")
|
||||
BWarrant:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
BWarrant.DoClick = function()
|
||||
local curTime = CurTime()
|
||||
|
||||
antiSpamWanted = antiSpamWanted or 0
|
||||
if antiSpamWanted > curTime then return end
|
||||
antiSpamWanted = curTime + 2 -- Reduced spam delay
|
||||
|
||||
local isSBU = IsValid(RPTEntComputer) and RPTEntComputer.IsSBU and RPTEntComputer:IsSBU()
|
||||
local wantedVar = isSBU and "ix_wanted_sbu" or "ix_wanted_fsb"
|
||||
local isWanted = RPTEntity:GetNWBool(wantedVar, false)
|
||||
|
||||
net.Start("RealisticPolice:SetWantedStatus")
|
||||
net.WriteEntity(RPTEntity)
|
||||
net.WriteBool(not isWanted)
|
||||
net.SendToServer()
|
||||
end
|
||||
BWarrant.Paint = function(self,w,h)
|
||||
local isSBU = IsValid(RPTEntComputer) and RPTEntComputer.IsSBU and RPTEntComputer:IsSBU()
|
||||
local wantedVar = isSBU and "ix_wanted_sbu" or "ix_wanted_fsb"
|
||||
local isWanted = RPTEntity:GetNWBool(wantedVar, false)
|
||||
|
||||
if isWanted then
|
||||
BWarrant:SetText("Снять Розыск")
|
||||
else
|
||||
BWarrant:SetText("Назначить Розыск")
|
||||
end
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
end
|
||||
|
||||
CriminalRecord(RPTEntity)
|
||||
|
||||
for k,v in ipairs(VisiblePlayers) do
|
||||
|
||||
local DButton1 = vgui.Create("DButton", RPTScroll)
|
||||
DButton1:SetSize(0,RpRespY*0.05)
|
||||
DButton1:SetText(v:Name())
|
||||
DButton1:SetFont("rpt_font_7")
|
||||
DButton1:Dock(TOP)
|
||||
DButton1:DockMargin(0,5,0,0)
|
||||
DButton1.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25150"] )
|
||||
surface.DrawRect( 5, 0, w, h )
|
||||
|
||||
local isSBU = IsValid(RPTEntComputer) and RPTEntComputer.IsSBU and RPTEntComputer:IsSBU()
|
||||
local wantedVar = isSBU and "ix_wanted_sbu" or "ix_wanted_fsb"
|
||||
local isWanted = v:GetNWBool(wantedVar, false)
|
||||
|
||||
if isWanted then
|
||||
DButton1:SetTextColor(Realistic_Police.Colors["red"])
|
||||
else
|
||||
DButton1:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
end
|
||||
end
|
||||
DButton1.DoClick = function()
|
||||
DScroll2:Clear()
|
||||
CriminalRecord(v)
|
||||
Realistic_Police.Clic()
|
||||
RPTEntity = v
|
||||
PanelDModel:SetModel(v:GetModel())
|
||||
CrimeRecordName = v:Name()
|
||||
BWanted:SetText(Realistic_Police.GetPlayerJob(v))
|
||||
end
|
||||
end
|
||||
|
||||
local BAdd = vgui.Create("DButton", DPanel)
|
||||
BAdd:SetSize(RpRespX*0.06, RpRespY*0.03)
|
||||
BAdd:SetPos(RpRespX*0.2877, RpRespY*0.0145)
|
||||
BAdd:SetText(Realistic_Police.GetSentence("addUpperCase"))
|
||||
BAdd:SetFont("rpt_font_7")
|
||||
BAdd:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
BAdd.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
BAdd.DoClick = function()
|
||||
local PanelCreate = vgui.Create("DFrame", RPTBaseFrame)
|
||||
PanelCreate:SetSize(RpRespX*0.2, RpRespY*0.22)
|
||||
PanelCreate:Center()
|
||||
PanelCreate:SetTitle("")
|
||||
PanelCreate:ShowCloseButton(false)
|
||||
PanelCreate.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
local PanelCD = vgui.Create("DComboBox", PanelCreate)
|
||||
PanelCD:SetSize(RpRespX*0.18, RpRespY*0.05)
|
||||
PanelCD:SetPos(RpRespX*0.01, RpRespY*0.03)
|
||||
PanelCD:SetText(Realistic_Police.GetSentence("username"))
|
||||
PanelCD:SetFont("rpt_font_7")
|
||||
for k,v in pairs(player.GetAll()) do
|
||||
PanelCD:AddChoice(v:Name(), v)
|
||||
end
|
||||
function PanelCD:OnSelect( index, text, data )
|
||||
RPTActivate = true
|
||||
RPTCriminalP = data
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
local PanelCT = vgui.Create("DTextEntry", PanelCreate)
|
||||
PanelCT:SetSize(RpRespX*0.18, RpRespY*0.05)
|
||||
PanelCT:SetPos(RpRespX*0.01, RpRespY*0.085)
|
||||
PanelCT:SetText(" "..Realistic_Police.GetSentence("infractionReason"))
|
||||
PanelCT:SetFont("rpt_font_7")
|
||||
PanelCT:SetDrawLanguageID(false)
|
||||
PanelCT.OnGetFocus = function(self)
|
||||
if PanelCT:GetText() == " "..Realistic_Police.GetSentence("infractionReason") then
|
||||
PanelCT:SetText("")
|
||||
end
|
||||
end
|
||||
PanelCT.OnLoseFocus = function(self)
|
||||
if PanelCT:GetText() == "" then
|
||||
PanelCT:SetText(" "..Realistic_Police.GetSentence("infractionReason"))
|
||||
end
|
||||
end
|
||||
PanelCT.AllowInput = function( self, stringValue )
|
||||
if string.len(PanelCT:GetValue()) > 1000 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
local ButtonAdd = vgui.Create("DButton", PanelCreate)
|
||||
ButtonAdd:SetSize(RpRespX*0.088, RpRespY*0.05)
|
||||
ButtonAdd:SetPos(RpRespX*0.01, RpRespY*0.145)
|
||||
ButtonAdd:SetText(Realistic_Police.GetSentence("create"))
|
||||
ButtonAdd:SetFont("rpt_font_7")
|
||||
ButtonAdd:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
ButtonAdd.Paint = function(self,w,h)
|
||||
if ButtonAdd:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
end
|
||||
ButtonAdd.DoClick = function()
|
||||
if RPTActivate && IsValid(RPTCriminalP) then
|
||||
if PanelCT:GetText() != " "..Realistic_Police.GetSentence("infractionReason") then
|
||||
if Realistic_Police.JobEditRecord[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
net.Start("RealisticPolice:CriminalRecord")
|
||||
net.WriteUInt(1, 10)
|
||||
net.WriteString("AddRecord")
|
||||
net.WriteEntity(RPTCriminalP)
|
||||
net.WriteString(PanelCT:GetValue())
|
||||
net.SendToServer()
|
||||
PanelCreate:Remove()
|
||||
DScroll2:Clear()
|
||||
CriminalRecord(RPTCriminalP)
|
||||
Realistic_Police.Clic()
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("cantDoThat"))
|
||||
end
|
||||
else
|
||||
surface.PlaySound( "buttons/combine_button1.wav" )
|
||||
end
|
||||
else
|
||||
surface.PlaySound( "buttons/combine_button1.wav" )
|
||||
end
|
||||
end
|
||||
|
||||
local ButtonDel = vgui.Create("DButton", PanelCreate)
|
||||
ButtonDel:SetSize(RpRespX*0.0885, RpRespY*0.05)
|
||||
ButtonDel:SetPos(RpRespX*0.101, RpRespY*0.145)
|
||||
ButtonDel:SetText(Realistic_Police.GetSentence("cancel"))
|
||||
ButtonDel:SetFont("rpt_font_7")
|
||||
ButtonDel:SetTextColor(Realistic_Police.Colors["white"])
|
||||
ButtonDel.Paint = function(self,w,h)
|
||||
if ButtonAdd:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
end
|
||||
ButtonDel.DoClick = function()
|
||||
PanelCreate:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTCFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTCFrame:GetWide()*0.95, RPTCFrame:GetTall()*0.0068)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTCFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
local function GetAmountByName(String)
|
||||
local Amount = 0
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if v.Name == String then
|
||||
Amount = v.Price
|
||||
end
|
||||
end
|
||||
return Amount
|
||||
end
|
||||
|
||||
local function RPTGetCategory(Bool)
|
||||
local Table = {}
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if v.Vehicle == Bool then
|
||||
if not table.HasValue(Table, v.Category) then
|
||||
table.insert(Table, v.Category)
|
||||
end
|
||||
end
|
||||
end
|
||||
return Table
|
||||
end
|
||||
local function RPTGetFineByCategory(String, Bool)
|
||||
local Table = {}
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if String == v.Category && Bool == v.Vehicle then
|
||||
Table[#Table + 1] = v
|
||||
end
|
||||
end
|
||||
return Table
|
||||
end
|
||||
|
||||
function Realistic_Police.OpenFiningMenu(Boolen)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
local RPTActivate = false
|
||||
|
||||
if IsValid(RPTFFrame) then RPTFFrame:Remove() end
|
||||
|
||||
RPTFFrame = vgui.Create("DFrame")
|
||||
RPTFFrame:SetSize(RpRespX*0.28, RpRespY*0.602)
|
||||
RPTFFrame:Center()
|
||||
RPTFFrame:ShowCloseButton(false)
|
||||
RPTFFrame:SetDraggable(false)
|
||||
RPTFFrame:MakePopup()
|
||||
RPTFFrame:SetTitle("")
|
||||
RPTFFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.074 )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawRect( RpRespX*0.005, RpRespY*0.04, w*0.97, h*0.918 )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("fineBook"), "rpt_font_9", RpRespX*0.005, RpRespY*0.007, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTFFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.27, RpRespY*0.496)
|
||||
RPTScroll:SetPos(RpRespX*0.006, RpRespY*0.04)
|
||||
RPTScroll.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(0,0)
|
||||
|
||||
RPTCheckbox = {}
|
||||
local TableFiningSytem = {}
|
||||
local DButton1 = {}
|
||||
local RPTMoney = 0
|
||||
for k,v in pairs(RPTGetCategory(Boolen)) do
|
||||
DButton1[k] = vgui.Create("DButton", RPTScroll)
|
||||
DButton1[k]:SetSize(0,RpRespY*0.05)
|
||||
DButton1[k]:SetText("")
|
||||
DButton1[k]:SetFont("rpt_font_7")
|
||||
DButton1[k]:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButton1[k]:Dock(TOP)
|
||||
DButton1[k].Extend = false
|
||||
DButton1[k].FineName = v
|
||||
DButton1[k]:DockMargin(0,5,0,0)
|
||||
DButton1[k].Paint = function(self,w,h)
|
||||
if self:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray100"])
|
||||
surface.DrawOutlinedRect( 5, 0, w-10, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray100"])
|
||||
surface.DrawOutlinedRect( 5, 0, w-10, RpRespY*0.05 )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray100"])
|
||||
surface.DrawOutlinedRect( 5, 0, w-10, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray100"])
|
||||
surface.DrawOutlinedRect( 5, 0, w-10, RpRespY*0.05 )
|
||||
end
|
||||
draw.DrawText("Category : "..v, "rpt_font_7", DButton1[k]:GetWide()/2.05, RpRespY*0.013, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER)
|
||||
end
|
||||
local ParentDScrollPanel = {}
|
||||
DButton1[k].DoClick = function()
|
||||
if not DButton1[k].Extend then
|
||||
DButton1[k]:SetSize(0,#RPTGetFineByCategory(DButton1[k].FineName, Boolen) * RpRespY*0.054 + RpRespY*0.06 )
|
||||
DButton1[k]:SlideDown(0.5)
|
||||
DButton1[k].Extend = true
|
||||
|
||||
ParentDScrollPanel[k] = vgui.Create("DScrollPanel", DButton1[k])
|
||||
ParentDScrollPanel[k]:SetPos(RpRespX*0.0034, RpRespY*0.051)
|
||||
ParentDScrollPanel[k]:SetSize(RpRespX*0.262, #RPTGetFineByCategory(DButton1[k].FineName, Boolen) * RpRespY*0.054 + RpRespY*0.06 )
|
||||
ParentDScrollPanel[k]:SlideDown(0.5)
|
||||
ParentDScrollPanel[k].Paint = function() end
|
||||
ParentDScrollPanel[k]:GetVBar():SetSize(0,0)
|
||||
|
||||
local DButtonScroll = {}
|
||||
for id, v in pairs( RPTGetFineByCategory(DButton1[k].FineName, Boolen) ) do
|
||||
DButtonScroll[id] = vgui.Create("DButton", ParentDScrollPanel[k])
|
||||
DButtonScroll[id]:SetSize(0,RpRespY*0.05)
|
||||
DButtonScroll[id]:SetText("")
|
||||
DButtonScroll[id]:SetFont("rpt_font_7")
|
||||
DButtonScroll[id]:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonScroll[id]:Dock(TOP)
|
||||
DButtonScroll[id]:DockMargin(3,4,0,0)
|
||||
DButtonScroll[id].Paint = function(self,w,h)
|
||||
if self:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, RpRespY*0.05 )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor(Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, RpRespY*0.05 )
|
||||
end
|
||||
draw.DrawText(" "..(v.Name or ""), "rpt_font_7", DButtonScroll[id]:GetWide()/2.05, RpRespY*0.013, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER)
|
||||
end
|
||||
DButtonScroll[id].DoClick = function()
|
||||
if not IsValid(RPTCheckbox[id]) then return end
|
||||
if not table.HasValue(TableFiningSytem, v.Name) then
|
||||
if #TableFiningSytem < Realistic_Police.MaxPenalty then
|
||||
table.insert(TableFiningSytem, v.Name)
|
||||
RPTCheckbox[id]:SetChecked(true)
|
||||
else
|
||||
table.RemoveByValue(TableFiningSytem, v.Name)
|
||||
RPTCheckbox[id]:SetChecked(false)
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("richSanctions"))
|
||||
end
|
||||
else
|
||||
table.RemoveByValue(TableFiningSytem, v.Name)
|
||||
RPTCheckbox[id]:SetChecked(false)
|
||||
end
|
||||
RPTMoney = 0
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if table.HasValue(TableFiningSytem, v.Name) then
|
||||
RPTMoney = RPTMoney + v.Price
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RPTCheckbox[id] = vgui.Create( "DCheckBox", DButtonScroll[id] )
|
||||
RPTCheckbox[id]:SetPos( RpRespX*0.01, RpRespY*0.02 )
|
||||
RPTCheckbox[id]:SetChecked( false )
|
||||
RPTCheckbox[id].OnChange = function(val)
|
||||
if IsValid(RPTCheckbox[id]) then
|
||||
if not table.HasValue(TableFiningSytem, v.Name) then
|
||||
if #TableFiningSytem < Realistic_Police.MaxPenalty then
|
||||
table.insert(TableFiningSytem, v.Name)
|
||||
RPTCheckbox[id]:SetChecked(true)
|
||||
else
|
||||
table.RemoveByValue(TableFiningSytem, v.Name)
|
||||
RPTCheckbox[id]:SetChecked(false)
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("richSanctions"))
|
||||
end
|
||||
else
|
||||
table.RemoveByValue(TableFiningSytem, v.Name)
|
||||
RPTCheckbox[id]:SetChecked(false)
|
||||
end
|
||||
end
|
||||
|
||||
RPTMoney = 0
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if table.HasValue(TableFiningSytem, v.Name) then
|
||||
RPTMoney = RPTMoney + v.Price
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,name in pairs(TableFiningSytem) do
|
||||
if name == v.Name then
|
||||
if IsValid(RPTCheckbox[id]) then
|
||||
RPTCheckbox[id]:SetChecked(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
DButton1[k].Extend = false
|
||||
DButton1[k]:SizeTo(DButton1[k]:GetWide(), RpRespY*0.05, 0.5, 0, -1, function()
|
||||
ParentDScrollPanel[k]:Remove()
|
||||
end )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local DButtonAccept = vgui.Create("DButton", RPTFFrame)
|
||||
DButtonAccept:SetSize(RpRespX*0.271, RpRespY*0.05)
|
||||
DButtonAccept:SetPos(RpRespX*0.005, RpRespY*0.5375)
|
||||
DButtonAccept:SetText(Realistic_Police.GetSentence("confirm").." ( "..RPTMoney.." $ )")
|
||||
DButtonAccept:SetFont("rpt_font_7")
|
||||
DButtonAccept:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonAccept.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
DButtonAccept:SetText(Realistic_Police.GetSentence("confirm").." ( "..RPTMoney.." $ )")
|
||||
end
|
||||
DButtonAccept.DoClick = function()
|
||||
if istable(TableFiningSytem) && #TableFiningSytem != 0 then
|
||||
local StringToSend = ""
|
||||
for k,v in pairs(TableFiningSytem) do
|
||||
StringToSend = StringToSend.."§"..v
|
||||
end
|
||||
net.Start("RealisticPolice:FiningSystem")
|
||||
net.WriteString("SendFine")
|
||||
net.WriteString(StringToSend)
|
||||
net.SendToServer()
|
||||
RPTFFrame:SlideUp(0.7)
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("mustSelectPenality"))
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTFFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTFFrame:GetWide()*0.878, RPTFFrame:GetTall()*0.0068)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTFFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
net.Start("RealisticPolice:FiningSystem")
|
||||
net.WriteString("StopFine")
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
|
||||
net.Receive("RealisticPolice:FiningSystem", function()
|
||||
local Table = net.ReadTable() or {}
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
local RPTActivate = false
|
||||
local Amount = 0
|
||||
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if table.HasValue(Table, v.Name) then
|
||||
Amount = Amount + v.Price
|
||||
end
|
||||
end
|
||||
|
||||
if IsValid(RPTFFrame) then RPTFFrame:Remove() end
|
||||
RPTFFrame = vgui.Create("DFrame")
|
||||
RPTFFrame:SetSize(RpRespX*0.28, RpRespY*0.602)
|
||||
RPTFFrame:Center()
|
||||
RPTFFrame:ShowCloseButton(false)
|
||||
RPTFFrame:SetDraggable(false)
|
||||
RPTFFrame:SetTitle("")
|
||||
RPTFFrame:MakePopup()
|
||||
RPTFFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.074 )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawRect( RpRespX*0.005, RpRespY*0.04, w*0.97, h*0.918 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("fineBook"), "rpt_font_9", RpRespX*0.005, RpRespY*0.007, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTFFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.27, RpRespY*0.496)
|
||||
RPTScroll:SetPos(RpRespX*0.005, RpRespY*0.04)
|
||||
RPTScroll.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(0,0)
|
||||
|
||||
for k,v in pairs(Table) do
|
||||
DButton1 = vgui.Create("DButton", RPTScroll)
|
||||
DButton1:SetSize(0,RpRespY*0.05)
|
||||
DButton1:SetText(v.." ("..DarkRP.formatMoney(GetAmountByName(v))..")")
|
||||
DButton1:SetFont("rpt_font_7")
|
||||
DButton1:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButton1:Dock(TOP)
|
||||
DButton1:DockMargin(0,5,0,0)
|
||||
DButton1.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
end
|
||||
|
||||
local DButtonBuy = vgui.Create("DButton", RPTFFrame)
|
||||
DButtonBuy:SetSize(RpRespX*0.27, RpRespY*0.05)
|
||||
DButtonBuy:SetPos(RpRespX*0.005, RpRespY*0.5375)
|
||||
DButtonBuy:SetText(Realistic_Police.GetSentence("payFine").." : "..DarkRP.formatMoney(Amount))
|
||||
DButtonBuy:SetFont("rpt_font_7")
|
||||
DButtonBuy:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonBuy.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["green"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["green"] )
|
||||
surface.DrawOutlinedRect( 5, 0, w-10, h )
|
||||
end
|
||||
DButtonBuy.DoClick = function()
|
||||
if LocalPlayer():getDarkRPVar("money") >= Amount then
|
||||
net.Start("RealisticPolice:FiningSystem")
|
||||
net.WriteString("BuyFine")
|
||||
net.SendToServer()
|
||||
RPTFFrame:SlideUp(0.7)
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("cantAffordFine"))
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTFFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTFFrame:GetWide()*0.878, RPTFFrame:GetTall()*0.0068)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTFFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
net.Start("RealisticPolice:FiningSystem")
|
||||
net.WriteString("RefuseFine")
|
||||
net.SendToServer()
|
||||
end
|
||||
end )
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
function Realistic_Police.FireFox(RPTFrame)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 100
|
||||
local RPTTarget = 300
|
||||
local speed = 4
|
||||
-- 76561198219964944
|
||||
|
||||
local RPTMenu = vgui.Create("DFrame", RPTFrame)
|
||||
RPTMenu:SetSize(RpRespX*0.794, RpRespY*0.8)
|
||||
RPTMenu:SetPos(0, 0)
|
||||
RPTMenu:ShowCloseButton(false)
|
||||
RPTMenu:SetDraggable(false)
|
||||
RPTMenu:SetTitle("")
|
||||
RPTMenu.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime(), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.05 )
|
||||
end
|
||||
|
||||
local html = vgui.Create("DHTML", RPTMenu)
|
||||
html:Dock(FILL)
|
||||
html:OpenURL("https://www.google.com/")
|
||||
-- 76561198219964937
|
||||
local RPTClose = vgui.Create("DButton", RPTMenu)
|
||||
RPTClose:SetSize(RpRespX*0.0295, RpRespY*0.025)
|
||||
RPTClose:SetPos(RPTMenu:GetWide()*0.96, RPTMenu:GetTall()*0.005)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTMenu:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,206 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
surface.CreateFont("rpt_font_1", {
|
||||
font = "License Plate",
|
||||
size = 30*(ScrH()/1080),
|
||||
weight = 1000,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_2", {
|
||||
font = "License Plate",
|
||||
size = 24*(ScrH()/1080),
|
||||
weight = 1000,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_3", {
|
||||
font = "License Plate",
|
||||
size = 30*(ScrH()/1080),
|
||||
weight = 1000,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_4", {
|
||||
font = "License Plate",
|
||||
size = 24*(ScrH()/1080),
|
||||
weight = 1000,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
surface.CreateFont("rpt_font_5", {
|
||||
font = "Arial",
|
||||
size = 16.8*(ScrH()/1080),
|
||||
weight = 550,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_6", {
|
||||
font = "Circular Std Medium",
|
||||
size = 22.5*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_7", {
|
||||
font = "Circular Std Medium",
|
||||
size = ScrH()*0.021,
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_8", {
|
||||
font = "Circular Std Medium",
|
||||
size = 20*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_9", {
|
||||
font = "Circular Std Medium",
|
||||
size = 24*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_10", {
|
||||
font = "Circular Std Medium",
|
||||
size = 36*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
surface.CreateFont("rpt_font_11", {
|
||||
font = "Circular Std Medium",
|
||||
size = 21*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_12", {
|
||||
font = "Circular Std Medium",
|
||||
size = 75*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_13", {
|
||||
font = "Circular Std Medium",
|
||||
size = 45*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_14", {
|
||||
font = "Circular Std Medium",
|
||||
size = 15*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_15", {
|
||||
font = "Circular Std Medium",
|
||||
size = 24*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_16", {
|
||||
font = "Circular Std Medium",
|
||||
size = 15*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_17", {
|
||||
font = "Circular Std Medium",
|
||||
size = 21*(ScrH()/1080),
|
||||
weight = 550,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
surface.CreateFont("rpt_font_18", {
|
||||
font = "Circular Std Medium",
|
||||
size = 24*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_19", {
|
||||
font = "Circular Std Medium",
|
||||
size = 18*(ScrH()/1080),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_20", {
|
||||
font = "LEMON MILK",
|
||||
size = 20*(ScrH()/1080),
|
||||
weight = 800,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_21", {
|
||||
font = "Poiret One",
|
||||
size = 21*(ScrH()/1080),
|
||||
weight = 800,
|
||||
antialias = true,
|
||||
extended = true
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_22", {
|
||||
font = "Circular Std Medium",
|
||||
size = 180*(ScrH()/1080),
|
||||
weight = 0,
|
||||
blursize = 0,
|
||||
scanlines = 0,
|
||||
extended = true,
|
||||
shadow = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_font_23", {
|
||||
font = "Circular Std Medium",
|
||||
size = 80*(ScrH()/1080),
|
||||
weight = 0,
|
||||
blursize = 0,
|
||||
scanlines = 0,
|
||||
extended = true,
|
||||
shadow = true,
|
||||
})
|
||||
|
||||
surface.CreateFont("rpt_notify_24", {
|
||||
font = "Arial",
|
||||
size = 100*(ScrH()/1080),
|
||||
weight = 1000,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,376 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
net.Receive("RealisticPolice:HandCuff", function()
|
||||
local String = net.ReadString()
|
||||
if String == "Jailer" then
|
||||
-- Name of the Player to Jail
|
||||
local NamePlayer = net.ReadString()
|
||||
Realistic_Police.Jailer(NamePlayer)
|
||||
elseif String == "Bailer" then
|
||||
-- Open the menu of the bailer
|
||||
local RPTTable = net.ReadTable()
|
||||
Realistic_Police.Bailer(RPTTable)
|
||||
elseif String == "Inspect" then
|
||||
local Ent = net.ReadEntity()
|
||||
Realistic_Police.CheckPlayer(Ent)
|
||||
end
|
||||
end)
|
||||
|
||||
function Realistic_Police.Jailer(NamePlayer)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 20
|
||||
local RPTLFrame = vgui.Create("DFrame")
|
||||
RPTLFrame:SetSize(RpRespX*0.272, RpRespY*0.28)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:MakePopup()
|
||||
RPTLFrame:SetDraggable(false)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime(), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( w*0.003, 0, w*0.995, h*0.12 )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("arrestMenu"), "rpt_font_7", RpRespX*0.004, RpRespY*0.005, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local DermaNumSlider = vgui.Create( "DNumSlider", RPTLFrame )
|
||||
DermaNumSlider:SetPos( RpRespX*-0.16, RpRespY * 0.18 )
|
||||
DermaNumSlider:SetSize( RpRespX*0.42, RpRespY*0.01 )
|
||||
DermaNumSlider:SetText( "" )
|
||||
DermaNumSlider:SetMax( Realistic_Police.MaxDay )
|
||||
DermaNumSlider:SetDecimals( 1 )
|
||||
DermaNumSlider:SetDefaultValue ( 0 )
|
||||
DermaNumSlider:SetMin(1)
|
||||
DermaNumSlider:SetValue(1)
|
||||
DermaNumSlider.TextArea:SetVisible(false)
|
||||
function DermaNumSlider.Slider:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function DermaNumSlider.Slider.Knob:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["darkblue"] )
|
||||
draw.NoTexture()
|
||||
Realistic_Police.Circle( 0, RpRespY*0.007, 8, 1000 )
|
||||
end
|
||||
DermaNumSlider.OnValueChanged = function( panel, value )
|
||||
DButtonAccept:SetText(Realistic_Police.GetSentence("confirm").." "..math.Round(value, 0).." "..Realistic_Police.GetSentence("years"))
|
||||
end
|
||||
|
||||
local RPTDPanel = vgui.Create("DPanel", RPTLFrame)
|
||||
RPTDPanel:SetSize(RpRespX*0.251, RpRespY*0.05)
|
||||
RPTDPanel:SetPos(RpRespX*0.01, RpRespY*0.05)
|
||||
RPTDPanel:SetText(Realistic_Police.GetSentence("username2"))
|
||||
RPTDPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor(Realistic_Police.Colors["black180"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black180"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["darkblue"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("name").." : "..NamePlayer, "rpt_font_7", RpRespX*0.005, RpRespY*0.014, Realistic_Police.Colors["white"], TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local PanelCT = vgui.Create("DTextEntry", RPTLFrame)
|
||||
PanelCT:SetSize(RpRespX*0.251, RpRespY*0.05)
|
||||
PanelCT:SetPos(RpRespX*0.01, RpRespY*0.11)
|
||||
PanelCT:SetText(" "..Realistic_Police.GetSentence("infractionReason"))
|
||||
PanelCT:SetFont("rpt_font_7")
|
||||
PanelCT:SetDrawLanguageID(false)
|
||||
PanelCT.OnGetFocus = function(self)
|
||||
if PanelCT:GetText() == " "..Realistic_Police.GetSentence("infractionReason") then
|
||||
PanelCT:SetText("")
|
||||
end
|
||||
end
|
||||
PanelCT.Paint = function(self,w,h)
|
||||
surface.SetDrawColor(Realistic_Police.Colors["black"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black180"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
self:DrawTextEntryText(Realistic_Police.Colors["white"], Realistic_Police.Colors["white"], Realistic_Police.Colors["white"])
|
||||
surface.SetDrawColor( Realistic_Police.Colors["darkblue"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
PanelCT.OnLoseFocus = function(self)
|
||||
if PanelCT:GetText() == "" then
|
||||
PanelCT:SetText(" "..Realistic_Police.GetSentence("infractionReason"))
|
||||
end
|
||||
end
|
||||
PanelCT.AllowInput = function( self, stringValue )
|
||||
if string.len(PanelCT:GetValue()) >= 1000 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
DButtonAccept = vgui.Create("DButton", RPTLFrame)
|
||||
DButtonAccept:SetSize(RpRespX*0.253, RpRespY*0.05)
|
||||
DButtonAccept:SetPos(RpRespX*0.01, RpRespY*0.21)
|
||||
DButtonAccept:SetText(Realistic_Police.GetSentence("confirm"))
|
||||
DButtonAccept:SetFont("rpt_font_9")
|
||||
DButtonAccept:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonAccept.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["green"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
DButtonAccept.DoClick = function()
|
||||
if PanelCT:GetText() != " "..Realistic_Police.GetSentence("infractionReason") then
|
||||
net.Start("RealisticPolice:HandCuff")
|
||||
net.WriteString("ArrestPlayer")
|
||||
net.WriteUInt(DermaNumSlider:GetValue(), 10)
|
||||
net.WriteString(PanelCT:GetText())
|
||||
net.SendToServer()
|
||||
RPTLFrame:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.885, RPTLFrame:GetTall()*0.008)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.Bailer(RPTTable)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 20
|
||||
|
||||
if IsValid(RPTLFrame) then RPTLFrame:Remove() end
|
||||
RPTLFrame = vgui.Create("DFrame")
|
||||
RPTLFrame:SetSize(RpRespX*0.2746, RpRespY*0.355)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:SetDraggable(false)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame:MakePopup()
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( w*0.003, 0, w*0.995, h*0.10 )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("arrestedPlayersList"), "rpt_font_7", RpRespX*0.003, RpRespY*0.005, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTLFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.2695, RpRespY*0.31)
|
||||
RPTScroll:SetPos(RpRespX*0.0029, RpRespY*0.04)
|
||||
RPTScroll.Paint = function() end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(5,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
for k,v in pairs(RPTTable) do
|
||||
RPTDPanel2 = vgui.Create("DPanel", RPTScroll)
|
||||
RPTDPanel2:SetSize(0, RpRespY*0.1)
|
||||
RPTDPanel2:Dock(TOP)
|
||||
RPTDPanel2:DockMargin(0, 0, 0, 5)
|
||||
RPTDPanel2.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
draw.SimpleText(Realistic_Police.GetSentence("name").." : "..v.vName, "rpt_font_9", RpRespX*0.06, RpRespY * 0.012, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
draw.SimpleText(Realistic_Police.GetSentence("reason").." : "..v.vMotif, "rpt_font_9", RpRespX*0.06, RpRespY * 0.039, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
draw.SimpleText(Realistic_Police.GetSentence("price").." : "..DarkRP.formatMoney(v.vPrice), "rpt_font_9", RpRespX*0.06, RpRespY * 0.066, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTPanelB = vgui.Create("DModelPanel", RPTDPanel2)
|
||||
RPTPanelB:SetSize(RpRespX*0.05, RpRespX*0.05)
|
||||
RPTPanelB:SetPos(RpRespX*0.003,RpRespY*0.007)
|
||||
RPTPanelB.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
local RPTModel = vgui.Create("DModelPanel", RPTDPanel2)
|
||||
RPTModel:SetSize(RpRespX*0.05, RpRespX*0.05)
|
||||
RPTModel:SetPos(RpRespX*0.003,RpRespY*0.007)
|
||||
RPTModel:SetModel(v.vModel)
|
||||
function RPTModel:LayoutEntity( Entity ) return end
|
||||
local headpos = RPTModel.Entity:GetBonePosition(RPTModel.Entity:LookupBone("ValveBiped.Bip01_Head1"))
|
||||
RPTModel:SetLookAt(headpos)
|
||||
RPTModel:SetCamPos(headpos-Vector(-15, 0, 0))
|
||||
local RPTButtonPay = vgui.Create("DButton", RPTDPanel2)
|
||||
RPTButtonPay:SetSize(RpRespX*0.05, RpRespX*0.04)
|
||||
RPTButtonPay:SetPos(RpRespX*0.215, RpRespY * 0.015)
|
||||
RPTButtonPay:SetText(Realistic_Police.GetSentence("pay"))
|
||||
RPTButtonPay:SetTextColor(Realistic_Police.Colors["white"])
|
||||
RPTButtonPay:SetFont("rpt_font_10")
|
||||
RPTButtonPay.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTButtonPay.DoClick = function()
|
||||
net.Start("RealisticPolice:HandCuff")
|
||||
net.WriteString("Bailer")
|
||||
net.WriteEntity(v.vEnt)
|
||||
net.WriteUInt(k, 10)
|
||||
net.SendToServer()
|
||||
RPTLFrame:Remove()
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.885, RPTLFrame:GetTall()*0.008)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.CheckPlayer(Player, Table)
|
||||
if not Realistic_Police.CanConfiscateWeapon then return end
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 20
|
||||
|
||||
if IsValid(RPTLFrame) then RPTLFrame:Remove() end
|
||||
RPTLFrame = vgui.Create("DFrame")
|
||||
RPTLFrame:SetSize(RpRespX*0.2746, RpRespY*0.355)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:SetDraggable(false)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame:MakePopup()
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( w*0.003, 0, w*0.995, h*0.1 )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("weaponsList"), "rpt_font_7", RpRespX*0.003, RpRespY*0.005, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTLFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.2695, RpRespY*0.31)
|
||||
RPTScroll:SetPos(RpRespX*0.0029, RpRespY*0.04)
|
||||
RPTScroll.Paint = function() end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(5,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
local List = vgui.Create( "DIconLayout", RPTScroll )
|
||||
List:Dock( FILL )
|
||||
List:SetSpaceY( 5 )
|
||||
List:SetSpaceX( 5 )
|
||||
|
||||
local ListItem = {}
|
||||
|
||||
for k, v in pairs(Player:GetWeapons()) do
|
||||
if not IsValid(v) then continue end
|
||||
|
||||
local mdl = v:GetModel()
|
||||
local class = v:GetClass()
|
||||
|
||||
if not Realistic_Police.CantConfiscate[class] then
|
||||
local name = v:GetPrintName()
|
||||
ListItem[k] = List:Add("SpawnIcon")
|
||||
ListItem[k]:SetSize( RpRespX*0.087, RpRespX*0.087 )
|
||||
ListItem[k]:SetModel(mdl)
|
||||
ListItem[k]:SetTooltip( false )
|
||||
ListItem[k].PaintOver = function(self, w,h)
|
||||
surface.SetDrawColor(Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
draw.DrawText(name, "rpt_font_8", w/2, h*0.3, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
|
||||
local DButton1 = vgui.Create("DButton", ListItem[k])
|
||||
DButton1:SetSize(RpRespX*0.087, RpRespY*0.025)
|
||||
DButton1:SetPos(0,RpRespY*0.129)
|
||||
DButton1.PaintOver = function(self, w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("confiscate"), "rpt_font_7", w/2, h/8, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
DButton1.DoClick = function()
|
||||
ListItem[k]:Remove()
|
||||
|
||||
net.Start("RealisticPolice:HandCuff")
|
||||
net.WriteString("StripWeapon")
|
||||
net.WriteEntity(Player)
|
||||
net.WriteString(class, 10)
|
||||
net.SendToServer()
|
||||
surface.PlaySound("UI/buttonclick.wav")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.885, RPTLFrame:GetTall()*0.008)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,201 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
function Realistic_Police.GetVehicleLicense(String)
|
||||
local TableVehicle = {}
|
||||
for k,v in pairs(ents.GetAll()) do
|
||||
if string.StartWith(string.Replace(string.upper(v:GetNWString("rpt_plate")), " ", ""), string.Replace(string.upper(String), " ", "")) or string.Replace(v:GetNWString("rpt_plate"), " ", "") == string.Replace(string.upper(String), " ", "") then
|
||||
local t = list.Get("Vehicles")[v:GetVehicleClass()]
|
||||
|
||||
TableVehicle[#TableVehicle + 1] = {
|
||||
ModelVehc = v:GetModel(),
|
||||
NameVehc = t.Name,
|
||||
Plate = v:GetNWString("rpt_plate"),
|
||||
VOwner = v:CPPIGetOwner():Name(),
|
||||
}
|
||||
end
|
||||
end
|
||||
return TableVehicle
|
||||
end
|
||||
function Realistic_Police.License()
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 10
|
||||
|
||||
local RPTLFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTLFrame:SetSize(RpRespX*0.18285, RpRespY*0.1397)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:SetDraggable(true)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15200"].r, Realistic_Police.Colors["black15200"].g, Realistic_Police.Colors["black15200"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.2 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("licenseplate"), "rpt_font_7", RpRespX*0.003, RpRespY*0.002, Color(220, 220, 220, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
function RPTLFrame:OnMousePressed()
|
||||
RPTLFrame:RequestFocus()
|
||||
local screenX, screenY = self:LocalToScreen( 0, 0 )
|
||||
if ( self.m_bSizable && gui.MouseX() > ( screenX + self:GetWide() - 20 ) && gui.MouseY() > ( screenY + self:GetTall() - 20 ) ) then
|
||||
self.Sizing = { gui.MouseX() - self:GetWide(), gui.MouseY() - self:GetTall() }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
if ( self:GetDraggable() && gui.MouseY() < ( screenY + 24 ) ) then
|
||||
self.Dragging = { gui.MouseX() - self.x, gui.MouseY() - self.y }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local RPTEntry = vgui.Create("DTextEntry", RPTLFrame)
|
||||
RPTEntry:SetSize(RpRespX*0.18, RpRespY*0.05)
|
||||
RPTEntry:SetPos(RpRespX*0.002, RpRespY*0.033)
|
||||
RPTEntry:SetText(Realistic_Police.GetSentence("licenseplate"))
|
||||
RPTEntry:SetFont("rpt_font_7")
|
||||
RPTEntry:SetDrawLanguageID(false)
|
||||
RPTEntry.OnGetFocus = function(self) RPTEntry:SetText("") end
|
||||
RPTEntry.OnLoseFocus = function(self)
|
||||
if RPTEntry:GetText() == "" then
|
||||
RPTEntry:SetText(Realistic_Police.GetSentence("licenseplate"))
|
||||
end
|
||||
end
|
||||
RPTEntry.AllowInput = function( self, stringValue )
|
||||
if string.len(RPTEntry:GetValue()) > 10 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local RPTAccept = vgui.Create("DButton", RPTLFrame)
|
||||
RPTAccept:SetSize(RpRespX*0.1795, RpRespY*0.05)
|
||||
RPTAccept:SetPos(RpRespX*0.00207, RpRespY*0.086)
|
||||
RPTAccept:SetText(Realistic_Police.GetSentence("search"))
|
||||
RPTAccept:SetFont("rpt_font_7")
|
||||
RPTAccept:SetTextColor(Realistic_Police.Colors["white"])
|
||||
RPTAccept.Paint = function(self,w,h)
|
||||
if RPTAccept:IsHovered() then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
end
|
||||
RPTAccept.DoClick = function()
|
||||
if not IsValid(RPTEntry) then return end
|
||||
|
||||
Realistic_Police.Clic()
|
||||
-- 76561198219964937
|
||||
|
||||
local plate = Realistic_Police.GetVehicleLicense(RPTEntry:GetValue())
|
||||
if istable(plate) && #plate > 0 then
|
||||
if IsValid(RPTLFrame) then RPTLFrame:Remove() end
|
||||
|
||||
local RPTLFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTLFrame:SetSize(RpRespX*0.3, RpRespY*0.188)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:SetDraggable(true)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15200"].r, Realistic_Police.Colors["black15200"].g, Realistic_Police.Colors["black15200"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.15 )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("licenseplate"), "rpt_font_7", RpRespX*0.005, RpRespY*0.002, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local DScroll = vgui.Create("DScrollPanel", RPTLFrame)
|
||||
DScroll:SetSize(RpRespX*0.295, RpRespY*0.15)
|
||||
DScroll:SetPos(RpRespX*0.003, RpRespY*0.033)
|
||||
DScroll.Paint = function() end
|
||||
local sbar = DScroll:GetVBar()
|
||||
sbar:SetSize(10,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
for k,v in pairs(Realistic_Police.GetVehicleLicense(RPTEntry:GetValue())) do
|
||||
local DPanel = vgui.Create("DPanel", DScroll)
|
||||
DPanel:SetSize(0, RpRespY*0.15)
|
||||
DPanel:Dock(TOP)
|
||||
DPanel:DockMargin(0, 0, 0, 5)
|
||||
DPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
draw.DrawText("☑ "..v.VOwner, "rpt_font_11", RpRespX*0.18, RpRespY*0.04, Realistic_Police.Colors["white"], TEXT_ALIGN_LEFT)
|
||||
draw.DrawText("☑ "..v.Plate, "rpt_font_11", RpRespX*0.18, RpRespY*0.07, Realistic_Police.Colors["white"], TEXT_ALIGN_LEFT)
|
||||
draw.DrawText("☑ "..v.NameVehc, "rpt_font_11", RpRespX*0.18, RpRespY*0.1, Realistic_Police.Colors["white"], TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTCarModel = vgui.Create( "DModelPanel", DPanel )
|
||||
RPTCarModel:SetPos( ScrW()*0.01, ScrH()*0.0298 )
|
||||
RPTCarModel:SetSize( ScrW()*0.15, ScrH()*0.13 )
|
||||
RPTCarModel:SetFOV(70)
|
||||
RPTCarModel:SetCamPos(Vector(200, 0, 20))
|
||||
RPTCarModel:SetModel( v.ModelVehc )
|
||||
function RPTCarModel:LayoutEntity( ent ) end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.0245)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.897, RPTLFrame:GetTall()*0.013)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
else
|
||||
RPTEntry:SetText(Realistic_Police.GetSentence("noVehiclesFound"))
|
||||
timer.Simple(1, function()
|
||||
if IsValid(RPTEntry) then
|
||||
RPTEntry:SetText(Realistic_Police.GetSentence("licenseplate"))
|
||||
end
|
||||
end )
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.0245)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.83, RPTLFrame:GetTall()*0.0175)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
net.Receive("RealisticPolice:Report", function()
|
||||
local RPTNumber = net.ReadInt(32)
|
||||
local RPTInformationDecompress = util.Decompress(net.ReadData(RPTNumber))
|
||||
RPTTableListReport = util.JSONToTable(RPTInformationDecompress) or {}
|
||||
end )
|
||||
-- dcb587233a6e567b06ae4da5655e3e9649694e7946f4d648e8f3181d8bc95b5f
|
||||
function Realistic_Police.ListReport(RPTFrame, RPTEntComputer)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 20
|
||||
|
||||
local RPTLFrame = vgui.Create("DFrame", RPTFrame)
|
||||
RPTLFrame:SetSize(RpRespX*0.2746, RpRespY*0.41)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:SetDraggable(true)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( w*0.003, 0, w*0.995, h*0.085 )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("username2"), "rpt_font_7", RpRespX*0.003, RpRespY*0.005, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
function RPTLFrame:OnMousePressed()
|
||||
RPTLFrame:RequestFocus()
|
||||
local screenX, screenY = self:LocalToScreen( 0, 0 )
|
||||
if ( self.m_bSizable && gui.MouseX() > ( screenX + self:GetWide() - 20 ) && gui.MouseY() > ( screenY + self:GetTall() - 20 ) ) then
|
||||
self.Sizing = { gui.MouseX() - self:GetWide(), gui.MouseY() - self:GetTall() }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
if ( self:GetDraggable() && gui.MouseY() < ( screenY + 24 ) ) then
|
||||
self.Dragging = { gui.MouseX() - self.x, gui.MouseY() - self.y }
|
||||
self:MouseCapture( true )
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTLFrame)
|
||||
RPTScroll:SetSize(RpRespX*0.2695, RpRespY*0.31)
|
||||
RPTScroll:SetPos(RpRespX*0.0029, RpRespY*0.095)
|
||||
RPTScroll.Paint = function() end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(5,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
local RPTComboBox = vgui.Create("DComboBox", RPTLFrame)
|
||||
RPTComboBox:SetSize(RpRespX*0.269, RpRespY*0.05)
|
||||
RPTComboBox:SetText(Realistic_Police.GetSentence("username2"))
|
||||
RPTComboBox:SetFont("rpt_font_9")
|
||||
RPTComboBox:SetTextColor(Realistic_Police.Colors["black"])
|
||||
RPTComboBox:SetPos(RpRespX*0.003, RpRespY*0.04)
|
||||
local isSBUComputer = IsValid(RPTEntComputer) and RPTEntComputer.IsSBU and RPTEntComputer:IsSBU()
|
||||
for k,v in pairs(player.GetAll()) do
|
||||
local targetChar = v.GetCharacter and v:GetCharacter()
|
||||
if targetChar then
|
||||
local faction = targetChar:GetFaction()
|
||||
if isSBUComputer then
|
||||
if faction != (FACTION_UKRAINE or -1) then continue end
|
||||
else
|
||||
if faction == (FACTION_UKRAINE or -1) then continue end
|
||||
end
|
||||
end
|
||||
RPTComboBox:AddChoice( v:Name(), v )
|
||||
end
|
||||
RPTComboBox.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray240"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function RPTComboBox:OnSelect( index, text, data )
|
||||
|
||||
if IsValid(RPTScroll) then
|
||||
RPTScroll:Clear()
|
||||
end
|
||||
|
||||
local SendPlayer = nil
|
||||
if IsValid(data) then
|
||||
SendPlayer = data
|
||||
end
|
||||
|
||||
net.Start("RealisticPolice:Report")
|
||||
net.WriteUInt(1, 10)
|
||||
net.WriteString("SendInformation")
|
||||
net.WriteEntity(SendPlayer)
|
||||
net.SendToServer()
|
||||
|
||||
timer.Create("rptactualize", 0.2, 0, function()
|
||||
if IsValid(RPTScroll) then
|
||||
RPTScroll:Clear()
|
||||
end
|
||||
if IsValid(RPTScroll) then
|
||||
if istable(RPTTableListReport) then
|
||||
for k,v in pairs(RPTTableListReport) do
|
||||
local RPTDPanel2 = vgui.Create("DPanel", RPTScroll)
|
||||
RPTDPanel2:SetSize(0, RpRespY*0.1)
|
||||
RPTDPanel2:Dock(TOP)
|
||||
RPTDPanel2:DockMargin(0, 0, 0, 5)
|
||||
RPTDPanel2.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
draw.SimpleText(Realistic_Police.GetSentence("prosecutor").." : "..v.RPTPolice, "rpt_font_9", RpRespX*0.06, RpRespY * 0.012, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
draw.SimpleText(Realistic_Police.GetSentence("accused").." : "..v.RPTCriminal, "rpt_font_9", RpRespX*0.06, RpRespY * 0.039, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
draw.SimpleText(Realistic_Police.GetSentence("date").." : "..v.RPTDate, "rpt_font_9", RpRespX*0.06, RpRespY * 0.066, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local RPTPanelB = vgui.Create("DModelPanel", RPTDPanel2)
|
||||
RPTPanelB:SetSize(RpRespX*0.05, RpRespX*0.05)
|
||||
RPTPanelB:SetPos(RpRespX*0.003,RpRespY*0.007)
|
||||
RPTPanelB.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
if v.Model == "" then
|
||||
draw.SimpleText("?", "rpt_font_13", RPTPanelB:GetWide()/2, RPTPanelB:GetTall()/2, Realistic_Police.Colors["white240"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
|
||||
if v.Model != "" then
|
||||
local RPTModel = vgui.Create("DModelPanel", RPTDPanel2)
|
||||
RPTModel:SetSize(RpRespX*0.05, RpRespX*0.05)
|
||||
RPTModel:SetPos(RpRespX*0.003,RpRespY*0.007)
|
||||
RPTModel:SetModel(v.Model)
|
||||
function RPTModel:LayoutEntity( Entity ) return end
|
||||
if RPTModel.Entity:LookupBone("ValveBiped.Bip01_Head1") != nil then
|
||||
local headpos = RPTModel.Entity:GetBonePosition(RPTModel.Entity:LookupBone("ValveBiped.Bip01_Head1"))
|
||||
RPTModel:SetLookAt(headpos)
|
||||
RPTModel:SetCamPos(headpos-Vector(-15, 0, 0))
|
||||
end
|
||||
end
|
||||
|
||||
local RPTButtonRead = vgui.Create("DButton", RPTDPanel2)
|
||||
RPTButtonRead:SetSize(RpRespX*0.05, RpRespX*0.04)
|
||||
RPTButtonRead:SetPos(RpRespX*0.215, RpRespY * 0.015)
|
||||
RPTButtonRead:SetText(Realistic_Police.GetSentence("see"))
|
||||
RPTButtonRead:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
RPTButtonRead:SetFont("rpt_font_10")
|
||||
RPTButtonRead.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTButtonRead.DoClick = function()
|
||||
Realistic_Police.ReportMenu(RPTFrame, RPTTableListReport[k], SendPlayer, k)
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.885, RPTLFrame:GetTall()*0.008)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,728 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
-- Information of the License Plate Position
|
||||
net.Receive("RealisticPolice:SendInformation", function()
|
||||
RPTInformationVehicle = {}
|
||||
local Number = net.ReadInt(32)
|
||||
local RPTInformationDecompress = util.Decompress(net.ReadData(Number)) or ""
|
||||
local RPTTable = util.JSONToTable(RPTInformationDecompress)
|
||||
|
||||
RPTInformationVehicle = Realistic_Police.BaseVehicles
|
||||
|
||||
if istable(util.JSONToTable(RPTInformationDecompress)) then
|
||||
table.Merge(RPTInformationVehicle, util.JSONToTable(RPTInformationDecompress))
|
||||
end
|
||||
end )
|
||||
|
||||
local FontTable = {}
|
||||
function Realistic_Police.Fonts(SizeId, fontName)
|
||||
if table.HasValue(FontTable, "rpt_generate"..math.Round( SizeId, 0 )) then
|
||||
return "rpt_generate"..math.Round( SizeId, 0 )
|
||||
end
|
||||
local succ, err = pcall(function()
|
||||
local font = "License Plate"
|
||||
if isstring(fontName) then
|
||||
font = fontName
|
||||
end
|
||||
|
||||
surface.CreateFont("rpt_generate"..math.Round( SizeId, 0 ), {
|
||||
font = font,
|
||||
size = math.Round( SizeId, 0 ),
|
||||
weight = 800,
|
||||
antialias = true,
|
||||
extended = true,
|
||||
})
|
||||
table.insert(FontTable, "rpt_generate"..math.Round( SizeId, 0 ))
|
||||
end)
|
||||
return succ and "rpt_generate"..math.Round( SizeId, 0 ) or "rpt_notify_24"
|
||||
end
|
||||
|
||||
function Realistic_Police.Circle( x, y, radius, seg )
|
||||
local cir = {}
|
||||
table.insert( cir, { x = x, y = y, u = 0.5, v = 0.5 } )
|
||||
for i = 0, seg do
|
||||
local a = math.rad( ( i / seg ) * -360 )
|
||||
table.insert( cir, { x = x + math.sin( a ) * radius, y = y + math.cos( a ) * radius, u = math.sin( a ) / 2 + 0.5, v = math.cos( a ) / 2 + 0.5 } )
|
||||
end
|
||||
local a = math.rad( 0 )
|
||||
table.insert( cir, { x = x + math.sin( a ) * radius, y = y + math.cos( a ) * radius, u = math.sin( a ) / 2 + 0.5, v = math.cos( a ) / 2 + 0.5 } )
|
||||
surface.DrawPoly( cir )
|
||||
end
|
||||
|
||||
local function CreateNumSlider(id, x, y, panel, min, max)
|
||||
local TableSlider = {
|
||||
[1] = Realistic_Police.GetSentence("moveX"),
|
||||
[2] = Realistic_Police.GetSentence("moveY"),
|
||||
[3] = Realistic_Police.GetSentence("moveZ"),
|
||||
[4] = Realistic_Police.GetSentence("rotateX"),
|
||||
[5] = Realistic_Police.GetSentence("rotateY"),
|
||||
[6] = Realistic_Police.GetSentence("rotateZ"),
|
||||
[7] = Realistic_Police.GetSentence("width"),
|
||||
[8] = Realistic_Police.GetSentence("height"),
|
||||
}
|
||||
|
||||
local W,H = ScrW(), ScrH()
|
||||
DermaNumSlider = vgui.Create( "DNumSlider", panel )
|
||||
DermaNumSlider:SetPos( W*x, H*y )
|
||||
DermaNumSlider:SetSize( W*0.25, H*0.01 )
|
||||
DermaNumSlider:SetText( "" )
|
||||
DermaNumSlider:SetMin( min )
|
||||
DermaNumSlider:SetMax( max )
|
||||
DermaNumSlider:SetDecimals( 0 )
|
||||
DermaNumSlider:SetDefaultValue ( 1 )
|
||||
function DermaNumSlider.Slider:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black13"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function DermaNumSlider.Slider.Knob:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black"] )
|
||||
draw.NoTexture()
|
||||
Realistic_Police.Circle( 0, H*0.007, 8, 1000 )
|
||||
end
|
||||
DermaNumSlider.OnValueChanged = function( panel, value )
|
||||
if RPTStepID == 2 then
|
||||
RPTPosition[id] = value
|
||||
elseif RPTStepID == 3 then
|
||||
RPTPosition2[id] = value
|
||||
end
|
||||
end
|
||||
|
||||
local PosX, PosY = DermaNumSlider:GetPos()
|
||||
if id > 0 && id < 4 or id == 7 then
|
||||
local DLabel = vgui.Create( "DLabel", panel )
|
||||
DLabel:SetSize(W*0.3, H*0.02)
|
||||
DLabel:SetPos( DermaNumSlider:GetWide()*0.052, PosY - H *0.03)
|
||||
DLabel:SetText( TableSlider[id] )
|
||||
DLabel:SetFont("rpt_font_18")
|
||||
elseif id != 7 then
|
||||
local DLabel = vgui.Create( "DLabel", panel )
|
||||
DLabel:SetSize(W*0.3, H*0.02)
|
||||
DLabel:SetPos( DermaNumSlider:GetWide()*0.66, PosY - H *0.03)
|
||||
DLabel:SetText( TableSlider[id] )
|
||||
DLabel:SetFont("rpt_font_18")
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.Clic()
|
||||
surface.PlaySound("rptsound2.mp3")
|
||||
end
|
||||
|
||||
local function RPTComputerView(ply, pos, angles, fov)
|
||||
local view = {}
|
||||
view.origin = pos
|
||||
view.angles = angles
|
||||
view.fov = fov
|
||||
view.drawviewer = true
|
||||
return view
|
||||
end
|
||||
|
||||
function Realistic_Police.OpenMenu(RPTEntComputer, BoolTablet)
|
||||
Realistic_Police.CurrentComputer = RPTEntComputer
|
||||
if IsValid(RPTBaseFrame) then RPTBaseFrame:Remove() end
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
|
||||
local RPTAngle = RPTEntComputer:GetAngles() + Angle(-RPTEntComputer:GetAngles().pitch * 2, 180,-RPTEntComputer:GetAngles().roll *2)
|
||||
local RPTAng = RPTEntComputer:GetAngles()
|
||||
local RPTPos = RPTEntComputer:GetPos() + RPTAng:Up() * 19.5 + RPTAng:Right() * -1 + RPTAng:Forward() * 8
|
||||
local RPTStartTime = CurTime()
|
||||
|
||||
local RPTValue = 300
|
||||
local RPTTarget = 200
|
||||
local speed = 40
|
||||
local Timer = 1.1
|
||||
|
||||
local Hours = os.date("%H:%M", os.time())
|
||||
hook.Add("CalcView", "RPTCalcView", function(ply, pos, angles, fov)
|
||||
local FOV = 90
|
||||
if not BoolTablet then
|
||||
if RPTInt != 0 then
|
||||
RPTAngleOrigin = LerpVector( math.Clamp(CurTime()-RPTStartTime,0,1), LocalPlayer():EyePos(), RPTPos)
|
||||
RPTAngleAngles = LerpAngle( math.Clamp(CurTime()-RPTStartTime,0,1), LocalPlayer():GetAngles(), RPTAngle)
|
||||
FOV = 90
|
||||
else
|
||||
RPTAngleOrigin = pos
|
||||
RPTAngleAngles = angles
|
||||
FOV = fov
|
||||
end
|
||||
return RPTComputerView(LocalPlayer(), RPTAngleOrigin, RPTAngleAngles, FOV)
|
||||
end
|
||||
end )
|
||||
|
||||
RPTBaseFrame = vgui.Create("DFrame")
|
||||
RPTBaseFrame:SetSize(RpRespX, RpRespY)
|
||||
RPTBaseFrame:MakePopup()
|
||||
RPTBaseFrame:ShowCloseButton(false)
|
||||
RPTBaseFrame:SetDraggable(false)
|
||||
RPTBaseFrame:SetTitle("")
|
||||
LocalPlayer():SetNoDraw(true)
|
||||
RPTBaseFrame.Paint = function(self,w,h)
|
||||
if BoolTablet then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material10"] )
|
||||
surface.DrawTexturedRect( RpRespX*0.0625, RpRespY*0.025, w*0.865, h*0.89 )
|
||||
end
|
||||
end
|
||||
if BoolTablet then
|
||||
Timer = 0
|
||||
end
|
||||
timer.Simple(Timer, function()
|
||||
RPTFrame = vgui.Create("DPanel", RPTBaseFrame)
|
||||
RPTFrame:SetSize(RpRespX*0.794, RpRespY*0.793)
|
||||
RPTFrame:SetPos(RpRespX*0.1, RpRespY*0.06)
|
||||
RPTFrame.Paint = function(self,w,h)
|
||||
if not BoolTablet then
|
||||
local isSBU = IsValid(RPTEntComputer) and RPTEntComputer.IsSBU and RPTEntComputer:IsSBU()
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.SetMaterial( isSBU and Realistic_Police.Colors["Material2_SBU"] or Realistic_Police.Colors["Material2"] )
|
||||
surface.DrawTexturedRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white200"] )
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material3"] )
|
||||
surface.DrawTexturedRect( RpRespX*0.015, RpRespY*0.73, w*0.9713, h*0.0555 )
|
||||
draw.SimpleText(Hours, "rpt_font_15", RpRespX*0.764, RpRespY*0.738, Realistic_Police.Colors["white"], 1, 0)
|
||||
end
|
||||
|
||||
for k,v in pairs(Realistic_Police.Application) do
|
||||
if k >= 99 then break end
|
||||
local row = math.floor((k - 1)/7)
|
||||
local rowmarge = row * RpRespY
|
||||
local colum = k - (row * RpRespY*0.02)
|
||||
local colmarge = (colum * 464) - 464
|
||||
|
||||
local Buttons = vgui.Create("DButton", RPTFrame)
|
||||
Buttons:SetSize(RpRespX*0.047,RpRespX*0.047)
|
||||
Buttons:SetPos(RpRespX*0.013 + rowmarge, RpRespY*0.092 * colum - RpRespY*0.08)
|
||||
Buttons:SetText("")
|
||||
Buttons.Paint = function(self,w,h)
|
||||
if self:IsHovered() then
|
||||
RPTValue = Lerp( speed * FrameTime( ), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"].r, Realistic_Police.Colors["white"].g, Realistic_Police.Colors["white"].b, RPTValue )
|
||||
surface.SetMaterial( v.Materials )
|
||||
surface.DrawTexturedRect( 5, 5, w - 15, h - 15 )
|
||||
else
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.SetMaterial( v.Materials )
|
||||
surface.DrawTexturedRect( 5, 5, w - 15, h - 15 )
|
||||
end
|
||||
end
|
||||
Buttons.DoClick = function()
|
||||
Realistic_Police.Clic()
|
||||
if Realistic_Police.OpenComputer[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
v.Function(RPTFrame, RPTEntComputer)
|
||||
end
|
||||
if Realistic_Police.HackerJob[Realistic_Police.GetPlayerJob(LocalPlayer())] && RPTEntComputer:GetNWBool("rpt_hack") or v.Type == "hacker" then
|
||||
v.Function(RPTFrame, RPTEntComputer)
|
||||
elseif not Realistic_Police.OpenComputer[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("computerMustBeHacked"))
|
||||
end
|
||||
end
|
||||
|
||||
local appName = v.Name
|
||||
if appName == "Терминал ФСБ" then
|
||||
appName = Realistic_Police.GetSentence("terminalName")
|
||||
end
|
||||
|
||||
local DLabel = vgui.Create( "DLabel", RPTFrame )
|
||||
DLabel:SetSize(RpRespX*0.08, RpRespY*0.01)
|
||||
DLabel:SetPos(-7 + rowmarge, RpRespY*0.092 * colum)
|
||||
DLabel:SetText( appName )
|
||||
DLabel:SetFont("rpt_font_14")
|
||||
DLabel:SetContentAlignment(5)
|
||||
DLabel:SetTextColor(Realistic_Police.Colors["gray"])
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTFrame)
|
||||
RPTClose:SetSize(RpRespX*0.021,RpRespX*0.0199)
|
||||
RPTClose:SetPos(RpRespX*0.018, RPTFrame:GetTall()*0.928)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.DoClick = function()
|
||||
RPTBaseFrame:Remove()
|
||||
LocalPlayer():SetNoDraw(false)
|
||||
Realistic_Police.Clic()
|
||||
hook.Remove("CalcView", "RPTCalcView")
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteString("DontShowCamera")
|
||||
net.SendToServer()
|
||||
end
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white150"] )
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material6"] )
|
||||
surface.DrawTexturedRect( 0, 0, w, h )
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
net.Receive("RealisticPolice:SetupVehicle", function()
|
||||
if not Realistic_Police.AdminRank[LocalPlayer():GetUserGroup()] then return end
|
||||
local W,H = ScrW(), ScrH()
|
||||
local Ent = net.ReadEntity()
|
||||
local TableToSave = {}
|
||||
|
||||
if IsValid(RPTMain) then RPTMain:Remove() end
|
||||
RPTMain = vgui.Create("DFrame")
|
||||
RPTMain:SetSize(W*0.3, H*0.36)
|
||||
RPTMain:SetPos(W*0.35, H*0.65)
|
||||
RPTMain:SetTitle("")
|
||||
RPTMain:ShowCloseButton(false)
|
||||
RPTMain.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black49"] )
|
||||
surface.DrawRect( 0, 0, w, h/1.95 )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black49"] )
|
||||
surface.DrawRect( 0, h/1.90, w, h/5 )
|
||||
end
|
||||
-- Right Sliders
|
||||
CreateNumSlider(4, 0.06,0.05, RPTMain,-200, 200)
|
||||
CreateNumSlider(5, 0.06, 0.10, RPTMain,-200, 200)
|
||||
CreateNumSlider(6, 0.06, 0.15, RPTMain,-200, 200)
|
||||
-- Left Sliders
|
||||
CreateNumSlider(1,-0.09,0.05, RPTMain,-100, 100)
|
||||
CreateNumSlider(2, -0.09, 0.10, RPTMain,-100, 100)
|
||||
CreateNumSlider(3, -0.09, 0.15, RPTMain,-100, 100)
|
||||
-- Back Sliders
|
||||
CreateNumSlider(8, 0.06, 0.235, RPTMain, -200, 1000)
|
||||
CreateNumSlider(7, -0.09, 0.235, RPTMain, -1200, 1200)
|
||||
|
||||
local Save = vgui.Create("DButton", RPTMain)
|
||||
Save:SetSize(W*0.3, H*0.07)
|
||||
Save:SetPos(0,RPTMain:GetTall()*0.74)
|
||||
Save:SetText(string.upper(Realistic_Police.GetSentence("save")))
|
||||
Save:SetFont("rpt_font_18")
|
||||
Save:SetTextColor(Realistic_Police.Colors["white200"])
|
||||
Save.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["green"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
Save.DoClick = function()
|
||||
if not isvector(PosPlate) && not isangle(AngleEnt) then return end
|
||||
local VectorEnt = PosPlate + Vector(RPTPosition[1],RPTPosition[2],RPTPosition[3])
|
||||
local AngleEnt = AngPlate + Angle(RPTPosition[4],RPTPosition[5],RPTPosition[6])
|
||||
local pos = Ent:WorldToLocal(VectorEnt)
|
||||
|
||||
local VectorEnt2 = nil
|
||||
local AngleEnt2 = nil
|
||||
local pos2 = nil
|
||||
if isvector(PosPlate2) && isangle(AngPlate2) then
|
||||
VectorEnt2 = PosPlate2 + Vector(RPTPosition2[1],RPTPosition2[2],RPTPosition2[3])
|
||||
AngleEnt2 = AngPlate2 + Angle(RPTPosition2[4],RPTPosition2[5],RPTPosition2[6])
|
||||
pos2 = Ent:WorldToLocal(VectorEnt2)
|
||||
end
|
||||
|
||||
TableToSave[Ent:GetModel()] = {
|
||||
Plate1 = {
|
||||
PlateVector = pos,
|
||||
PlateAngle = AngleEnt,
|
||||
PlateSizeW = 1400 + RPTPosition[7],
|
||||
PlateSizeH = 400 + RPTPosition[8],
|
||||
},
|
||||
Plate2 = {
|
||||
PlateVector = pos2,
|
||||
PlateAngle = AngleEnt2,
|
||||
PlateSizeW = 1400 + RPTPosition2[7],
|
||||
PlateSizeH = 400 + RPTPosition2[8],
|
||||
},
|
||||
}
|
||||
if PosPlate2 == nil or AngPlate2 == nil then
|
||||
TableToSave[Ent:GetModel()]["Plate2"] = nil
|
||||
end
|
||||
|
||||
net.Start("RealisticPolice:SetupVehicle")
|
||||
net.WriteTable(TableToSave)
|
||||
net.WriteEntity(Ent)
|
||||
net.SendToServer()
|
||||
|
||||
RPTMain:Remove()
|
||||
PosPlate = nil
|
||||
RPTToolSetup = false
|
||||
RPTStepID = 1
|
||||
VectorEnt2 = nil
|
||||
AngleEnt2 = nil
|
||||
pos2 = nil
|
||||
|
||||
RPTPosition = {}
|
||||
RPTPosition2 = {}
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end )
|
||||
function Realistic_Police.PoliceTrunk()
|
||||
local RespX, RespY = ScrW(), ScrH()
|
||||
if IsValid(Frame) then Frame:Remove() end
|
||||
if IsValid(RPTEGhostent) then RPTEGhostent:Remove() end
|
||||
RealisticPoliceGhost = false
|
||||
RealisticPoliceModel = nil
|
||||
Frame = vgui.Create("DFrame")
|
||||
Frame:SetSize(RespX*0.289, RespX*0.08)
|
||||
Frame:MakePopup()
|
||||
Frame:SetDraggable(false)
|
||||
Frame:ShowCloseButton(false)
|
||||
Frame:SetTitle("")
|
||||
Frame:Center()
|
||||
Frame.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black25"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black15"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
draw.DrawText(Realistic_Police.GetSentence("policeCartrunk"), "rpt_font_7", RespX*0.003, RespY*0.002, Realistic_Police.Colors["gray220"], TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local DScroll = vgui.Create("DScrollPanel", Frame)
|
||||
DScroll:SetSize(RespX*0.2788, RespY*0.096)
|
||||
DScroll:SetPos(RespX*0.005, RespY*0.035)
|
||||
DScroll.Paint = function() end
|
||||
DScroll:GetVBar():SetSize(0,0)
|
||||
|
||||
local List = vgui.Create( "DIconLayout", DScroll )
|
||||
List:Dock( FILL )
|
||||
List:SetSpaceY( 5 )
|
||||
List:SetSpaceX( 5 )
|
||||
for k,v in pairs(Realistic_Police.Trunk) do
|
||||
local ListItem = List:Add( "SpawnIcon" )
|
||||
ListItem:SetSize( RespX*0.0541, RespX*0.0541 )
|
||||
ListItem:SetModel(k)
|
||||
ListItem:SetTooltip( false )
|
||||
ListItem.DoClick = function()
|
||||
RealisticPoliceGhost = true
|
||||
RealisticPoliceModel = k
|
||||
Frame:Remove()
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("spawnPropText"))
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", Frame)
|
||||
RPTClose:SetSize(RespX*0.03, RespY*0.025)
|
||||
RPTClose:SetPos(Frame:GetWide()*0.89, Frame:GetTall()*0.008)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
LocalPlayer():SetNoDraw(false)
|
||||
Frame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
local function RealisticPolicePlate(ent, pos, ang, String)
|
||||
cam.Start3D2D( ent:LocalToWorld(pos), ent:LocalToWorldAngles(ang), 0.02 )
|
||||
if not IsValid(ent) then return end
|
||||
if isstring(Realistic_Police.PlateVehicle[ent:GetVehicleClass()]) then
|
||||
ent.Plate = Realistic_Police.PlateVehicle[ent:GetVehicleClass()]
|
||||
else
|
||||
ent.Plate = Realistic_Police.LangagePlate
|
||||
end
|
||||
if Realistic_Police.PlateConfig[ent.Plate]["Image"] != nil then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray240"] )
|
||||
surface.SetMaterial( Realistic_Police.PlateConfig[ent.Plate]["Image"] )
|
||||
surface.DrawTexturedRect( 0, 0, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"], RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"] )
|
||||
end
|
||||
local plateName = ent:GetNWString("rpt_plate")
|
||||
if not Realistic_Police.PlateConfig[ent.Plate]["PlateText"] then
|
||||
if plateName != "" then
|
||||
local StringExplode = string.Explode(" ", plateName) or ""
|
||||
if istable(StringExplode) && isstring(StringExplode[1]) && isstring(StringExplode[2]) && isstring(StringExplode[3]) then
|
||||
plateName = StringExplode[1]..StringExplode[2]..StringExplode[3]
|
||||
end
|
||||
draw.SimpleText(plateName, Realistic_Police.Fonts(RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/6, (Realistic_Police.Lang == "ru" and "DermaDefault" or nil)),RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][1] - 5, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/ Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][2]+5, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(plateName, Realistic_Police.Fonts(RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/6, (Realistic_Police.Lang == "ru" and "DermaDefault" or nil)),RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][1], RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/ Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][2], Realistic_Police.PlateConfig[ent.Plate]["TextColor"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
else
|
||||
if plateName != "" then
|
||||
local StringExplode = string.Explode(" ", plateName) or ""
|
||||
if istable(StringExplode) && isstring(StringExplode[1]) && isstring(StringExplode[2]) && isstring(StringExplode[3]) then
|
||||
plateName = StringExplode[1].."-"..StringExplode[2].."-"..StringExplode[3]
|
||||
end
|
||||
draw.SimpleText(plateName, Realistic_Police.Fonts(RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/6, (Realistic_Police.Lang == "ru" and "DermaDefault" or nil)),RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][1] - 5, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/ Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][2]+5, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText(plateName, Realistic_Police.Fonts(RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/6, (Realistic_Police.Lang == "ru" and "DermaDefault" or nil)),RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][1], RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/ Realistic_Police.PlateConfig[ent.Plate]["PlatePos"][2], Realistic_Police.PlateConfig[ent.Plate]["TextColor"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
if Realistic_Police.PlateConfig[ent.Plate]["Country"] != nil then
|
||||
draw.SimpleText(Realistic_Police.PlateConfig[ent.Plate]["Country"], Realistic_Police.Fonts(RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/12), RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"] - RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/Realistic_Police.PlateConfig[ent.Plate]["CountryPos"][1], RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/Realistic_Police.PlateConfig[ent.Plate]["CountryPos"][2], Realistic_Police.PlateConfig[ent.Plate]["CountryColor"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
if Realistic_Police.PlateConfig[ent.Plate]["Department"] != nil then
|
||||
draw.SimpleText(Realistic_Police.PlateConfig[ent.Plate]["Department"], Realistic_Police.Fonts(RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/13), RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/1.06, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/1.4, Realistic_Police.Colors["gray"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
if Realistic_Police.PlateConfig[ent.Plate]["ImageServer"] != nil then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray"] )
|
||||
surface.SetMaterial( Realistic_Police.PlateConfig[ent.Plate]["ImageServer"] )
|
||||
surface.DrawTexturedRect( RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/1.104, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/6, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeW"]/14, RPTInformationVehicle[ent:GetModel()][String]["PlateSizeH"]/3 )
|
||||
end
|
||||
cam.End3D2D()
|
||||
end
|
||||
|
||||
local VehicleTable = {}
|
||||
hook.Add( "OnEntityCreated", "RPT:OnEntityCreated", function( ent )
|
||||
if IsValid(ent) && ent:IsVehicle() or ent:GetClass() == "gmod_sent_vehicle_fphysics_base" then
|
||||
VehicleTable[#VehicleTable + 1] = ent
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("PostDrawTranslucentRenderables", "RPT:LicensePlateD", function(bDepth, bSkybox) -- Draw Plate
|
||||
if ( bSkybox ) then return end
|
||||
for k, ent in pairs( VehicleTable ) do
|
||||
if Realistic_Police.TrunkSystem && Realistic_Police.KeyTrunkHUD then
|
||||
if IsValid(ent) && ent:IsVehicle() then
|
||||
if ent:GetClass() == "prop_vehicle_jeep" or ent:GetClass() == "gmod_sent_vehicle_fphysics_base" then
|
||||
if LocalPlayer():GetPos():DistToSqr(ent:LocalToWorld(Vector(0, - ent:OBBMaxs().y))) < 60000 && Realistic_Police.VehiclePoliceTrunk[ent:GetVehicleClass()] then
|
||||
|
||||
cam.Start3D2D( istable(Realistic_Police.TrunkPosition[ent:GetVehicleClass()]) and ent:LocalToWorld(Vector(0 + Realistic_Police.TrunkPosition[ent:GetVehicleClass()]["Pos"].x, - ent:OBBMaxs().y + Realistic_Police.TrunkPosition[ent:GetVehicleClass()]["Pos"].y, ent:OBBMaxs().z*0.5 + Realistic_Police.TrunkPosition[ent:GetVehicleClass()]["Pos"].z)) or ent:LocalToWorld(Vector(0, - ent:OBBMaxs().y, ent:OBBMaxs().z*0.5)), ent:GetAngles() + Angle(0,0,90), 0.1 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
draw.NoTexture()
|
||||
Realistic_Police.Circle( 0, 0, 50, 1000 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black20"] )
|
||||
draw.NoTexture()
|
||||
Realistic_Police.Circle( 0, 0, 45, 1000 )
|
||||
draw.SimpleText("E", "rpt_font_23",0, 0, Color(240,240,240, LocalPlayer():GetPos():DistToSqr(ent:GetPos()) * 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
cam.End3D2D()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if Realistic_Police.PlateActivate then
|
||||
if IsValid(ent) && ent:IsVehicle() then
|
||||
if ent:GetPos():DistToSqr(LocalPlayer():GetPos()) < 3000000 then
|
||||
if istable(RPTInformationVehicle) && istable(RPTInformationVehicle[ent:GetModel()]) then
|
||||
if istable(RPTInformationVehicle[ent:GetModel()]["Plate1"]) && isvector(RPTInformationVehicle[ent:GetModel()]["Plate1"]["PlateVector"]) && isangle(RPTInformationVehicle[ent:GetModel()]["Plate1"]["PlateAngle"]) then
|
||||
RealisticPolicePlate(ent, RPTInformationVehicle[ent:GetModel()]["Plate1"]["PlateVector"], RPTInformationVehicle[ent:GetModel()]["Plate1"]["PlateAngle"], "Plate1")
|
||||
end
|
||||
if istable(RPTInformationVehicle[ent:GetModel()]["Plate2"]) && isangle(RPTInformationVehicle[ent:GetModel()]["Plate2"]["PlateAngle"]) && isvector(RPTInformationVehicle[ent:GetModel()]["Plate2"]["PlateVector"]) then
|
||||
RealisticPolicePlate(ent, RPTInformationVehicle[ent:GetModel()]["Plate2"]["PlateVector"], RPTInformationVehicle[ent:GetModel()]["Plate2"]["PlateAngle"], "Plate2")
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
VehicleTable[k] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("Think", "RPT:Think", function()
|
||||
-- Ghost entity for the trunk
|
||||
if RealisticPoliceGhost then
|
||||
if IsValid(RPTEGhostent) then RPTEGhostent:Remove() end
|
||||
RPTEGhostent = ClientsideModel(RealisticPoliceModel, RENDERGROUP_OPAQUE)
|
||||
RPTEGhostent:SetModel("")
|
||||
RPTEGhostent:SetMaterial("models/wireframe")
|
||||
RPTEGhostent:SetPos(LocalPlayer():GetEyeTrace().HitPos + Realistic_Police.Trunk[RealisticPoliceModel]["GhostPos"])
|
||||
RPTEGhostent:SetAngles(Angle(0,LocalPlayer():GetAngles().y + 90,0))
|
||||
RPTEGhostent:Spawn()
|
||||
RPTEGhostent:Activate()
|
||||
RPTEGhostent:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("HUDPaint", "RealisticPolicesd:HUDPaint", function()
|
||||
if Realistic_Police.CameraBrokeHud then
|
||||
if Realistic_Police.CameraWorker[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if v:GetRptCam() then
|
||||
if not isvector(v:GetPos()) then return end
|
||||
local tscreen = v:GetPos():ToScreen()
|
||||
local sx, sy = surface.GetTextSize( "Crime Scene" )
|
||||
local dist = math.Round(v:GetPos():DistToSqr(LocalPlayer():GetPos())/(25600))
|
||||
if dist > 0.25 then
|
||||
draw.SimpleText( dist.."m" , "rpt_font_2", tscreen.x, tscreen.y, Realistic_Police.Colors["white"], 1)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"].r, Realistic_Police.Colors["white"].g, Realistic_Police.Colors["white"].b, RPTValue )
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material5"] )
|
||||
surface.DrawTexturedRect( tscreen.x - 12.5, tscreen.y - 23, 25, 25 )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if IsValid(LocalPlayer():GetEyeTrace().Entity) then
|
||||
if LocalPlayer():GetEyeTrace().Entity:GetClass() == "realistic_police_screen" or LocalPlayer():GetEyeTrace().Entity:GetClass() == "realistic_police_policescreen" then
|
||||
if LocalPlayer():GetEyeTrace().Entity:GetPos():DistToSqr((LocalPlayer():GetPos())) < 10000 then
|
||||
surface.SetDrawColor(Realistic_Police.Colors["white"])
|
||||
surface.SetMaterial( Realistic_Police.Colors["Material4"] )
|
||||
surface.DrawTexturedRect(ScrW()/2-25, ScrH()*0.9,50,50)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("RealisticPolice:StunGun", function()
|
||||
local Players = net.ReadEntity()
|
||||
Players.TimerTazerStart = CurTime() + 5
|
||||
timer.Simple(0, function()
|
||||
if IsValid(Players) && IsValid(Players:GetRagdollEntity()) then
|
||||
Phys = Players:GetRagdollEntity():GetPhysicsObject()
|
||||
|
||||
hook.Add("Think", "RPT:StunGunThink"..Players:EntIndex(), function()
|
||||
if IsValid(Players) && Players:IsPlayer() then
|
||||
if Players.TimerTazerStart > CurTime() then
|
||||
if IsValid(Phys) then
|
||||
Phys:ApplyForceOffset( Vector(math.random(-40,40),math.random(-40,40),0), Phys:GetPos() + Vector(0,0,50))
|
||||
end
|
||||
else
|
||||
hook.Remove("Think", "RPT:StunGunThink"..Players:EntIndex())
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
end )
|
||||
end )
|
||||
|
||||
hook.Add( "PlayerButtonDown", "RPT:PlayerButtonDownTrunk", function( ply, button )
|
||||
if button == (Realistic_Police.KeyForOpenTrunk or KEY_E) then
|
||||
if IsValid(RPTEGhostent) then
|
||||
if isstring(RealisticPoliceModel) then
|
||||
net.Start("RealisticPolice:PlaceProp")
|
||||
net.WriteString(RealisticPoliceModel)
|
||||
net.SendToServer()
|
||||
end
|
||||
RealisticPoliceGhost = false
|
||||
RPTEGhostent:Remove()
|
||||
end
|
||||
|
||||
local ent = ply:GetEyeTrace().Entity
|
||||
|
||||
if not IsValid(ent) or not ent:IsVehicle() or not Realistic_Police.TrunkSystem then return end
|
||||
if not ent:GetClass() == "prop_vehicle_jeep" && not ent:GetClass() == "gmod_sent_vehicle_fphysics_base" then return end
|
||||
if not Realistic_Police.VehiclePoliceTrunk[ent:GetVehicleClass()] or not Realistic_Police.CanOpenTrunk[Realistic_Police.GetPlayerJob(ply)] then return end
|
||||
|
||||
if ply:GetPos():DistToSqr(Realistic_Police.TrunkPosition[ent:GetVehicleClass()] and Realistic_Police.TrunkPosition[ent:GetVehicleClass()]["Pos"] + ent:LocalToWorld(Vector(0, - ent:OBBMaxs().y, ent:OBBMaxs().z*0.5)) or ent:LocalToWorld(Vector(0, - ent:OBBMaxs().y, ent:OBBMaxs().z*0.5))) > 7500 then return end
|
||||
Realistic_Police.PoliceTrunk()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("RealisticPolice:Open", function()
|
||||
local String = net.ReadString()
|
||||
if String == "OpenFiningMenu" then
|
||||
local Bool = net.ReadBool()
|
||||
Realistic_Police.OpenFiningMenu(Bool)
|
||||
elseif String == "OpenMainMenu" then
|
||||
local Ent = net.ReadEntity()
|
||||
local Bool = net.ReadBool()
|
||||
Realistic_Police.OpenMenu(Ent, Bool)
|
||||
elseif String == "OpenTrunk" then
|
||||
-- Realistic_Police.PoliceTrunk()
|
||||
elseif String == "Notify" then
|
||||
local msg = net.ReadString()
|
||||
RealisticPoliceNotify(msg)
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("SetupMove", "RPT:SetupMove", function(ply, data)
|
||||
local wep = ply:GetActiveWeapon()
|
||||
if IsValid(wep) then
|
||||
if wep:GetClass() == "weapon_rpt_surrender" or wep:GetClass() == "weapon_rpt_cuffed" then
|
||||
data:SetMaxSpeed(80)
|
||||
data:SetMaxClientSpeed(80)
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("PlayerSwitchWeapon", "RPT:PlayerSwitchWeapon", function(ply, wp, wep)
|
||||
local wep = ply:GetActiveWeapon()
|
||||
if not IsValid(wep) then return end
|
||||
|
||||
if wep:GetClass() == "weapon_rpt_surrender" or wep:GetClass() == "weapon_rpt_cuffed" or timer.Exists("rpt_animation"..ply:EntIndex()) then
|
||||
return true
|
||||
end
|
||||
end)
|
||||
|
||||
function Realistic_Police.NameCamera(CEntity)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
local RPTValue = 0
|
||||
local RPTTarget = 300
|
||||
local speed = 20
|
||||
|
||||
local RPTLFrame = vgui.Create("DFrame")
|
||||
RPTLFrame:SetSize(RpRespX*0.272, RpRespY*0.2)
|
||||
RPTLFrame:Center()
|
||||
RPTLFrame:ShowCloseButton(false)
|
||||
RPTLFrame:MakePopup()
|
||||
RPTLFrame:SetDraggable(false)
|
||||
RPTLFrame:SetTitle("")
|
||||
RPTLFrame.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime(), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray60200"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( w*0.003, 0, w*0.995, h*0.15 )
|
||||
|
||||
draw.DrawText(Realistic_Police.GetSentence("cameraConfiguration"), "rpt_font_7", RpRespX*0.004, RpRespY*0.005, Color(Realistic_Police.Colors["gray220"].r, Realistic_Police.Colors["gray220"].g, Realistic_Police.Colors["gray220"].b, RPTValue), TEXT_ALIGN_LEFT)
|
||||
end
|
||||
|
||||
local PanelCT = vgui.Create("DTextEntry", RPTLFrame)
|
||||
PanelCT:SetSize(RpRespX*0.251, RpRespY*0.05)
|
||||
PanelCT:SetPos(RpRespX*0.01, RpRespY*0.05)
|
||||
PanelCT:SetText(" "..Realistic_Police.GetSentence("cameraName"))
|
||||
PanelCT:SetFont("rpt_font_7")
|
||||
PanelCT:SetDrawLanguageID(false)
|
||||
PanelCT.OnGetFocus = function(self)
|
||||
if PanelCT:GetText() == " "..Realistic_Police.GetSentence("cameraName") then
|
||||
PanelCT:SetText("")
|
||||
end
|
||||
end
|
||||
PanelCT.Paint = function(self,w,h)
|
||||
surface.SetDrawColor(Realistic_Police.Colors["black"])
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black180"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
self:DrawTextEntryText(Realistic_Police.Colors["white"], Realistic_Police.Colors["white"], Realistic_Police.Colors["white"])
|
||||
surface.SetDrawColor( Realistic_Police.Colors["darkblue"] )
|
||||
surface.DrawOutlinedRect( 0, 0, w, h )
|
||||
end
|
||||
PanelCT.OnLoseFocus = function(self)
|
||||
if PanelCT:GetText() == "" then
|
||||
PanelCT:SetText(" "..Realistic_Police.GetSentence("infractionReason"))
|
||||
end
|
||||
end
|
||||
PanelCT.AllowInput = function( self, stringValue )
|
||||
if string.len(PanelCT:GetValue()) > 18 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
DButtonAccept = vgui.Create("DButton", RPTLFrame)
|
||||
DButtonAccept:SetSize(RpRespX*0.257, RpRespY*0.05)
|
||||
DButtonAccept:SetPos(RpRespX*0.007, RpRespY*0.11)
|
||||
DButtonAccept:SetText(Realistic_Police.GetSentence("confirm"))
|
||||
DButtonAccept:SetFont("rpt_font_9")
|
||||
DButtonAccept:SetTextColor(Realistic_Police.Colors["white"])
|
||||
DButtonAccept.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["green"] )
|
||||
surface.DrawRect( 5, 0, w-10, h )
|
||||
end
|
||||
DButtonAccept.DoClick = function()
|
||||
net.Start("RealisticPolice:NameCamera")
|
||||
net.WriteEntity(CEntity)
|
||||
net.WriteString(PanelCT:GetText())
|
||||
net.SendToServer()
|
||||
RPTLFrame:Remove()
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTLFrame)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTLFrame:GetWide()*0.885, RPTLFrame:GetTall()*0.008)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTLFrame:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
net.Receive("RealisticPolice:NameCamera", function()
|
||||
local CEntity = net.ReadEntity()
|
||||
Realistic_Police.NameCamera(CEntity)
|
||||
end )
|
||||
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police.Notify = Realistic_Police.Notify or {}
|
||||
function RealisticPoliceNotify(msg, time)
|
||||
if not isnumber(time) then time = 5 end
|
||||
|
||||
if not Realistic_Police.UseDarkRPNotify then
|
||||
Realistic_Police.Notify[#Realistic_Police.Notify + 1] = {
|
||||
["msg"] = msg,
|
||||
["time"] = CurTime() + (time or 5),
|
||||
["mat"] = Material("jail.png"),
|
||||
}
|
||||
else
|
||||
notification.AddLegacy(msg, NOTIFY_GENERIC, time)
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.DrawNotification()
|
||||
if Realistic_Police.Notify and #Realistic_Police.Notify > 0 then
|
||||
for k,v in ipairs(Realistic_Police.Notify) do
|
||||
surface.SetFont("rpt_font_20")
|
||||
|
||||
local sizeText = surface.GetTextSize(v.msg)
|
||||
|
||||
local RPS, RPTScrH = ScrW(), ScrH()
|
||||
|
||||
if not isnumber(v.RLerp) then v.RLerp = -sizeText end
|
||||
if not isnumber(v.RLerpY) then v.RLerpY = (RPTScrH*0.055*k)-RPTScrH*0.038 end
|
||||
|
||||
if v.time > CurTime() then
|
||||
v.RLerp = Lerp(FrameTime()*3, v.RLerp, RPS*0.02)
|
||||
else
|
||||
v.RLerp = Lerp(FrameTime()*3, v.RLerp, (-RPS*0.25 - sizeText))
|
||||
if v.RLerp < (-RPS*0.15 - sizeText) then
|
||||
Realistic_Police.Notify[k] = nil
|
||||
Realistic_Police.Notify = table.ClearKeys(Realistic_Police.Notify)
|
||||
end
|
||||
end
|
||||
|
||||
v.RLerpY = Lerp(FrameTime()*8, v.RLerpY, (RPTScrH*0.055*k)-RPTScrH*0.038)
|
||||
local posy = v.RLerpY
|
||||
local incline = RPTScrH*0.055
|
||||
|
||||
local leftPart = {
|
||||
{x = v.RLerp, y = posy},
|
||||
{x = v.RLerp + incline + sizeText + RPTScrH*0.043, y = posy},
|
||||
{x = v.RLerp + RPTScrH*0.043 + sizeText + RPTScrH*0.043, y = posy + RPTScrH*0.043},
|
||||
{x = v.RLerp, y = posy + RPTScrH*0.043},
|
||||
}
|
||||
surface.SetDrawColor(Realistic_Police.Colors["darkblue"])
|
||||
draw.NoTexture()
|
||||
surface.DrawPoly(leftPart)
|
||||
|
||||
local rightPart = {
|
||||
{x = v.RLerp, y = posy},
|
||||
{x = v.RLerp + incline, y = posy},
|
||||
{x = v.RLerp + RPTScrH*0.043, y = posy + RPTScrH*0.043},
|
||||
{x = v.RLerp, y = posy + RPTScrH*0.043},
|
||||
}
|
||||
|
||||
surface.SetDrawColor(Realistic_Police.Colors["lightblue"])
|
||||
draw.NoTexture()
|
||||
surface.DrawPoly(rightPart)
|
||||
|
||||
surface.SetDrawColor(Realistic_Police.Colors["white"])
|
||||
surface.SetMaterial(v.mat)
|
||||
surface.DrawTexturedRect(v.RLerp + RPS*0.006, v.RLerpY + RPTScrH*0.007, RPTScrH*0.027, RPTScrH*0.027)
|
||||
draw.SimpleText(v.msg, "rpt_font_20", v.RLerp + RPS*0.037, v.RLerpY + RPTScrH*0.041/2, Realistic_Police.Colors["white"], TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
end
|
||||
hook.Add("HUDPaint", "Realistic_Police:DrawNotification", function()
|
||||
Realistic_Police.DrawNotification()
|
||||
end)
|
||||
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
function Realistic_Police.ReportMenu(RPTFrame, RPTable, RPTSendEntity, RPTIndex)
|
||||
local RpRespX, RpRespY = ScrW(), ScrH()
|
||||
local TimesDay = os.date("%d/%m/%Y", os.time())
|
||||
local RPTActivate = false
|
||||
local RPTEntity = nil
|
||||
|
||||
local RPTValue = 150
|
||||
local RPTTarget = 300
|
||||
local speed = 5
|
||||
local RPTMenu = vgui.Create("DFrame", RPTFrame)
|
||||
RPTMenu:SetSize(RpRespX*0.794, RpRespY*0.8)
|
||||
RPTMenu:SetPos(0, 0)
|
||||
RPTMenu:ShowCloseButton(false)
|
||||
RPTMenu:SetDraggable(false)
|
||||
RPTMenu:SetTitle("")
|
||||
RPTMenu.Paint = function(self,w,h)
|
||||
RPTValue = Lerp( speed * FrameTime(), RPTValue, RPTTarget )
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black25"].r, Realistic_Police.Colors["black25"].g, Realistic_Police.Colors["black25"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
|
||||
surface.SetDrawColor( Color(Realistic_Police.Colors["black15"].r, Realistic_Police.Colors["black15"].g, Realistic_Police.Colors["black15"].b, RPTValue) )
|
||||
surface.DrawRect( 0, 0, w + 10, h*0.045 )
|
||||
end
|
||||
local RPTScroll = vgui.Create("DScrollPanel", RPTMenu)
|
||||
RPTScroll:SetSize(RpRespX*0.794, RpRespY*0.7)
|
||||
RPTScroll:SetPos(0, RpRespY*0.1)
|
||||
RPTScroll.Paint = function() end
|
||||
local sbar = RPTScroll:GetVBar()
|
||||
sbar:SetSize(10,0)
|
||||
function sbar.btnUp:Paint() end
|
||||
function sbar.btnDown:Paint() end
|
||||
function sbar:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black100"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
function sbar.btnGrip:Paint(w, h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray50"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
|
||||
local RPTDPanel = vgui.Create("DFrame", RPTScroll)
|
||||
RPTDPanel:SetSize(RpRespX*0.4, RpRespY*0.85)
|
||||
RPTDPanel:SetPos(RpRespX*0.2, 0)
|
||||
RPTDPanel:SetDraggable(false)
|
||||
RPTDPanel:ShowCloseButton(false)
|
||||
RPTDPanel.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray240"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
local DLabel = vgui.Create("DLabel", RPTDPanel)
|
||||
DLabel:SetSize(RpRespX*0.1,RpRespY*0.1)
|
||||
DLabel:SetPos(RpRespX*0.03, 0)
|
||||
DLabel:SetText(LocalPlayer():Name())
|
||||
DLabel:SetTextColor(Realistic_Police.Colors["black"])
|
||||
DLabel:SetFont("rpt_font_21")
|
||||
|
||||
local DLabel2 = vgui.Create("DLabel", RPTDPanel)
|
||||
DLabel2:SetSize(RpRespX*0.1,RpRespY*0.1)
|
||||
DLabel2:SetPos(RpRespX*0.29, 0)
|
||||
DLabel2:SetText(Realistic_Police.GetSentence("at").." "..TimesDay)
|
||||
DLabel2:SetTextColor(Realistic_Police.Colors["black"])
|
||||
DLabel2:SetFont("rpt_font_21")
|
||||
|
||||
local RPTText = vgui.Create("DTextEntry", RPTDPanel)
|
||||
RPTText:SetSize(RpRespX*0.3, RpRespY*0.72)
|
||||
RPTText:SetPos(RpRespX*0.05, RpRespY*0.1)
|
||||
RPTText:SetMultiline(true)
|
||||
RPTText:SetFont("rpt_font_20")
|
||||
if not istable(RPTable) then
|
||||
RPTText:SetValue(Realistic_Police.GetSentence("reportText"))
|
||||
else
|
||||
RPTText:SetValue(RPTable["RPTText"])
|
||||
end
|
||||
RPTText:SetDrawLanguageID(false)
|
||||
RPTText.Paint = function(self,w,h)
|
||||
self:DrawTextEntryText(Realistic_Police.Colors["black"], Realistic_Police.Colors["black"], Realistic_Police.Colors["black"])
|
||||
end
|
||||
RPTText.AllowInput = function( self, stringValue )
|
||||
if string.len(RPTText:GetValue()) > 1183 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
RPTText.OnChange = function()
|
||||
Realistic_Police.HackKey()
|
||||
end
|
||||
|
||||
local RPTSteamId = nil
|
||||
local RPTIndexSave = 1
|
||||
local RPTDCombobox = vgui.Create("DComboBox", RPTMenu)
|
||||
RPTDCombobox:SetSize(RpRespX*0.08, RpRespY*0.03)
|
||||
RPTDCombobox:SetPos(RPTMenu:GetWide()*0.9, RpRespY*0.04)
|
||||
RPTDCombobox:SetText(Realistic_Police.GetSentence("accusedName"))
|
||||
RPTDCombobox:SetTextColor(Realistic_Police.Colors["black"])
|
||||
RPTDCombobox:SetFont("rpt_font_8")
|
||||
RPTDCombobox.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray240"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTDCombobox:AddChoice( Realistic_Police.GetSentence("unknown") )
|
||||
local isSBUComputer = IsValid(RPTable) and RPTable.IsSBU and RPTable:IsSBU()
|
||||
for k,v in pairs(player.GetAll()) do
|
||||
if v != LocalPlayer() then
|
||||
local targetChar = v.GetCharacter and v:GetCharacter()
|
||||
if targetChar then
|
||||
local faction = targetChar:GetFaction()
|
||||
if isSBUComputer then
|
||||
if faction != (FACTION_UKRAINE or -1) then continue end
|
||||
else
|
||||
if faction == (FACTION_UKRAINE or -1) then continue end
|
||||
end
|
||||
end
|
||||
RPTDCombobox:AddChoice( v:Name(), v )
|
||||
end
|
||||
end
|
||||
function RPTDCombobox:OnSelect( index, text, data )
|
||||
RPTActivate = true
|
||||
RPTIndexSave = index
|
||||
Realistic_Police.Clic()
|
||||
if text == Realistic_Police.GetSentence("unknown") then
|
||||
RPTEntity = nil
|
||||
else
|
||||
RPTEntity = data
|
||||
end
|
||||
end
|
||||
if istable(RPTable) then
|
||||
RPTDCombobox:Clear()
|
||||
RPTActivate = true
|
||||
if IsValid(RPTSendEntity) then
|
||||
RPTDCombobox:SetValue(RPTSendEntity:GetName())
|
||||
else
|
||||
RPTDCombobox:SetValue(Realistic_Police.GetSentence("unknown"))
|
||||
end
|
||||
RPTSteamId = RPTable["RPTSteamID64"]
|
||||
RPTIndexSave = RPTIndex
|
||||
if text == Realistic_Police.GetSentence("unknown") then
|
||||
RPTSteamId = "unknown"
|
||||
end
|
||||
end
|
||||
local RPTButtonSave = vgui.Create("DButton", RPTMenu)
|
||||
RPTButtonSave:SetSize(RpRespX*0.04, RpRespY*0.03)
|
||||
RPTButtonSave:SetPos(RpRespX*0.004,RpRespY*0.04)
|
||||
RPTButtonSave:SetText(Realistic_Police.GetSentence("save"))
|
||||
RPTButtonSave:SetTextColor(Realistic_Police.Colors["gray200"])
|
||||
RPTButtonSave:SetFont("rpt_font_7")
|
||||
RPTButtonSave.Paint = function()
|
||||
if RPTButtonSave:IsHovered() then
|
||||
RPTButtonSave:SetTextColor(Realistic_Police.Colors["gray150"])
|
||||
else
|
||||
RPTButtonSave:SetTextColor(Realistic_Police.Colors["gray200"])
|
||||
end
|
||||
end
|
||||
RPTButtonSave.DoClick = function()
|
||||
if Realistic_Police.JobEditReport[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
if IsValid(RPTEntity) then
|
||||
if RPTEntity == LocalPlayer() then RealisticPoliceNotify(Realistic_Police.GetSentence("cantEditSelfSanctions")) return end
|
||||
end
|
||||
if RPTDCombobox:GetValue() == Realistic_Police.GetSentence("unknown") then
|
||||
RPTEntity = nil
|
||||
end
|
||||
if RPTActivate then
|
||||
if not istable(RPTable) then
|
||||
net.Start("RealisticPolice:Report")
|
||||
net.WriteUInt(1, 10)
|
||||
net.WriteString("SaveReport")
|
||||
net.WriteEntity(RPTEntity)
|
||||
net.WriteString(RPTText:GetValue())
|
||||
net.SendToServer()
|
||||
else
|
||||
net.Start("RealisticPolice:Report")
|
||||
net.WriteUInt(RPTIndexSave, 10)
|
||||
net.WriteString("EditReport")
|
||||
net.WriteEntity(RPTSendEntity)
|
||||
net.WriteString(RPTText:GetValue())
|
||||
net.WriteString(RPTDCombobox:GetValue())
|
||||
net.SendToServer()
|
||||
end
|
||||
RPTMenu:Remove()
|
||||
end
|
||||
timer.Simple(0.4, function()
|
||||
if IsValid(RPTScrollLReport) then
|
||||
Realistic_Police.ActualizeReport(RPTScrollLReport)
|
||||
end
|
||||
end )
|
||||
Realistic_Police.Clic()
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("cantDoThat"))
|
||||
end
|
||||
end
|
||||
local RPTButtonDelete = vgui.Create("DButton", RPTMenu)
|
||||
RPTButtonDelete:SetSize(RpRespX*0.04, RpRespY*0.03)
|
||||
RPTButtonDelete:SetPos(RpRespX*0.04,RpRespY*0.04)
|
||||
RPTButtonDelete:SetText(Realistic_Police.GetSentence("delete"))
|
||||
RPTButtonDelete:SetTextColor(Realistic_Police.Colors["gray200"])
|
||||
RPTButtonDelete:SetFont("rpt_font_7")
|
||||
RPTButtonDelete.Paint = function()
|
||||
if RPTButtonDelete:IsHovered() then
|
||||
RPTButtonDelete:SetTextColor(Realistic_Police.Colors["gray150"])
|
||||
else
|
||||
RPTButtonDelete:SetTextColor(Realistic_Police.Colors["gray200"])
|
||||
end
|
||||
end
|
||||
RPTButtonDelete.DoClick = function()
|
||||
if Realistic_Police.JobDeleteReport[Realistic_Police.GetPlayerJob(LocalPlayer())] then
|
||||
if IsValid(RPTEntity) then
|
||||
if RPTEntity == LocalPlayer() then RealisticPoliceNotify(Realistic_Police.GetSentence("cantDeleteSelfSanctions")) return end
|
||||
end
|
||||
if istable(RPTable) then
|
||||
if RPTDCombobox:GetValue() == Realistic_Police.GetSentence("unknown") then
|
||||
RPTEntity = nil
|
||||
end
|
||||
net.Start("RealisticPolice:Report")
|
||||
net.WriteUInt(RPTIndex, 10)
|
||||
net.WriteString("RemoveReport")
|
||||
net.WriteEntity(RPTSendEntity)
|
||||
net.SendToServer()
|
||||
end
|
||||
timer.Simple(0.2, function()
|
||||
if IsValid(RPTScrollLReport) then
|
||||
Realistic_Police.ActualizeReport(RPTScrollLReport)
|
||||
end
|
||||
end )
|
||||
RPTMenu:Remove()
|
||||
Realistic_Police.Clic()
|
||||
else
|
||||
RealisticPoliceNotify(Realistic_Police.GetSentence("cantDelete"))
|
||||
end
|
||||
end
|
||||
|
||||
local RPTClose = vgui.Create("DButton", RPTMenu)
|
||||
RPTClose:SetSize(RpRespX*0.03, RpRespY*0.028)
|
||||
RPTClose:SetPos(RPTMenu:GetWide()*0.9605, RpRespY*0.00448)
|
||||
RPTClose:SetText("")
|
||||
RPTClose.Paint = function(self,w,h)
|
||||
surface.SetDrawColor( Realistic_Police.Colors["red"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
end
|
||||
RPTClose.DoClick = function()
|
||||
RPTMenu:Remove()
|
||||
Realistic_Police.Clic()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["cn"] = {
|
||||
["criminalRecord"] = "犯罪记录",
|
||||
["recordOf"] = "储物柜",
|
||||
["username"] = "姓名",
|
||||
["addUpperCase"] = "添加",
|
||||
["infractionReason"] = "罪行",
|
||||
["create"] = "创建",
|
||||
["cancel"] = "取消",
|
||||
["licenseplate"] = "车牌",
|
||||
["search"] = "搜索",
|
||||
["noVehiclesFound"] = "没有找到车辆",
|
||||
["reportText"] = [[检察官先生/女士,
|
||||
|
||||
本人(姓和名),生于(出生地出生日期),从事(职业),特此通知你对居住在(有关人员或公司的地址名称)的(姓和名/公司名称/组织名称/或X(如不详))进行(犯罪行为)投诉。
|
||||
|
||||
截至(事件发生日期),本人确实是以下事件的受害者:(请尽可能准确地注明事件的详细情况以及发生地点、事件发生时间和参与犯罪的人员)。我随信附上可能对本案进一步审理有用的任何文件/照片/证据(请附上复印件,不要原件)。
|
||||
|
||||
有几个人目睹了上述犯罪行为。他们是太太/先生(姓和名),住在(证人的地址),可以通过以下号码(证人的电话号码)联系。
|
||||
|
||||
有几个人目睹了上述犯罪行为。他们是夫人/先生(姓和名)。
|
||||
|
||||
检察官先生/女士,请接受我最美好的祝愿,谢谢你,祝你有愉快的一天。
|
||||
|
||||
警务人员签名]],
|
||||
["unknown"] = "未知",
|
||||
["delete"] = "删除",
|
||||
["at"] = "该",
|
||||
["accusedName"] = "被告姓名",
|
||||
["save"] = "保存",
|
||||
["prosecutor"] = "检察官",
|
||||
["accused"] = "已确认",
|
||||
["date"] = "日期",
|
||||
["see"] = "看",
|
||||
["username2"] = "姓名",
|
||||
["allComplaints"] = "所有的投诉",
|
||||
["moveX"] = "X轴位移",
|
||||
["moveY"] = "Y轴位移",
|
||||
["moveZ"] = "Z轴位移",
|
||||
["rotateX"] = "X轴旋转",
|
||||
["rotateY"] = "Y轴旋转",
|
||||
["rotateZ"] = "Z轴旋转",
|
||||
["rotateYY"] = "Y轴旋转",
|
||||
["width"] = "宽度",
|
||||
["height"] = "高度",
|
||||
["configureLicenseplate"] = "选择车辆进行车牌配置。",
|
||||
["placeLicenseplate"] = "把(1)块车牌挂在你车辆的上",
|
||||
["placeLicenseplate2"] = "把(2)块车牌挂在你车辆的上",
|
||||
["undefined"] = "你没有正确的工作来访问computer。",
|
||||
["youWon"] = "你刚刚赢了",
|
||||
["youAddPenality"] = "你增加了一个处罚",
|
||||
["cameraCenter"] = "摄像中心",
|
||||
["cameraSecurityOfCity"] = "市区监控摄像头",
|
||||
["switchCamera"] = "按 使用 键更换摄像头",
|
||||
["cantDelete"] = "你不能删除它",
|
||||
["cantDoThat"] = "你不能这样做",
|
||||
["noSignal"] = "无信号",
|
||||
["connectionProblem"] = "连接错误",
|
||||
["computerMustBeHacked"] = "你必须入侵它才可以打开应用程序。",
|
||||
["cantAffordFine"] = "你没有足够的钱来支付罚款。",
|
||||
["payFine"] = "缴纳罚款",
|
||||
["confirm"] = "确认",
|
||||
["category"] = "类型",
|
||||
["fineBook"] = "罚款书",
|
||||
["noPayFine"] = "没有支付罚款",
|
||||
["personAlreadyHaveFine"] = "这个人已经有罚款了",
|
||||
["vehicleHaveFine"] = "这辆车已经有罚款了",
|
||||
["vehicleCantReceiveFine"] = "不能给这辆车罚款",
|
||||
["noGoodJob"] = "职业错误,不能增加罚单",
|
||||
["userCantReceiveFine"] = "你不能给这名玩家下罚单",
|
||||
["vehicleCantHaveFine"] = "你不能给这辆车下罚单",
|
||||
["richSanctions"] = "你可以增加更多的罚金",
|
||||
["mustSelectPenality"] = "你必须设定罚款金额",
|
||||
["cantAddFineToHimVehicle"] = "你不能给自己的车罚款",
|
||||
["noGoodJobToArrestuser"] = "职业错误,你不能逮捕这个人",
|
||||
["cantArrestPlayer"] = "你不能逮捕这个人",
|
||||
["needHoldPlayerToArrest"] = "你必须抓着玩家才能让他坐牢",
|
||||
["justPaid"] = "你刚付了钱",
|
||||
["cantAfford"] = "你没有足够的钱来做这件事",
|
||||
["arrestMenu"] = "逮捕菜单",
|
||||
["name"] = "名称",
|
||||
["price"] = "价格",
|
||||
["reason"] = "原因",
|
||||
["pay"] = "支付",
|
||||
["arrestedPlayersList"] = "被捕人员名单",
|
||||
["noArrestedPlayer"] = "没有玩家被捕",
|
||||
["noJailPositions"] = "没有设置监狱位置,请联系管理员",
|
||||
["weaponsList"] = "武器列表",
|
||||
["confiscate"] = "充公",
|
||||
["youSurrender"] = "你已投降",
|
||||
["youArrest"] = "你被逮捕了",
|
||||
["years"] = "年",
|
||||
["tooMuchEntities"] = "你有很多实体",
|
||||
["spawnPropText"] = "按[USE]键生成道具",
|
||||
["youUnarrestBy"] = "你被释放了",
|
||||
["youArrestBy"] = "你被逮捕了",
|
||||
["youHaveArrest"] = "逮捕你",
|
||||
["policeCartrunk"] = "警察箱",
|
||||
["cantDeleteSelfSanctions"] = "你不能删除你的惩罚",
|
||||
["cantEditSelfSanctions"] = "你不能编辑你的刑罚",
|
||||
["seconds"] = "秒",
|
||||
["cameraName"] = "相机名称",
|
||||
["cameraConfiguration"] = "相机配置"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["de"] = {
|
||||
["criminalRecord"] = "Strafregister",
|
||||
["recordOf"] = "Schließfach von",
|
||||
["username"] = "Name der Person",
|
||||
["addUpperCase"] = "ANZEIGE",
|
||||
["infractionReason"] = "Grund für die Straftat",
|
||||
["create"] = "Erstellen",
|
||||
["cancel"] = "Abbrechen",
|
||||
["licenseplate"] = "Nummernschild",
|
||||
["search"] = "Suche",
|
||||
["noVehiclesFound"] = "Keine Fahrzeuge gefunden",
|
||||
["reportText"] = [[Frau Staatsanwältin, Herr Staatsanwalt,
|
||||
|
||||
Ich, der Unterzeichnete (Vor- und Nachname), geboren am (Geburtsdatum) am (Geburtsort), der den Beruf (Beruf) ausübt, teile Ihnen mit, dass ich Anzeige gegen (Vor- und Nachname / Name des Unternehmens / Name der Organisation / oder X, falls unbekannt), wohnhaft in (Name der Adresse der betreffenden Person oder des Unternehmens), wegen (Qualifikation der Straftat) erstatte.
|
||||
|
||||
Am (Datum des Ereignisses) war ich tatsächlich Opfer des folgenden Sachverhalts: (geben Sie so genau wie möglich die Einzelheiten des Sachverhalts sowie den Ort, an dem er sich ereignet hat, die Uhrzeit des Ereignisses und die an der Zuwiderhandlung beteiligten Personen an). Ich füge diesem Schreiben alle Dokumente/Fotos/Beweise bei, die für den weiteren Verlauf des Falles nützlich sein könnten (bitte fügen Sie Kopien und keine Originale bei).
|
||||
|
||||
Mehrere Personen waren Zeugen der oben genannten Straftat. Es handelt sich um Frau/Herr (Vor- und Nachname).
|
||||
|
||||
Bitte nehmen Sie, sehr geehrte Frau, sehr geehrter Herr Staatsanwalt, den Ausdruck meiner besten Gefühle an.
|
||||
|
||||
Unterschrift des Polizeibeamten]],
|
||||
["unknown"] = "Unbekannt",
|
||||
["delete"] = "Löschen",
|
||||
["at"] = "Die",
|
||||
["accusedName"] = "Angeklagter Name",
|
||||
["save"] = "Speichern",
|
||||
["prosecutor"] = "Staatsanwaltschaft",
|
||||
["accused"] = "Anerkannt",
|
||||
["date"] = "Datum",
|
||||
["see"] = "Schauen",
|
||||
["username2"] = "Name der Person",
|
||||
["allComplaints"] = "Alle Beschwerden",
|
||||
["moveX"] = "Verschiebung der X-Achse",
|
||||
["moveY"] = "Verschiebung der Y-Achse",
|
||||
["moveZ"] = "Verschiebung der Z-Achse",
|
||||
["rotateX"] = "Drehung der X-Achse",
|
||||
["rotateY"] = "Drehung der Y-Achse",
|
||||
["rotateZ"] = "Drehung der Z-Achse",
|
||||
["rotateYY"] = "Drehung der Y-Achse",
|
||||
["width"] = "Breite",
|
||||
["height"] = "Höhe",
|
||||
["configureLicenseplate"] = "Wählen Sie das Fahrzeug \n um das Nummernschild zu konfigurieren",
|
||||
["placeLicenseplate"] = "Bringen Sie das (1) Nummernschild \n Ihrem Fahrzeug an einem geeigneten Platz \n.",
|
||||
["placeLicenseplate2"] = "Bringen Sie das (2) Nummernschild \n Ihrem Fahrzeug an einem geeigneten Platz \n.",
|
||||
["undefined"] = "Sie haben nicht den richtigen Job, um auf den Computer zuzugreifen",
|
||||
["youWon"] = "Du hast gewonnen",
|
||||
["youAddPenality"] = "Sie haben eine Strafe hinzugefügt",
|
||||
["cameraCenter"] = "Kamera-Zentrum",
|
||||
["cameraSecurityOfCity"] = "Sicherheitskamera der Stadt",
|
||||
["switchCamera"] = "Drücken Sie USE um die Kamera zu wechseln",
|
||||
["cantDelete"] = "Sie können das nicht löschen",
|
||||
["cantDoThat"] = "Das kannst du nicht tun",
|
||||
["noSignal"] = "KEIN SIGNAL",
|
||||
["connectionProblem"] = "Problem mit der Verbindung",
|
||||
["computerMustBeHacked"] = "Der Computer muss gehackt werden, um eine Anwendung zu öffnen",
|
||||
["cantAffordFine"] = "Sie haben nicht genug Geld, um die Strafe zu bezahlen",
|
||||
["payFine"] = "Bezahlen Sie die Geldstrafe",
|
||||
["confirm"] = "BESTÄTIGEN",
|
||||
["category"] = "KATEGORIE",
|
||||
["fineBook"] = "Schönes Buch",
|
||||
["noPayFine"] = "Hat die Geldstrafe nicht bezahlt",
|
||||
["personAlreadyHaveFine"] = "Diese Person hat bereits eine Geldstrafe",
|
||||
["vehicleHaveFine"] = "Dieses Fahrzeug hat bereits eine Geldstrafe",
|
||||
["vehicleCantReceiveFine"] = "Dieses Fahrzeug kann keine Geldstrafe haben",
|
||||
["noGoodJob"] = "Sie haben nicht den richtigen Job, um eine Geldstrafe zu zahlen",
|
||||
["userCantReceiveFine"] = "Sie können diesem Spieler keine Geldstrafe auferlegen",
|
||||
["vehicleCantHaveFine"] = "Bei diesem Fahrzeug können keine Bußgelder erhoben werden.",
|
||||
["richSanctions"] = "Sie können weitere Strafen verhängen",
|
||||
["mustSelectPenality"] = "Sie müssen eine Strafe wählen",
|
||||
["cantAddFineToHimVehicle"] = "Sie können Ihr Fahrzeug nicht mit einem Bußgeld belegen",
|
||||
["noGoodJobToArrestuser"] = "Sie haben nicht den richtigen Job, um diese Person zu verhaften",
|
||||
["cantArrestPlayer"] = "Sie können diese Person nicht verhaften",
|
||||
["needHoldPlayerToArrest"] = "Du musst einen Spieler ins Gefängnis bringen",
|
||||
["justPaid"] = "Du hast gerade bezahlt",
|
||||
["cantAfford"] = "Sie haben nicht genug Geld für so etwas",
|
||||
["arrestMenu"] = "Menü Verhaftung",
|
||||
["name"] = "Name",
|
||||
["price"] = "Preis",
|
||||
["reason"] = "Motiv",
|
||||
["pay"] = "Bezahlen",
|
||||
["arrestedPlayersList"] = "Liste der Verhafteten",
|
||||
["noArrestedPlayer"] = "Es wurde kein Spieler verhaftet",
|
||||
["noJailPositions"] = "Es gibt keine Gefängnis position, kontaktiere einen Admin",
|
||||
["weaponsList"] = "Liste der Waffen",
|
||||
["confiscate"] = "KONFISZIEREN",
|
||||
["youSurrender"] = "Du gibst Auf",
|
||||
["youArrest"] = "Sie sind verhaftet",
|
||||
["years"] = "Jahre",
|
||||
["tooMuchEntities"] = "Sie haben zu viele Entities",
|
||||
["spawnPropText"] = "Drücken Sie [USE], um ein Prop zu erzeugen.",
|
||||
["youUnarrestBy"] = "Sie wurden freigelassen von",
|
||||
["youArrestBy"] = "Sie wurden verhaftet von",
|
||||
["youHaveArrest"] = "Sie haben verhaftet",
|
||||
["policeCartrunk"] = "Polizei Kofferraum",
|
||||
["cantDeleteSelfSanctions"] = "Du kannst deine Strafe nicht löschen",
|
||||
["cantEditSelfSanctions"] = "Sie können Ihre Strafe nicht bearbeiten",
|
||||
["seconds"] = "Sekunden",
|
||||
["cameraName"] = "Name der Kamera",
|
||||
["cameraConfiguration"] = "Kamera-Konfiguration",
|
||||
["press"] = "Druk op"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["en"] = {
|
||||
["criminalRecord"] = "Criminal Record",
|
||||
["recordOf"] = "Locker of",
|
||||
["username"] = "Name of the Person",
|
||||
["addUpperCase"] = "ADD",
|
||||
["infractionReason"] = "Reason for the offence",
|
||||
["create"] = "Create",
|
||||
["cancel"] = "Cancel",
|
||||
["licenseplate"] = "License Plate",
|
||||
["search"] = "Search",
|
||||
["noVehiclesFound"] = "No vehicles found",
|
||||
["reportText"] = [[Madam, Mr. Prosecutor,
|
||||
|
||||
I, the undersigned (name and surname), born on date of birth in place of birth and practicing the profession of (profession), inform you that I am filing a complaint against (name and surname / name of the company / name of the organization / or X if unknown), residing at (name the address of the person or company concerned) for (qualification of the offence).
|
||||
|
||||
On (date of the event), I was indeed the victim of the following facts: (indicate as precisely as possible the details of the facts as well as the place where they occurred, the time of the event and the persons involved in the infraction). I enclose with this letter any documents / photos / evidence that may be useful in the future of this case (please attach copies and not originals).
|
||||
|
||||
Several people witnessed the above-mentioned offence. They are Mrs/Mr (first and last names).
|
||||
|
||||
Please accept, Madam, Mr. Prosecutor, the expression of my best feelings.
|
||||
|
||||
Signature of the Police Officer]],
|
||||
["unknown"] = "Unknown",
|
||||
["delete"] = "Delete",
|
||||
["at"] = "The",
|
||||
["accusedName"] = "Accused Name",
|
||||
["save"] = "Save",
|
||||
["prosecutor"] = "Prosecutor",
|
||||
["accused"] = "Acknowledged",
|
||||
["date"] = "Date",
|
||||
["see"] = "See",
|
||||
["username2"] = "Name of the Person",
|
||||
["allComplaints"] = "All complaints",
|
||||
["moveX"] = "Displacement X-axis",
|
||||
["moveY"] = "Displacement Y-axis",
|
||||
["moveZ"] = "Displacement Z-axis",
|
||||
["rotateX"] = "Rotation X-axis",
|
||||
["rotateY"] = "Rotation Y-axis",
|
||||
["rotateZ"] = "Rotation Z-axis",
|
||||
["rotateYY"] = "Rotation Y-axis",
|
||||
["width"] = "Width",
|
||||
["height"] = "Height",
|
||||
["configureLicenseplate"] = "Select the vehicle \n for configure the \n license plate",
|
||||
["placeLicenseplate"] = "Place the (1) License \n Plate in the good place \n of your vehicle",
|
||||
["placeLicenseplate2"] = "Place the (2) License \n Plate in the good place \n of your vehicle",
|
||||
["undefined"] = "You don't have the right job to access on the computer",
|
||||
["youWon"] = "You just won",
|
||||
["youAddPenality"] = "You have added a penalty",
|
||||
["cameraCenter"] = "Camera Center",
|
||||
["cameraSecurityOfCity"] = "Security Camera of the City",
|
||||
["switchCamera"] = "Press Use for Change Camera",
|
||||
["cantDelete"] = "You can't delete this",
|
||||
["cantDoThat"] = "You can't do this",
|
||||
["noSignal"] = "NO SIGNAL",
|
||||
["connectionProblem"] = "Problem with the Connexion",
|
||||
["computerMustBeHacked"] = "The computer have to be hacked for open an application",
|
||||
["cantAffordFine"] = "You don't have enough money for pay the fine",
|
||||
["payFine"] = "Pay the Fine",
|
||||
["confirm"] = "CONFIRM",
|
||||
["category"] = "CATEGORY",
|
||||
["fineBook"] = "Fine Book",
|
||||
["noPayFine"] = "Did not pay the fine",
|
||||
["personAlreadyHaveFine"] = "This person have already a fine",
|
||||
["vehicleHaveFine"] = "This vehicle have already a fine",
|
||||
["vehicleCantReceiveFine"] = "This vehicle can't have a fine",
|
||||
["noGoodJob"] = "You don't have the right job for add a fine",
|
||||
["userCantReceiveFine"] = "You can't add a fine to this player",
|
||||
["vehicleCantHaveFine"] = "You can't add fine on this vehicle",
|
||||
["richSanctions"] = "You can add more penalty",
|
||||
["mustSelectPenality"] = "You have to select a penalty",
|
||||
["cantAddFineToHimVehicle"] = "You can't add a fine to your vehicle",
|
||||
["noGoodJobToArrestuser"] = "You don't have the right job to arrest this person",
|
||||
["cantArrestPlayer"] = "You can't arrest this person",
|
||||
["needHoldPlayerToArrest"] = "You must drag a player for jail someone",
|
||||
["justPaid"] = "You just paid",
|
||||
["cantAfford"] = "You don't have enought money for do this",
|
||||
["arrestMenu"] = "Arrest Menu",
|
||||
["name"] = "Name",
|
||||
["price"] = "Price",
|
||||
["reason"] = "Motif",
|
||||
["pay"] = "Pay",
|
||||
["arrestedPlayersList"] = "List of Arrested",
|
||||
["noArrestedPlayer"] = "There is no player arrested",
|
||||
["noJailPositions"] = "There is no jail position contact an administrator",
|
||||
["weaponsList"] = "List of Weapons",
|
||||
["confiscate"] = "CONFISCATE",
|
||||
["youSurrender"] = "You are Surrender",
|
||||
["youArrest"] = "You are Arrested",
|
||||
["years"] = "Years",
|
||||
["tooMuchEntities"] = "You have too many entities",
|
||||
["spawnPropText"] = "Press [USE] to spawn the prop",
|
||||
["youUnarrestBy"] = "You were released by",
|
||||
["youArrestBy"] = "You were arrested by",
|
||||
["youHaveArrest"] = "You arrested",
|
||||
["policeCartrunk"] = "Police Trunk",
|
||||
["cantDeleteSelfSanctions"] = "You can't delete your penalty",
|
||||
["cantEditSelfSanctions"] = "You can't edit your penalty",
|
||||
["seconds"] = "Seconds",
|
||||
["cameraName"] = "Name of the Camera",
|
||||
["cameraConfiguration"] = "Camera Configuration"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["es"] = {
|
||||
["criminalRecord"] = "Antecedentes penales",
|
||||
["recordOf"] = "Taquilla de",
|
||||
["username"] = "Nombre de la persona",
|
||||
["addUpperCase"] = "AÑADIR",
|
||||
["infractionReason"] = "Motivo de la infracción",
|
||||
["create"] = "Crear",
|
||||
["cancel"] = "Cancel",
|
||||
["licenseplate"] = "Placa de matrícula",
|
||||
["search"] = "Buscar",
|
||||
["noVehiclesFound"] = "No se han encontrado vehículos",
|
||||
["reportText"] = [[Señora, Señor Fiscal,
|
||||
El abajo firmante (nombre y apellidos), nacido en fecha en lugar de nacimiento y ejerciendo la profesión de (profesión), le comunico que interpongo denuncia contra (nombre y apellidos / nombre de la empresa / nombre de la organización / o X si se desconoce), con domicilio en (indicar la dirección de la persona o empresa afectada) por (calificación del delito).
|
||||
El (fecha del suceso), fui efectivamente víctima de los siguientes hechos: (indicar con la mayor precisión posible los detalles de los hechos, así como el lugar donde ocurrieron, la hora del suceso y las personas implicadas en la infracción). Adjunto a esta carta cualquier documento / foto / prueba que pueda ser útil en el futuro de este caso (por favor, adjunte copias y no originales).
|
||||
Varias personas fueron testigos de la infracción mencionada. Se trata de la Sra./el Sr. (nombre y apellidos).
|
||||
Le ruego que acepte, Señora, Señor Fiscal, la expresión de mis mejores sentimientos.
|
||||
Firma del funcionario de policía]],
|
||||
["unknown"] = "Desconocido",
|
||||
["delete"] = "Eliminar",
|
||||
["at"] = "En",
|
||||
["accusedName"] = "Nombre del acusado",
|
||||
["save"] = "Guardar",
|
||||
["prosecutor"] = "Fiscal",
|
||||
["accused"] = "Reconocido",
|
||||
["date"] = "Fecha",
|
||||
["see"] = "Ver",
|
||||
["username2"] = "Nombre de la persona",
|
||||
["allComplaints"] = "Todas las denuncias",
|
||||
["moveX"] = "Desplazamiento Eje X",
|
||||
["moveY"] = "Desplazamiento Eje Y",
|
||||
["moveZ"] = "Desplazamiento Eje Z",
|
||||
["rotateX"] = "Rotación eje X",
|
||||
["rotateY"] = "Rotación eje Y",
|
||||
["rotateZ"] = "Rotación eje Z",
|
||||
["rotateYY"] = "Rotación eje Y",
|
||||
["width"] = "Anchura",
|
||||
["height"] = "Altura",
|
||||
["configureLicenseplate"] = "Seleccione el vehículo \n para configurar la \n matrícula",
|
||||
["placeLicenseplate"] = "Coloque la (1) placa \n de matrícula en el lugar adecuado \n de su vehículo.",
|
||||
["placeLicenseplate2"] = "Coloque la (2) placa \n de matrícula en el lugar adecuado \n de su vehículo.",
|
||||
["undefined"] = "No tienes el trabajo adecuado para acceder en el ordenador",
|
||||
["youWon"] = "Has ganado",
|
||||
["youAddPenality"] = "Ha añadido una sanción",
|
||||
["cameraCenter"] = "Centro de cámaras",
|
||||
["cameraSecurityOfCity"] = "Cámara de seguridad de la ciudad",
|
||||
["switchCamera"] = "Pulse Usar para cambiar de cámara",
|
||||
["cantDelete"] = "No puedes eliminar esto",
|
||||
["cantDoThat"] = "No puedes hacer esto",
|
||||
["noSignal"] = "SIN SEÑAL",
|
||||
["connectionProblem"] = "Problema con la conexión",
|
||||
["computerMustBeHacked"] = "Hay que piratear el ordenador para abrir una aplicación",
|
||||
["cantAffordFine"] = "No tienes suficiente dinero para pagar la multa",
|
||||
["payFine"] = "Pagar la multa",
|
||||
["confirm"] = "CONFIRMAR",
|
||||
["category"] = "CATEGORÍA",
|
||||
["fineBook"] = "Libro de multas",
|
||||
["noPayFine"] = "No pagó la multa",
|
||||
["personAlreadyHaveFine"] = "Esta persona ya tiene una multa",
|
||||
["vehicleHaveFine"] = "Este vehículo ya tiene una multa",
|
||||
["vehicleCantReceiveFine"] = "Este vehículo no puede tener una multa",
|
||||
["noGoodJob"] = "No tienes el trabajo adecuado para añadir una multa",
|
||||
["userCantReceiveFine"] = "No se puede añadir una multa a este jugador",
|
||||
["vehicleCantHaveFine"] = "No se puede añadir multa en este vehículo",
|
||||
["richSanctions"] = "Puede añadir más sanciones",
|
||||
["mustSelectPenality"] = "Tienes que seleccionar una sanción",
|
||||
["cantAddFineToHimVehicle"] = "No puedes añadir una multa a tu vehículo",
|
||||
["noGoodJobToArrestuser"] = "No tienes el trabajo adecuado para detener a esta persona",
|
||||
["cantArrestPlayer"] = "No puedes arrestar a esta persona",
|
||||
["needHoldPlayerToArrest"] = "Debes arrastrar al jugador para encarcelarlo",
|
||||
["justPaid"] = "Acabas de pagar",
|
||||
["cantAfford"] = "No tienes suficiente dinero para hacer esto",
|
||||
["arrestMenu"] = "Menú de arrestos",
|
||||
["name"] = "Nombre",
|
||||
["price"] = "Precio",
|
||||
["reason"] = "Motivo",
|
||||
["pay"] = "Pagar",
|
||||
["arrestedPlayersList"] = "Lista de arrestados",
|
||||
["noArrestedPlayer"] = "No hay ningún jugador detenido",
|
||||
["noJailPositions"] = "No hay ninguna celda colocada, contacta con un administrador",
|
||||
["weaponsList"] = "Lista de armas",
|
||||
["confiscate"] = "CONFISCAR",
|
||||
["youSurrender"] = "Te has rendido",
|
||||
["youArrest"] = "Te han arrestado",
|
||||
["years"] = "Años",
|
||||
["tooMuchEntities"] = "Tienes demasiadas entidades",
|
||||
["spawnPropText"] = "Pulsa [USAR] para generar un prop",
|
||||
["youUnarrestBy"] = "Has sido liberado por",
|
||||
["youArrestBy"] = "Has sido arrestado por",
|
||||
["youHaveArrest"] = "Estas arrestado",
|
||||
["policeCartrunk"] = "Maletero policial",
|
||||
["cantDeleteSelfSanctions"] = "No puedes eliminar tu sanción",
|
||||
["cantEditSelfSanctions"] = "No puedes editar tu sanción",
|
||||
["seconds"] = "Segundos",
|
||||
["cameraName"] = "Nombre de la cámara",
|
||||
["cameraConfiguration"] = "Configuración de la cámara"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["fr"] = {
|
||||
["criminalRecord"] = "Casier Judiciaire",
|
||||
["recordOf"] = "Casier de",
|
||||
["username"] = "Nom de la Personne",
|
||||
["addUpperCase"] = "AJOUTER",
|
||||
["infractionReason"] = "Motif de l'infraction",
|
||||
["create"] = "Créer",
|
||||
["cancel"] = "Annuler",
|
||||
["licenseplate"] = "Plaque D'immatriculation",
|
||||
["search"] = "Rechercher",
|
||||
["noVehiclesFound"] = "Aucun Véhicule Trouvé",
|
||||
["reportText"] = [[Madame, Monsieur le Procureur,
|
||||
|
||||
Je soussigné(e) (nom et prénom), né(e) le date de naissance à lieu de naissance et exerçant la profession de (profession), vous informe porter plainte contre (nom et prénom / nom de l'entreprise / nom de l'organisation / ou X si personne non connue), résidant à (nommer l'adresse de la personne ou de l'entreprise concernée) pour (qualification de l'infraction).
|
||||
|
||||
En date du (date de l'événement), j'ai en effet été victime des faits suivants : (indiquer le plus précisément possible le détail des faits ainsi que le lieu où ils se sont produits, l'heure de l'événement et les personnes impliquées dans l'infraction). Je joins à cette lettre les documents / photos / preuves qui pourraient se révéler utiles dans la suite de cette affaire (attention à joindre des copies et non des originaux).
|
||||
|
||||
Plusieurs personnes ont été témoins de l'infraction mentionnée ci-dessus. Il s'agit de Madame / Monsieur (noms et prénoms).
|
||||
|
||||
Je vous prie d'agréer, Madame, Monsieur le Procureur, l'expression de mes sentiments distingués.
|
||||
|
||||
Signature du Policier]],
|
||||
["unknown"] = "Inconnu",
|
||||
["delete"] = "Supprimer",
|
||||
["at"] = "Le",
|
||||
["accusedName"] = "Nom de L'Accusé",
|
||||
["save"] = "Sauvegarder",
|
||||
["prosecutor"] = "Procureur",
|
||||
["accused"] = "Accusé",
|
||||
["date"] = "Date",
|
||||
["see"] = "Voir",
|
||||
["username2"] = "Nom de la Personne",
|
||||
["allComplaints"] = "Toutes les Plaintes",
|
||||
["moveX"] = "Déplacement Axe-X",
|
||||
["moveY"] = "Déplacement Axe-Y",
|
||||
["moveZ"] = "Déplacement Axe-Z",
|
||||
["rotateX"] = "Rotation Axe-X",
|
||||
["rotateY"] = "Rotation Axe-Y",
|
||||
["rotateZ"] = "Rotation Axe-Z",
|
||||
["rotateYY"] = "Rotation Axe-Y",
|
||||
["width"] = "Largeur",
|
||||
["height"] = "Hauteur",
|
||||
["configureLicenseplate"] = "Sélectioner le véhicule \n pour configurer la \n plaque d'imatriculation",
|
||||
["placeLicenseplate"] = "Placer la (1) Plaque \n D'imatriculation au bon endroit \n sur votre vehicule",
|
||||
["placeLicenseplate2"] = "Placer la (2) Plaque \n D'imatriculation au bon endroit \n sur votre vehicule",
|
||||
["undefined"] = "Vous n'avez pas le bon métier pour ouvrir l'ordinateur",
|
||||
["youWon"] = "Vous avez gagné",
|
||||
["youAddPenality"] = "Vous avez ajouté une pénalité",
|
||||
["cameraCenter"] = "Centrale des caméras",
|
||||
["cameraSecurityOfCity"] = "Caméras de Sécurité de la ville",
|
||||
["switchCamera"] = "Appuyer sur [UTILISER] pour changer de caméra",
|
||||
["cantDelete"] = "Vous ne pouvez pas supprimer ceci",
|
||||
["cantDoThat"] = "Vous ne pouvez pas faire cela",
|
||||
["noSignal"] = "AUCUN SIGNAL",
|
||||
["connectionProblem"] = "Problème de Connexion",
|
||||
["computerMustBeHacked"] = "L'ordinateur doit être hacké pour ouvrir une application",
|
||||
["cantAffordFine"] = "Vous n'avez pas assez d'argent pour payer l'amende",
|
||||
["payFine"] = "Payer l'Amende",
|
||||
["confirm"] = "CONFIRMER",
|
||||
["category"] = "CATEGORIE",
|
||||
["fineBook"] = "Carnet D'Amendes",
|
||||
["noPayFine"] = "N'a pas payé l'amende",
|
||||
["personAlreadyHaveFine"] = "Cette personne a déjà une amende",
|
||||
["vehicleHaveFine"] = "Ce vehicule a déjà une amende",
|
||||
["vehicleCantReceiveFine"] = "Ce vehicule ne peut pas recevoir d'amende",
|
||||
["noGoodJob"] = "Vous n'avez pas le bon métier pour ajouter une amende",
|
||||
["userCantReceiveFine"] = "Cette personne ne peut pas recevoir d'amende",
|
||||
["vehicleCantHaveFine"] = "Ce vehicule ne peut pas recevoir d'amende",
|
||||
["richSanctions"] = "Vous avez atteint la limite de sanction",
|
||||
["mustSelectPenality"] = "Vous devez sélectionner une pénalité",
|
||||
["cantAddFineToHimVehicle"] = "Vous ne pouvez pas ajouter une amende à votre vehicule",
|
||||
["noGoodJobToArrestuser"] = "Vous n'avez pas le bon métier pour arrêter cette personne",
|
||||
["cantArrestPlayer"] = "Vous ne pouvez pas arrêter cette personne",
|
||||
["needHoldPlayerToArrest"] = "Vous devez tenir une personne menottée pour la mettre en prison",
|
||||
["justPaid"] = "Vous venez de payer",
|
||||
["cantAfford"] = "Vous n'avez pas assez d'argent pour faire ceci",
|
||||
["arrestMenu"] = "Menu d'Arrestation",
|
||||
["name"] = "Nom",
|
||||
["price"] = "Prix",
|
||||
["reason"] = "Motif",
|
||||
["pay"] = "Payer",
|
||||
["arrestedPlayersList"] = "Liste des Prisonniers",
|
||||
["noArrestedPlayer"] = "Aucune personne n'est arrêtée",
|
||||
["noJailPositions"] = "Il n'y a aucune position de prison. Veuillez contacter un administrateur",
|
||||
["weaponsList"] = "Liste des Armes",
|
||||
["confiscate"] = "CONFISQUER",
|
||||
["youSurrender"] = "Vous vous rendez",
|
||||
["youArrest"] = "Vous êtes arrêté",
|
||||
["years"] = "Années",
|
||||
["tooMuchEntities"] = "Vous avez trop d'entités",
|
||||
["spawnPropText"] = "Appuyez sur [UTILISER] pour faire apparaître le prop",
|
||||
["youUnarrestBy"] = "Vous avez été libéré par",
|
||||
["youArrestBy"] = "Vous avez été arrêté par",
|
||||
["youHaveArrest"] = "Vous avez arrêté",
|
||||
["policeCartrunk"] = "Coffre de Police",
|
||||
["cantDeleteSelfSanctions"] = "Vous ne pouvez pas supprimer une de vos sanctions",
|
||||
["cantEditSelfSanctions"] = "Vous ne pouvez pas éditer une de vos sanctions",
|
||||
["seconds"] = "Secondes",
|
||||
["cameraName"] = "Nom de la Caméra",
|
||||
["cameraConfiguration"] = "Configuration des Caméras"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["it"] = {
|
||||
["criminalRecord"] = "Casellario Giudiziario",
|
||||
["recordOf"] = "Casellario di",
|
||||
["username"] = "Nome dell'Utente",
|
||||
["addUpperCase"] = "AGGIUNGERE",
|
||||
["infractionReason"] = "Motivo dell'Infrazione",
|
||||
["create"] = "Creare",
|
||||
["cancel"] = "Annullare",
|
||||
["licenseplate"] = "Targa",
|
||||
["search"] = "Cerca",
|
||||
["noVehiclesFound"] = "Nessun Veicolo Trovato",
|
||||
["reportText"] = [[Signore, Signora Procuratore,
|
||||
|
||||
Io sottoscritto(a) (nome e cognome), nato(a) il data di nascita a luogo di nascita e che esercito la professione di (professione), informo di voler sporgere denuncia contro (nome e cognome / nome dell'azienda / nome dell'organizzazione / o X se persona sconosciuta), residente a (indirizzare della persona o dell'azienda coinvolta) per (qualifica dell'infrazione).
|
||||
|
||||
In data (data dell'evento), sono stato vittima dei seguenti fatti: (descrivere il più precisamente possibile i dettagli dei fatti così come il luogo dove sono accaduti, l'ora dell'evento e le persone coinvolte nell'infrazione). Allego a questa lettera i documenti / foto / prove che potrebbero rivelarsi utili nel proseguo di questa causa (attenzione a allegare copie e non originali).
|
||||
|
||||
Diverse persone hanno assistito all'infrazione sopra menzionata. Si tratta di Signora / Signore (nomi e cognomi).
|
||||
|
||||
Prego di accettare, Signore, Signora Procuratore, l'espressione dei miei distinti saluti.
|
||||
|
||||
Firma del Poliziotto]],
|
||||
["unknown"] = "Sconosciuto",
|
||||
["delete"] = "Elimina",
|
||||
["at"] = "Il",
|
||||
["accusedName"] = "Nome dell'Accusato",
|
||||
["save"] = "Salva",
|
||||
["prosecutor"] = "Procuratore",
|
||||
["accused"] = "Accusato",
|
||||
["date"] = "Data",
|
||||
["see"] = "Vedi",
|
||||
["username2"] = "Nome dell'Utente",
|
||||
["allComplaints"] = "Tutti i Reclami",
|
||||
["moveX"] = "Spostamento Asse-X",
|
||||
["moveY"] = "Spostamento Asse-Y",
|
||||
["moveZ"] = "Spostamento Asse-Z",
|
||||
["rotateX"] = "Rotazione Asse-X",
|
||||
["rotateY"] = "Rotazione Asse-Y",
|
||||
["rotateZ"] = "Rotazione Asse-Z",
|
||||
["rotateYY"] = "Rotazione Asse-Y",
|
||||
["width"] = "Larghezza",
|
||||
["height"] = "Altezza",
|
||||
["configureLicenseplate"] = "Seleziona il veicolo \n per configurare la \n targa",
|
||||
["placeLicenseplate"] = "Posiziona la (1) Targa \n nel posto giusto \n sul tuo veicolo",
|
||||
["placeLicenseplate2"] = "Posiziona la (2) Targa \n nel posto giusto \n sul tuo veicolo",
|
||||
["undefined"] = "Non hai il giusto mestiere per aprire il computer",
|
||||
["youWon"] = "Hai vinto",
|
||||
["youAddPenality"] = "Hai aggiunto una penalità",
|
||||
["cameraCenter"] = "Centrale delle telecamere",
|
||||
["cameraSecurityOfCity"] = "Telecamere di Sicurezza della città",
|
||||
["switchCamera"] = "Premi [UTILIZZARE] per cambiare telecamera",
|
||||
["cantDelete"] = "Non puoi eliminare questo",
|
||||
["cantDoThat"] = "Non puoi fare questo",
|
||||
["noSignal"] = "NESSUN SEGNALE",
|
||||
["connectionProblem"] = "Problema di Connessione",
|
||||
["computerMustBeHacked"] = "Il computer deve essere hackerato per aprire un'applicazione",
|
||||
["cantAffordFine"] = "Non hai abbastanza soldi per pagare la multa",
|
||||
["payFine"] = "Paga la Multa",
|
||||
["confirm"] = "CONFERMA",
|
||||
["category"] = "CATEGORIA",
|
||||
["fineBook"] = "Libretto delle Multe",
|
||||
["noPayFine"] = "Non ha pagato la multa",
|
||||
["personAlreadyHaveFine"] = "Questa persona ha già una multa",
|
||||
["vehicleHaveFine"] = "Questo veicolo ha già una multa",
|
||||
["vehicleCantReceiveFine"] = "Questo veicolo non può ricevere multe",
|
||||
["noGoodJob"] = "Non hai il mestiere giusto per aggiungere una multa",
|
||||
["userCantReceiveFine"] = "Questa persona non può ricevere multe",
|
||||
["vehicleCantHaveFine"] = "Questo veicolo non può avere multe",
|
||||
["richSanctions"] = "Hai raggiunto il limite di sanzioni",
|
||||
["mustSelectPenality"] = "Devi selezionare una penalità",
|
||||
["cantAddFineToHimVehicle"] = "Non puoi aggiungere una multa al tuo veicolo",
|
||||
["noGoodJobToArrestuser"] = "Non hai il mestiere giusto per arrestare questa persona",
|
||||
["cantArrestPlayer"] = "Non puoi arrestare questa persona",
|
||||
["needHoldPlayerToArrest"] = "Devi trattenere una persona ammanettata per metterla in prigione",
|
||||
["justPaid"] = "Hai appena pagato",
|
||||
["cantAfford"] = "Non hai abbastanza soldi per fare questo",
|
||||
["arrestMenu"] = "Menu di Arresto",
|
||||
["name"] = "Nome",
|
||||
["price"] = "Prezzo",
|
||||
["reason"] = "Motivo",
|
||||
["pay"] = "Paga",
|
||||
["arrestedPlayersList"] = "Lista dei Prigionieri",
|
||||
["noArrestedPlayer"] = "Nessuna persona è arrestata",
|
||||
["noJailPositions"] = "Non ci sono posizioni di prigione. Si prega di contattare un amministratore",
|
||||
["weaponsList"] = "Lista delle Armi",
|
||||
["confiscate"] = "CONFISCA",
|
||||
["youSurrender"] = "Ti arrendi",
|
||||
["youArrest"] = "Sei arrestato",
|
||||
["years"] = "Anni",
|
||||
["tooMuchEntities"] = "Hai troppe entità",
|
||||
["spawnPropText"] = "Premi su [UTILIZZARE] per far apparire il prop",
|
||||
["youUnarrestBy"] = "Sei stato liberato da",
|
||||
["youArrestBy"] = "Sei stato arrestato da",
|
||||
["youHaveArrest"] = "Hai arrestato",
|
||||
["policeCartrunk"] = "Baule della Polizia",
|
||||
["cantDeleteSelfSanctions"] = "Non puoi eliminare una delle tue sanzioni",
|
||||
["cantEditSelfSanctions"] = "Non puoi modificare una delle tue sanzioni",
|
||||
["seconds"] = "Secondi",
|
||||
["cameraName"] = "Nome della Camera",
|
||||
["cameraConfiguration"] = "Configurazione delle Camere"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["ptbr"] = {
|
||||
["criminalRecord"] = "Registro criminal",
|
||||
["recordOf"] = "Armário de",
|
||||
["username"] = "Nome da Pessoa",
|
||||
["addUpperCase"] = "ADICIONAR",
|
||||
["infractionReason"] = "Motivo da ofensa",
|
||||
["create"] = "Criar",
|
||||
["cancel"] = "Cancelar",
|
||||
["licenseplate"] = "Placa de carro",
|
||||
["search"] = "Procurar",
|
||||
["noVehiclesFound"] = "Nenhum veículo encontrado",
|
||||
["reportText"] = [[Senhora, senhor promotor,
|
||||
|
||||
Eu, abaixo assinado (nome e sobrenome), nascido na data de nascimento no local de nascimento e exercendo a profissão de (profissão), informo que estou apresentando reclamação contra (nome e sobrenome/nome da empresa/nome do organização / ou X se desconhecido), residente em (indicar o endereço da pessoa ou empresa em causa) para (qualificação da infracção).
|
||||
|
||||
Em (data do facto), fui efectivamente vítima dos seguintes factos: (indicar com a maior precisão possível os detalhes dos factos, bem como o local onde ocorreram, a hora do facto e as pessoas envolvidas na infracção ). Anexo a esta carta quaisquer documentos/fotos/evidências que possam ser úteis no futuro deste caso (anexe cópias e não originais).
|
||||
|
||||
Várias pessoas testemunharam o crime acima mencionado. Eles são Sra/Sr (nome e sobrenome).
|
||||
|
||||
Por favor, aceite, Senhora, Senhor Promotor, a expressão dos meus melhores sentimentos.
|
||||
|
||||
Assinatura do Policial]],
|
||||
["unknown"] = "Desconhecido",
|
||||
["delete"] = "Excluir",
|
||||
["at"] = "O",
|
||||
["accusedName"] = "Nome do Acusado",
|
||||
["save"] = "Salvar",
|
||||
["prosecutor"] = "Promotor",
|
||||
["accused"] = "Reconhecido",
|
||||
["date"] = "Data",
|
||||
["see"] = "Ver",
|
||||
["username2"] = "Nome da Pessoa",
|
||||
["allComplaints"] = "Todas as reclamações",
|
||||
["moveX"] = "Deslocamento Eixo X",
|
||||
["moveY"] = "Deslocamento Eixo Y",
|
||||
["moveZ"] = "Deslocamento Eixo Z",
|
||||
["rotateX"] = "Rotação Eixo X",
|
||||
["rotateY"] = "Rotação Eixo Y",
|
||||
["rotateZ"] = "Rotação Eixo Z",
|
||||
["rotateYY"] = "Rotação Eixo Y",
|
||||
["width"] = "Largura",
|
||||
["height"] = "Altura",
|
||||
["configureLicenseplate"] = "Selecione o veículo \n para configurar a \n licença da placa",
|
||||
["placeLicenseplate"] = "Coloque a (1) Licença \n Placa no lugar certo \n do seu veículo",
|
||||
["placeLicenseplate2"] = "Coloque a (2) Licença \n Placa no lugar certo \n do seu veículo",
|
||||
["undefined"] = "Você não tem o emprego certo para acessar o computador",
|
||||
["youWon"] = "Você acabou de ganhar",
|
||||
["youAddPenality"] = "Você adicionou uma penalidade",
|
||||
["cameraCenter"] = "Centro de Câmeras",
|
||||
["cameraSecurityOfCity"] = "Câmera de Segurança da Cidade",
|
||||
["switchCamera"] = "Pressione Usar para alterar a câmera",
|
||||
["cantDelete"] = "Você não pode excluir isso",
|
||||
["cantDoThat"] = "Você não pode fazer isso",
|
||||
["noSignal"] = "SEM SINAL",
|
||||
["connectionProblem"] = "Problema com na conexão",
|
||||
["computerMustBeHacked"] = "O computador precisa ser hackeado para abrir um aplicativo",
|
||||
["cantAffordFine"] = "Você não tem dinheiro suficiente para pagar a multa",
|
||||
["payFine"] = "Pague a multa",
|
||||
["confirm"] = "CONFIRMAR",
|
||||
["category"] = "CATEGORIA",
|
||||
["fineBook"] = "Livro fino",
|
||||
["noPayFine"] = "Não pagou a multa",
|
||||
["personAlreadyHaveFine"] = "Essa pessoa já possui uma multa",
|
||||
["vehicleHaveFine"] = "Este veículo já esta multado",
|
||||
["vehicleCantReceiveFine"] = "Este veículo não pode ter multa",
|
||||
["noGoodJob"] = "Você não tem o emprego certo para adicionar uma multa",
|
||||
["userCantReceiveFine"] = "Você não pode adicionar uma multa a este jogador",
|
||||
["vehicleCantHaveFine"] = "Você não pode adicionar uma multa neste veículo",
|
||||
["richSanctions"] = "Você pode adicionar mais penalidade",
|
||||
["mustSelectPenality"] = "Você tem que selecionar uma penalidade",
|
||||
["cantAddFineToHimVehicle"] = "Você não pode adicionar uma multa ao seu veículo",
|
||||
["noGoodJobToArrestuser"] = "Você não tem o emprego certo para prender essa pessoa",
|
||||
["cantArrestPlayer"] = "Você não pode prender essa pessoa",
|
||||
["needHoldPlayerToArrest"] = "Você deve segurar um jogador para poder prender alguém",
|
||||
["justPaid"] = "Você acabou de pagar",
|
||||
["cantAfford"] = "Você não tem dinheiro suficiente para fazer isso",
|
||||
["arrestMenu"] = "Menu de Prisão",
|
||||
["name"] = "Nome",
|
||||
["price"] = "Preço",
|
||||
["reason"] = "Motivo",
|
||||
["pay"] = "Pagar",
|
||||
["arrestedPlayersList"] = "Lista de presos",
|
||||
["noArrestedPlayer"] = "Não há nenhum jogador preso",
|
||||
["noJailPositions"] = "Não há uma posição na prisão, entre em contato com um administrador",
|
||||
["weaponsList"] = "Lista de Armas",
|
||||
["confiscate"] = "CONFISCAR",
|
||||
["youSurrender"] = "Você está se rendendo",
|
||||
["youArrest"] = "Você está preso",
|
||||
["years"] = "Anos",
|
||||
["tooMuchEntities"] = "Você tem muitas entidades",
|
||||
["spawnPropText"] = "Pressione [USE] para gerar o prop",
|
||||
["youUnarrestBy"] = "Você foi liberado por",
|
||||
["youArrestBy"] = "Você foi preso por",
|
||||
["youHaveArrest"] = "Você foi Preso",
|
||||
["policeCartrunk"] = "Porta-malas da Polícia",
|
||||
["cantDeleteSelfSanctions"] = "Você não pode excluir sua penalidade",
|
||||
["cantEditSelfSanctions"] = "Você não pode editar sua penalidade",
|
||||
["seconds"] = "Segundos",
|
||||
["cameraName"] = "Nome da câmera",
|
||||
["cameraConfiguration"] = "Configuração da câmera"
|
||||
}
|
||||
// PT-BR by: pop pic (https://www.gmodstore.com/users/poppic)
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["ru"] = {
|
||||
["criminalRecord"] = "База данных ФСБ (АСД)",
|
||||
["criminalRecord_SBU"] = "База данных СБУ",
|
||||
["recordOf"] = "Материалы дела на:",
|
||||
["username"] = "ФИО гражданина",
|
||||
["addUpperCase"] = "ВНЕСТИ",
|
||||
["infractionReason"] = "Статья/Правонарушение",
|
||||
["create"] = "Создать",
|
||||
["cancel"] = "Отмена",
|
||||
["licenseplate"] = "Регистрационный номер",
|
||||
["search"] = "Поиск по базе",
|
||||
["noVehiclesFound"] = "Транспорт не найден",
|
||||
["reportText"] = [[Начальнику Управления ФСБ России по г. Херсону
|
||||
|
||||
Я, нижеподписавшийся (ФИО), (дата рождения) г.р., место рождения (место рождения), род занятий (должность/звание), уведомляю Вас о подаче официальной жалобы на (ФИО / Название организации / или 'Неизвестное лицо'), проживающего/расположенного по адресу (адрес) в связи с совершением (квалификация нарушения/преступления).
|
||||
|
||||
(Дата происшествия) я стал свидетелем/жертвой следующих событий: (укажите детали фактов, место, время и лиц, причастных к нарушению). К заявлению прилагаю вещественные доказательства / фотоматериалы / документы, имеющие значение для дела.
|
||||
|
||||
Свидетели происшествия: (ФИО свидетелей).
|
||||
|
||||
Об ответственности за заведомо ложный донос по ст. 306 УК РФ предупрежден(а).
|
||||
|
||||
__________________________
|
||||
Подпись сотрудника ФСБ]],
|
||||
["reportText_SBU"] = [[Начальнику Управления СБУ по г. Херсону
|
||||
|
||||
Я, нижеподписавшийся (ФИО), (дата рождения) г.р., место рождения (место рождения), род занятий (должность/звание), уведомляю Вас о подаче официальной жалобы на (ФИО / Название организации / или 'Неизвестное лицо'), проживающего/расположенного по адресу (адрес) в связи с совершением (квалификация нарушения/преступления).
|
||||
|
||||
(Дата происшествия) я стал свидетелем/жертвой следующих событий: (укажите детали фактов, место, время и лиц, причастных к нарушению). К заявлению прилагаю вещественные доказательства / фотоматериалы / документы, имеющие значение для дела.
|
||||
|
||||
Свидетели происшествия: (ФИО свидетелей).
|
||||
|
||||
Об ответственности за заведомо ложный донос по ст. 383 УК Украины предупрежден(а).
|
||||
|
||||
__________________________
|
||||
Подпись сотрудника СБУ]],
|
||||
["unknown"] = "Личность не установлена",
|
||||
["delete"] = "Удалить",
|
||||
["at"] = " ",
|
||||
["accusedName"] = "Имя подозреваемого",
|
||||
["save"] = "Сохранить",
|
||||
["prosecutor"] = "Следователь",
|
||||
["accused"] = "Подозреваемый",
|
||||
["date"] = "Дата внесения",
|
||||
["see"] = "Просмотр",
|
||||
["username2"] = "ФИО объекта",
|
||||
["allComplaints"] = "Все материалы",
|
||||
["moveX"] = "Смещение по оси X",
|
||||
["moveY"] = "Смещение по оси Y",
|
||||
["moveZ"] = "Смещение по оси Z",
|
||||
["rotateX"] = "Вращение по оси X",
|
||||
["rotateY"] = "Вращение по оси Y",
|
||||
["rotateZ"] = "Вращение по оси Z",
|
||||
["rotateYY"] = "Вращение по оси Y",
|
||||
["width"] = "Ширина",
|
||||
["height"] = "Высота",
|
||||
["configureLicenseplate"] = "Выберите транспорт \n для настройки \n номерного знака",
|
||||
["placeLicenseplate"] = "Установите основной \n номер на корпусе \n транспортного средства",
|
||||
["placeLicenseplate2"] = "Установите дублирующий \n номер на корпусе \n транспортного средства",
|
||||
["undefined"] = "Доступ ограничен! Требуется авторизация в системе ФСБ",
|
||||
["undefined_SBU"] = "Доступ ограничен! Требуется авторизация в системе СБУ",
|
||||
["youWon"] = "Зачислено:",
|
||||
["youAddPenality"] = "Протокол составлен",
|
||||
["cameraCenter"] = "Узел защищенной связи",
|
||||
["cameraSecurityOfCity"] = "Оперативная камера наблюдения",
|
||||
["switchCamera"] = "Нажмите [ИСПОЛЬЗОВАТЬ] для переключения канала",
|
||||
["cantDelete"] = "Недостаточно прав для удаления",
|
||||
["cantDoThat"] = "Операция отклонена",
|
||||
["noSignal"] = "АБОНЕНТ ВНЕ СЕТИ",
|
||||
["connectionProblem"] = "Разрыв соединения",
|
||||
["computerMustBeHacked"] = "Требуется обход протоколов безопасности для доступа",
|
||||
["cantAffordFine"] = "Недостаточно средств для погашения штрафа",
|
||||
["payFine"] = "Погасить штраф",
|
||||
["confirm"] = "ПОДТВЕРДИТЬ",
|
||||
["category"] = "КАТЕГОРИЯ",
|
||||
["fineBook"] = "Бланк протокола",
|
||||
["noPayFine"] = "Задолженность не погашена",
|
||||
["personAlreadyHaveFine"] = "У объекта уже имеется действующее взыскание",
|
||||
["vehicleHaveFine"] = "Транспорт находится под арестом/штрафом",
|
||||
["vehicleCantReceiveFine"] = "Данный транспорт не подлежит штрафованию",
|
||||
["noGoodJob"] = "У вас нет полномочий ФСБ для выписки протоколов",
|
||||
["noGoodJob_SBU"] = "У вас нет полномочий СБУ для выписки протоколов",
|
||||
["userCantReceiveFine"] = "Объект обладает неприкосновенностью",
|
||||
["vehicleCantHaveFine"] = "Регистрация протокола на данный транспорт невозможна",
|
||||
["richSanctions"] = "Объект допускает дополнительные взыскания",
|
||||
["mustSelectPenality"] = "Выберите статью нарушения",
|
||||
["cantAddFineToHimVehicle"] = "Нельзя выписать штраф на служебный транспорт",
|
||||
["noGoodJobToArrestuser"] = "У вас нет полномочий проводить задержание",
|
||||
["cantArrestPlayer"] = "Задержание данного лица запрещено",
|
||||
["needHoldPlayerToArrest"] = "Необходимо конвоировать задержанного для водворения в ИТТ",
|
||||
["justPaid"] = "Штраф погашен:",
|
||||
["cantAfford"] = "Недостаточно средств",
|
||||
["arrestMenu"] = "Протокол задержания",
|
||||
["name"] = "Наименование",
|
||||
["price"] = "Сумма",
|
||||
["reason"] = "Основание",
|
||||
["pay"] = "Оплатить",
|
||||
["arrestedPlayersList"] = "Лица под стражей",
|
||||
["noArrestedPlayer"] = "Задержанные отсутствуют",
|
||||
["noJailPositions"] = "Точки ИТТ не найдены. Свяжитесь со штабом.",
|
||||
["weaponsList"] = "Изъятое имущество",
|
||||
["confiscate"] = "КОНФИСКОВАТЬ",
|
||||
["youSurrender"] = "Вы сложили оружие",
|
||||
["youArrest"] = "Вы задержаны сотрудниками ФСБ",
|
||||
["youArrest_SBU"] = "Вы задержаны сотрудниками СБУ",
|
||||
["years"] = "Суток",
|
||||
["tooMuchEntities"] = "Превышен лимит развертывания",
|
||||
["spawnPropText"] = "Нажмите [E] для развертывания спецсредства",
|
||||
["youUnarrestBy"] = "Вы освобождены распоряжением:",
|
||||
["youArrestBy"] = "Вы задержаны сотрудником:",
|
||||
["youHaveArrest"] = "Вы задержали объект",
|
||||
["policeCartrunk"] = "Багажник спецтранспорта",
|
||||
["cantDeleteSelfSanctions"] = "Удаление личных взысканий запрещено",
|
||||
["cantEditSelfSanctions"] = "Правка личного дела невозможна",
|
||||
["seconds"] = "сек.",
|
||||
["cameraName"] = "Позывной камеры",
|
||||
["cameraConfiguration"] = "Конфигурация канала связи",
|
||||
["press"] = "нажмите",
|
||||
["terminalName"] = "Терминал ФСБ",
|
||||
["terminalName_SBU"] = "Терминал СБУ",
|
||||
["osName"] = "АСД-ФСБ",
|
||||
["osName_SBU"] = "АСД-СБУ",
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
Realistic_Police.Language = Realistic_Police.Language or {}
|
||||
|
||||
Realistic_Police.Language["tr"] = {
|
||||
["criminalRecord"] = "Sabika Kaydi",
|
||||
["recordOf"] = "Dolap sahibi",
|
||||
["username"] = "Kisinin Ismi",
|
||||
["addUpperCase"] = "EKLE",
|
||||
["infractionReason"] = "Sucun nedeni",
|
||||
["create"] = "Olustur",
|
||||
["cancel"] = "Iptal Et",
|
||||
["licenseplate"] = "Plaka",
|
||||
["search"] = "Ara",
|
||||
["noVehiclesFound"] = "Hicbir arac bulunamadi",
|
||||
["reportText"] = [[Bayan, Bay. Savci,
|
||||
|
||||
Ben asagida imzasi bulunan (Isim ve soy isim), (Dogum yeri ve dogum gunu) dogan ve meslegi (mesleginiz) olan bir sikayetciyim. Bu vesile ile (Isim ve Soyisim / sirket ismi / organizasyon ismi / veya bilinmiyorsa X), (sirketin veya sahisin adresi)'nde ikamet eden ve (sucun niteligi).
|
||||
|
||||
(olayin tarihi) tarihinde gerceklesen bu olaydan sikayetciyim, Bu olayin kurbani oldugumu su sebeplerle gostereyim: (yasanan olayi tum detaylarla, mekan isimleri,saatiyle beraber her detayına kadar yazin). Bu davanin kisa surmesinde yardimci olan dokuman/fotograf/kanit ve benzeri dokumanlari suraya birakiyorum (lutfen fotograflari buraya yerlestiriniz).
|
||||
|
||||
Asagida adi gecen birkac sahis olaya taniklik etmislerdir. Bunlar Bay/Bayan (tam adlari), (tanikin istikamet ettigi yer)'da istikamet ediyorlar ve su numaradan ulasilabilir (tanikin telefon numarasi).
|
||||
|
||||
Asagida adi gecen birkac sahis olaya taniklik etmislerdir. Bunlar Bay / Bayan (isim ve soy isimleri).
|
||||
|
||||
Lutfen bu davayi cozmenizi rica ediyorum, Bayan, Bay Savci, size sans dileyip tesekkur ediyorum, iyi gunler.
|
||||
|
||||
Polis Memurunun Imzasi]],
|
||||
["unknown"] = "Bilinmeyen",
|
||||
["delete"] = "Sil",
|
||||
["at"] = "The",
|
||||
["accusedName"] = "Sanik Adi",
|
||||
["save"] = "Kaydet",
|
||||
["prosecutor"] = "Savci",
|
||||
["accused"] = "Taninan",
|
||||
["date"] = "Tarih",
|
||||
["see"] = "Goz At",
|
||||
["username2"] = "Kisinin ismi",
|
||||
["allComplaints"] = "Tum sikayetler",
|
||||
["moveX"] = "Yerlestirmenin X-ekseni",
|
||||
["moveY"] = "Yerlestirmenin Y-ekseni",
|
||||
["moveZ"] = "Yerlestirmenin Z-ekseni",
|
||||
["rotateX"] = "Donmenin X-ekseni",
|
||||
["rotateY"] = "Donmenin Y-ekseni",
|
||||
["rotateZ"] = "Donmenin Z-ekseni",
|
||||
["rotateYY"] = "Donmenin Y-ekseni",
|
||||
["width"] = "Genislik",
|
||||
["height"] = "Yukseklik",
|
||||
["configureLicenseplate"] = "Plakayi yapilandirmak \n icin bir arac seciniz",
|
||||
["placeLicenseplate"] = "Plakayi (1) aracin guzel \n ve gorunulebilir yerine \n yerlestirin",
|
||||
["placeLicenseplate2"] = "Plakayi (2) aracin guzel \n ve gorunulebilir yerine \n yerlestirin",
|
||||
["undefined"] = "Bilgisayara erişmek için doğru işiniz yok",
|
||||
["youWon"] = "Kazandin",
|
||||
["youAddPenality"] = "Bir ceza ekledin",
|
||||
["cameraCenter"] = "Kamera Merkezi",
|
||||
["cameraSecurityOfCity"] = "Sehirin guvenlik kamerasi",
|
||||
["switchCamera"] = "Kamerayi degistirmek icin kullan tusuna basin",
|
||||
["cantDelete"] = "Bunu silemezsin",
|
||||
["cantDoThat"] = "Bunu yapamazsin",
|
||||
["noSignal"] = "SINYAL YOK",
|
||||
["connectionProblem"] = "Baglantida bir problem var",
|
||||
["computerMustBeHacked"] = "Bir uygulamayi acmak icin bilgisayari hacklemen gerekir",
|
||||
["cantAffordFine"] = "Cezayi odemek icin yeterli paran yok",
|
||||
["payFine"] = "Cezayi Ode",
|
||||
["confirm"] = "ONAYLA",
|
||||
["category"] = "KATEGORI",
|
||||
["fineBook"] = "Ceza Defteri",
|
||||
["noPayFine"] = "Para Cezasini Odemedi",
|
||||
["personAlreadyHaveFine"] = "Bu sahis adina zaten bir para cezasi kesilmis durumda",
|
||||
["vehicleHaveFine"] = "Bu arac adina zaten bir para cezasi kesilmis durumda",
|
||||
["vehicleCantReceiveFine"] = "Bu araca ceza kesemezsiniz",
|
||||
["noGoodJob"] = "Ceza eklemek icin dogru meslekte degilsiniz",
|
||||
["userCantReceiveFine"] = "Bu oyuncuya para cezasi kesemezsin",
|
||||
["vehicleCantHaveFine"] = "Bu araca para cezasi kesemezsin",
|
||||
["richSanctions"] = "Daha fazla ceza kesebilirsin",
|
||||
["mustSelectPenality"] = "Bir ceza secmen lazim",
|
||||
["cantAddFineToHimVehicle"] = "Kendi aracina ceza kesemezsin",
|
||||
["noGoodJobToArrestuser"] = "Bu oyuncuyu tutuklamak icin dogru meslege sahip degilsin",
|
||||
["cantArrestPlayer"] = "Bu oyuncuyu tutuklayamazsin",
|
||||
["needHoldPlayerToArrest"] = "Birini hapise atmak icin suruklemen lazim",
|
||||
["justPaid"] = "Su kadar odedin",
|
||||
["cantAfford"] = "Bunu yapmaya yeterli paran yok",
|
||||
["arrestMenu"] = "Tutuklama Menusu",
|
||||
["name"] = "Isim",
|
||||
["price"] = "Ucret",
|
||||
["reason"] = "Motif",
|
||||
["pay"] = "Ode",
|
||||
["arrestedPlayersList"] = "Tutuklananlarin Listesi",
|
||||
["noArrestedPlayer"] = "Hicbir oyuncu tutuklanmamis",
|
||||
["noJailPositions"] = "Ayarlanmis herhangi bir hapis pozisyonu yok, bir admine ulasin",
|
||||
["weaponsList"] = "Silah Listesi",
|
||||
["confiscate"] = "EL KOY",
|
||||
["youSurrender"] = "Teslim Oldunuz",
|
||||
["youArrest"] = "Tutuklusunuz",
|
||||
["years"] = "Yil",
|
||||
["tooMuchEntities"] = "Birçok varlığa sahipsin",
|
||||
["spawnPropText"] = "Pervaneyi oluşturmak için [USE] tuşuna basın",
|
||||
["youUnarrestBy"] = "Tarafından serbest bırakıldınız",
|
||||
["youArrestBy"] = "Tarafından tutuklandın",
|
||||
["youHaveArrest"] = "Tutukladın",
|
||||
["policeCartrunk"] = "Polis Sandıgı",
|
||||
["cantDeleteSelfSanctions"] = "Penalitesini silemezsin",
|
||||
["cantEditSelfSanctions"] = "Penalitesini düzenleyemezsin",
|
||||
["seconds"] = "saniye",
|
||||
["cameraName"] = "Kamera Adı",
|
||||
["cameraConfiguration"] = "Kamera Yapılandırması"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,636 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
|
||||
function Realistic_Police.GetSpawnPoint(ply)
|
||||
local ent = hook.Run("PlayerSelectSpawn", ply, false)
|
||||
|
||||
if ent && isfunction(ent.GetPos) then
|
||||
return ent:GetPos()
|
||||
elseif DarkRP then
|
||||
local spawnVector = DarkRP.retrieveTeamSpawnPos(ply:Team()) or {}
|
||||
|
||||
local randomSpawn = math.random(#spawnVector)
|
||||
|
||||
if isvector(spawnVector[randomSpawn]) then
|
||||
return spawnVector[randomSpawn]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Send a notification to a player
|
||||
function Realistic_Police.SendNotify(ply, msg)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
net.Start("RealisticPolice:Open")
|
||||
net.WriteString("Notify")
|
||||
net.WriteString(msg)
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
-- This function generate a random plate
|
||||
function Realistic_Police.GeneratePlate(ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/rpt_plate.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
local String = Realistic_Police.Letters().." "..Realistic_Police.Number().." "..Realistic_Police.Letters()
|
||||
|
||||
-- Check if the plate does not exist and check if the player don't have already a data
|
||||
if not Realistic_Police.CheckExist(String) && not Realistic_Police.PlayerData(ply) then
|
||||
RealisticPoliceTab[ply:SteamID()] = {
|
||||
["Plate"] = String,
|
||||
["CustomPlate"] = "",
|
||||
}
|
||||
file.Write("realistic_police/rpt_plate.txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
elseif not Realistic_Police.PlayerData(ply) then
|
||||
Realistic_Police.GeneratePlate(ply)
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.ChangePlate(ply, plateName, syncVehc)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/rpt_plate.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
RealisticPoliceTab[ply:SteamID()] = {
|
||||
["Plate"] = plateName,
|
||||
["CustomPlate"] = "",
|
||||
}
|
||||
file.Write("realistic_police/rpt_plate.txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
|
||||
if IsValid(syncVehc) then Realistic_Police.SetInfoVehc(syncVehc) end
|
||||
end
|
||||
|
||||
-- Check if the Plate already exist
|
||||
function Realistic_Police.CheckExist(Plate)
|
||||
if not isstring(Plate) then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/rpt_plate.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
for k,v in pairs(RealisticPoliceTab) do
|
||||
if v.Plate == Plate then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Check if the player have already a license plate
|
||||
function Realistic_Police.PlayerData(ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/rpt_plate.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
return istable(RealisticPoliceTab[ply:SteamID()])
|
||||
end
|
||||
|
||||
-- Get the Plate of the player by his steamid
|
||||
function Realistic_Police.GetPlate(ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/rpt_plate.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
if not istable(RealisticPoliceTab[ply:SteamID()]) then return end
|
||||
|
||||
return RealisticPoliceTab[ply:SteamID()]["Plate"]
|
||||
end
|
||||
|
||||
-- Compress the Report table and Send the table to client
|
||||
function Realistic_Police.SendReport(RPTSteamID64, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/report/"..RPTSteamID64..".txt", "DATA") or ""
|
||||
local CompressTable = util.Compress(RealisticPoliceFil)
|
||||
|
||||
net.Start("RealisticPolice:Report")
|
||||
net.WriteInt(CompressTable:len(), 32)
|
||||
net.WriteData(CompressTable, CompressTable:len() )
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
-- Compress the Criminal Record table and Send the table to client
|
||||
function Realistic_Police.SendRecord(RPTSteamID64, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
if not IsValid(player.GetBySteamID64(RPTSteamID64)) or not player.GetBySteamID64(RPTSteamID64):IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/record/"..RPTSteamID64..".txt", "DATA") or ""
|
||||
local CompressTable = util.Compress(RealisticPoliceFil)
|
||||
|
||||
net.Start("RealisticPolice:CriminalRecord")
|
||||
net.WriteInt(CompressTable:len(), 32)
|
||||
net.WriteData(CompressTable, CompressTable:len())
|
||||
net.WriteEntity(player.GetBySteamID64(RPTSteamID64))
|
||||
net.Send(ply)
|
||||
end
|
||||
|
||||
-- Random letters for the license plate
|
||||
function Realistic_Police.Letters()
|
||||
return string.char( math.random(65,90 ))..string.char( math.random(65,90 ))
|
||||
end
|
||||
|
||||
-- Random numbers for the license plate
|
||||
function Realistic_Police.Number()
|
||||
return tostring(math.random(1, 9)..math.random(1, 9)..math.random(1, 9))
|
||||
end
|
||||
|
||||
function Realistic_Police.CompatibilitiesATM(ply, plyMoney, amountToPay)
|
||||
if not IsValid(ply) then return end
|
||||
|
||||
local neededAmountFromBank = (amountToPay - plyMoney)
|
||||
if neededAmountFromBank > 0 then
|
||||
if CH_ATM && (CH_ATM.GetMoneyBankAccount(ply) >= neededAmountFromBank) then
|
||||
return true
|
||||
elseif GlorifiedBanking && (GlorifiedBanking.GetPlayerBalance(ply) >= neededAmountFromBank) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.PayWithBank(ply, amountToPay)
|
||||
if not IsValid(ply) then return end
|
||||
|
||||
if CH_ATM then
|
||||
CH_ATM.TakeMoneyFromBankAccount(ply, amountToPay)
|
||||
elseif GlorifiedBanking then
|
||||
GlorifiedBanking.RemovePlayerBalance(ply, amountToPay)
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.SetInfoVehc(ent)
|
||||
-- Set the License plate of the player on the vehicle
|
||||
if not IsValid(ent) or not ent:IsVehicle() && ent:GetClass() != "gmod_sent_vehicle_fphysics_base" then return end
|
||||
|
||||
local owner = ent:GetOwner()
|
||||
|
||||
if ent.CPPIGetOwner && not IsValid(owner) then
|
||||
owner = ent:CPPIGetOwner()
|
||||
end
|
||||
|
||||
if not IsValid(owner) then return end
|
||||
|
||||
ent:SetNWString("rpt_plate", Realistic_Police.GetPlate(owner))
|
||||
end
|
||||
|
||||
-- Reset position of all bones for surrender and cuffed
|
||||
function Realistic_Police.ResetBonePosition(Table, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
for k,v in pairs(Table) do
|
||||
if isnumber(ply:LookupBone( k )) then
|
||||
ply:ManipulateBoneAngles(ply:LookupBone( k ), Angle(0,0,0))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if the name of the fine is on the configuration
|
||||
function Realistic_Police.CheckValidFine(String)
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if v.Name == String then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
function Realistic_Police.AddCriminalRecord(ply, Table)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/record/"..ply:SteamID64()..".txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
-- Check if RealisticPoliceTab contains more criminal record than the max
|
||||
if #RealisticPoliceTab >= Realistic_Police.MaxCriminalRecord then
|
||||
table.remove(RealisticPoliceTab, 1)
|
||||
end
|
||||
|
||||
RealisticPoliceTab[#RealisticPoliceTab + 1] = Table
|
||||
file.Write("realistic_police/record/"..ply:SteamID64()..".txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
end
|
||||
|
||||
local whitelistVar = {
|
||||
["Energy"] = true,
|
||||
}
|
||||
function Realistic_Police.SaveLoadInfo(ply, bool, info)
|
||||
if bool then
|
||||
-- Save the weapon of the player
|
||||
local WeaponSave = {}
|
||||
for k, v in pairs(ply:GetWeapons()) do
|
||||
local class = v:GetClass()
|
||||
|
||||
WeaponSave[class] = {
|
||||
["Clip1"] = v:Clip1(),
|
||||
["Clip2"] = v:Clip2(),
|
||||
}
|
||||
end
|
||||
|
||||
-- Save some information of the player ( Weapon , Health & Armor )
|
||||
ply.RPTInfo = {
|
||||
RArmor = ply:Armor(),
|
||||
RWeapon = WeaponSave,
|
||||
Ammo = ply:GetAmmo(),
|
||||
RModel = info and ply:GetModel() or nil,
|
||||
RHealth = ply:Health(),
|
||||
RPos = info and ply:GetPos() or nil,
|
||||
RDarkrpVar = info and table.Copy(ply.DarkRPVars) or nil,
|
||||
}
|
||||
else
|
||||
-- SetPos the player
|
||||
if isvector(ply.RPTInfo["RPos"]) then
|
||||
ply:SetPos(ply.RPTInfo["RPos"])
|
||||
end
|
||||
|
||||
-- Give back the armor of the player
|
||||
ply:SetArmor((ply.RPTInfo["RArmor"] or 0))
|
||||
|
||||
-- Set the model of the player
|
||||
if isstring(ply.RPTInfo["RModel"]) then
|
||||
ply:SetModel(ply.RPTInfo["RModel"])
|
||||
end
|
||||
|
||||
if istable(ply.RPTInfo["RDarkrpVar"]) then
|
||||
for k,v in pairs(ply.RPTInfo["RDarkrpVar"]) do
|
||||
if not whitelistVar[k] then continue end
|
||||
|
||||
ply:setDarkRPVar(k, v)
|
||||
end
|
||||
end
|
||||
|
||||
-- Give back the health of the player
|
||||
ply:SetHealth((ply.RPTInfo["RHealth"] or 100))
|
||||
|
||||
-- Give back his weapons
|
||||
ply:StripWeapons()
|
||||
|
||||
for k,v in pairs(ply.RPTInfo["RWeapon"]) do
|
||||
local wep = ply:Give(k, true)
|
||||
|
||||
wep:SetClip1(v["Clip1"])
|
||||
wep:SetClip2(v["Clip2"])
|
||||
end
|
||||
|
||||
for k,v in pairs(ply.RPTInfo["Ammo"]) do
|
||||
ply:SetAmmo(v,k)
|
||||
end
|
||||
|
||||
ply.RPTInfo = nil
|
||||
|
||||
if ply.WeaponRPT["Surrender"] then
|
||||
ply:SelectWeapon("weapon_rpt_surrender")
|
||||
end
|
||||
|
||||
if ply.WeaponRPT["Cuff"] then
|
||||
ply:SelectWeapon("weapon_rpt_cuffed")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.Tazz(ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
if timer.Exists("rpt_stungun_unfreeze"..ply:EntIndex()) then return end
|
||||
|
||||
-- Save info of the player
|
||||
Realistic_Police.SaveLoadInfo(ply, true, true)
|
||||
|
||||
-- Create the Ragdoll Player
|
||||
ply:CreateRagdoll()
|
||||
timer.Simple(0, function()
|
||||
local entSpectate = ply:GetRagdollEntity()
|
||||
if not IsValid(entSpectate) then entSpectate = ply end
|
||||
|
||||
ply:Spectate(OBS_MODE_CHASE)
|
||||
ply:SpectateEntity(entSpectate)
|
||||
ply:StripWeapons()
|
||||
ply:StripAmmo()
|
||||
end)
|
||||
if IsValid(ply.WeaponRPT["DragedBy"]) then
|
||||
ply.WeaponRPT["DragedBy"] = nil
|
||||
end
|
||||
|
||||
-- Send the animation of the corpse
|
||||
timer.Create("rpt_stungun_send"..ply:EntIndex(), 1, 1, function()
|
||||
if IsValid(ply) then
|
||||
net.Start("RealisticPolice:StunGun")
|
||||
net.WriteEntity(ply)
|
||||
net.Broadcast()
|
||||
end
|
||||
end)
|
||||
|
||||
-- Timer when the player is not stun
|
||||
timer.Create("rpt_stungun"..ply:EntIndex(), 5, 1, function()
|
||||
if IsValid(ply) then
|
||||
|
||||
-- Unspectacte and Freeze player
|
||||
ply:UnSpectate()
|
||||
ply:Spawn()
|
||||
|
||||
if IsValid(ply:GetRagdollEntity()) then
|
||||
ply:GetRagdollEntity():Remove()
|
||||
end
|
||||
|
||||
Realistic_Police.SaveLoadInfo(ply)
|
||||
|
||||
ply:Freeze(true)
|
||||
|
||||
timer.Simple(1, function()
|
||||
ply.RPTStunTable = {}
|
||||
end)
|
||||
|
||||
timer.Create("rpt_stungun_unfreeze"..ply:EntIndex(), 7, 1, function()
|
||||
if IsValid(ply) then
|
||||
ply:Freeze(false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function Realistic_Police.Cuff(ply, officer)
|
||||
if not IsValid(ply) or not IsValid(officer) then return end
|
||||
if ply:GetPos():DistToSqr(officer:GetPos()) > 15625 then return end
|
||||
|
||||
if timer.Exists("rpt_timerarrest"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_timerarrest"..ply:EntIndex())
|
||||
end
|
||||
|
||||
-- Check if the Police Man Can Cuff the player
|
||||
if not Realistic_Police.CanCuff[Realistic_Police.GetPlayerJob(officer)] then
|
||||
Realistic_Police.SendNotify(officer, Realistic_Police.GetSentence("noGoodJobToArrestuser"))
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if the player can be cuff or not
|
||||
if Realistic_Police.CantBeCuff[Realistic_Police.GetPlayerJob(ply)] then
|
||||
Realistic_Police.SendNotify(officer, Realistic_Police.GetSentence("cantArrestPlayer"))
|
||||
return
|
||||
end
|
||||
|
||||
hook.Run("RealisticPolice:OnCuff", ply)
|
||||
|
||||
if ply.WeaponRPT["Surrender"] then
|
||||
ply:StripWeapon("weapon_rpt_surrender")
|
||||
ply.WeaponRPT["Surrender"] = false
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneSurrender, ply)
|
||||
end
|
||||
|
||||
local wep, oldWeapon = ply:GetActiveWeapon()
|
||||
if IsValid(wep) then
|
||||
oldWeapon = wep:GetClass()
|
||||
end
|
||||
|
||||
-- Cuff the Player
|
||||
ply:Give("weapon_rpt_cuffed")
|
||||
ply:SelectWeapon("weapon_rpt_cuffed")
|
||||
|
||||
ply.WeaponRPT = {
|
||||
Cuff = true,
|
||||
EnterExit = true,
|
||||
oldWeapon = oldWeapon,
|
||||
}
|
||||
|
||||
ply.WeaponRPT["processCuff"] = false
|
||||
|
||||
ply:Freeze(false)
|
||||
officer:Freeze(false)
|
||||
|
||||
hook.Run("RealisticPolice:Cuffed", ply, officer )
|
||||
end
|
||||
|
||||
function Realistic_Police.UnCuff(ply, officer)
|
||||
if not IsValid(ply) then return end
|
||||
if IsValid(officer) && ply:GetPos():DistToSqr(officer:GetPos()) > 15625 then return end
|
||||
|
||||
if ply.WeaponRPT["Cuff"] then
|
||||
|
||||
if timer.Exists("rpt_timerarrest"..ply:EntIndex()) && not Realistic_Police.UseDefaultArrest then
|
||||
timer.Remove("rpt_timerarrest"..ply:EntIndex())
|
||||
end
|
||||
|
||||
ply.WeaponRPT["Cuff"] = false
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneCuffed, ply)
|
||||
|
||||
ply:Freeze(false)
|
||||
|
||||
if IsValid(officer) then
|
||||
officer:Freeze(false)
|
||||
end
|
||||
|
||||
ply:StripWeapon("weapon_rpt_cuffed")
|
||||
|
||||
if isstring(ply.WeaponRPT["oldWeapon"]) && ply:HasWeapon(ply.WeaponRPT["oldWeapon"]) then
|
||||
ply:SelectWeapon(ply.WeaponRPT["oldWeapon"])
|
||||
|
||||
ply.WeaponRPT["oldWeapon"] = nil
|
||||
|
||||
if IsValid(ply.WeaponRPT["DragedBy"]) then
|
||||
ply.WeaponRPT["DragedBy"].WeaponRPT["Drag"] = nil
|
||||
ply.WeaponRPT["DragedBy"] = nil
|
||||
end
|
||||
end
|
||||
|
||||
hook.Run("RealisticPolice:UnCuffed", ply, officer)
|
||||
|
||||
if IsValid(officer) then
|
||||
if istable(officer.WeaponRPT) && IsValid(officer.WeaponRPT["Drag"]) then
|
||||
if officer.WeaponRPT["Drag"] == ply then
|
||||
officer.WeaponRPT["Drag"] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ply.WeaponRPT["EnterExit"] = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if there's a jail position.
|
||||
function Realistic_Police.CheckJailPos()
|
||||
local directory = file.Read("realistic_police/" .. game.GetMap() .. "_rpt_jailpos" .. ".txt", "DATA") or ""
|
||||
local RptTable = util.JSONToTable(directory) or {}
|
||||
|
||||
if #RptTable > 0 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- Find an empty jail place
|
||||
function Realistic_Police.GetPlaceArrest()
|
||||
local directory = file.Read("realistic_police/" .. game.GetMap() .. "_rpt_jailpos" .. ".txt", "DATA") or ""
|
||||
local RptTable = util.JSONToTable(directory) or {}
|
||||
|
||||
local RPTid = 1
|
||||
for k,v in pairs(ents.FindInSphere(RptTable[RPTid]["Pos"], 50)) do
|
||||
if v:IsPlayer() then
|
||||
RPTid = RPTid + 1
|
||||
end
|
||||
end
|
||||
return RptTable[RPTid]["Pos"]
|
||||
end
|
||||
|
||||
-- Arrest the player if he is cuffed
|
||||
function Realistic_Police.ArresPlayer(ply, Time, officer)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
if Realistic_Police.UseDefaultArrest then
|
||||
timer.Create("rpt_timerarrest"..ply:EntIndex(), Time, 1, function() end)
|
||||
|
||||
hook.Run("RealisticPolice:Jailed", ply, Time, officer)
|
||||
ply:SetNWInt("rpt_arrest_time", CurTime() + Time)
|
||||
|
||||
Realistic_Police.UnCuff(ply, officer)
|
||||
|
||||
ply:arrest(Time, "Arrested by the Jailer")
|
||||
else
|
||||
if timer.Exists("rpt_timerarrest"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_timerarrest"..ply:EntIndex())
|
||||
end
|
||||
|
||||
if ply.WeaponRPT["Cuff"] then
|
||||
ply:SetPos(Realistic_Police.GetPlaceArrest())
|
||||
ply.WeaponRPT["DragedBy"] = nil
|
||||
|
||||
ply:SetNWInt("rpt_arrest_time", CurTime() + Time)
|
||||
hook.Run("RealisticPolice:Jailed", ply, Time, officer)
|
||||
-- Create the Jail Timer
|
||||
timer.Create("rpt_timerarrest"..ply:EntIndex(), Time, 1, function()
|
||||
if IsValid(ply) then
|
||||
-- ply:StripWeapons()
|
||||
Realistic_Police.UnArrest(ply, officer)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
if Realistic_Police.SetModelWhenJail then
|
||||
local randomModel = Realistic_Police.ModelWhenJail[math.random(1, #Realistic_Police.ModelWhenJail)]
|
||||
|
||||
if isstring(randomModel) then
|
||||
ply:SetModel(Realistic_Police.ModelWhenJail)
|
||||
|
||||
ply.RPS = ply.RPS or {}
|
||||
ply.RPS["oldModelBeforeArrest"] = ply:GetModel()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.UnArrest(ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
-- Check if the timer Exist
|
||||
if timer.Exists("rpt_timerarrest"..ply:EntIndex()) then
|
||||
-- Reset Variables / Bone / Speed of the player
|
||||
ply:StripWeapon("weapon_rpt_cuffed")
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneCuffed, ply)
|
||||
|
||||
-- UnCuff the Player ( For give weapons )
|
||||
ply.WeaponRPT["Cuff"] = false
|
||||
|
||||
hook.Run("RealisticPolice:UnJailed", ply)
|
||||
|
||||
ply.WeaponRPT = {}
|
||||
|
||||
local spawnPoint = Realistic_Police.GetSpawnPoint(ply)
|
||||
ply:SetPos(spawnPoint)
|
||||
|
||||
-- Remove the arrest timer
|
||||
timer.Remove("rpt_timerarrest"..ply:EntIndex())
|
||||
end
|
||||
|
||||
if Realistic_Police.UseDefaultArrest then
|
||||
if DarkRP then
|
||||
ply:unArrest()
|
||||
end
|
||||
end
|
||||
|
||||
ply.RPS = ply.RPS or {}
|
||||
if isstring(ply.RPS["oldModelBeforeArrest"]) then
|
||||
ply:SetModel(ply.RPS["oldModelBeforeArrest"])
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.Drag(ply, officer)
|
||||
if not IsValid(ply) or not IsValid(officer) then return end
|
||||
if ply:GetPos():DistToSqr(officer:GetPos()) > 15625 then return end
|
||||
|
||||
if ply.WeaponRPT["Cuff"] then
|
||||
if not IsValid(ply.WeaponRPT["DragedBy"]) && not IsValid(officer.WeaponRPT["Drag"]) then
|
||||
ply.WeaponRPT["DragedBy"] = officer
|
||||
officer.WeaponRPT["Drag"] = ply
|
||||
else
|
||||
ply.WeaponRPT["DragedBy"] = nil
|
||||
officer.WeaponRPT["Drag"] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function Realistic_Police.PlaceVehicle(officer, vehc)
|
||||
local RPTPlace = nil
|
||||
local DistancePlace = 1000
|
||||
|
||||
-- Get the Place with vcmod
|
||||
if istable(vehc:VC_getSeatsAvailable()) then
|
||||
for k,v in ipairs(table.Reverse(vehc:VC_getSeatsAvailable())) do
|
||||
if v:GetPos():DistToSqr(officer:GetPos()) < DistancePlace ^ 2 then
|
||||
if IsValid(v:GetDriver()) then continue end
|
||||
RPTPlace = v
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
return RPTPlace
|
||||
end
|
||||
|
||||
function Realistic_Police.GetPoliceProps(ply)
|
||||
local Count = 0
|
||||
for k,v in pairs(ents.FindByClass("prop_physics")) do
|
||||
if v:CPPIGetOwner() == ply then
|
||||
if istable(Realistic_Police.Trunk[v:GetModel()]) then
|
||||
Count = Count + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
return Count
|
||||
end
|
||||
|
||||
function Realistic_Police.CountRepairMan()
|
||||
local Count = 0
|
||||
for k,v in pairs(player.GetAll()) do
|
||||
if Realistic_Police.CameraWorker[Realistic_Police.GetPlayerJob(v)] then
|
||||
Count = Count + 1
|
||||
end
|
||||
end
|
||||
return Count
|
||||
end
|
||||
|
||||
function Realistic_Police.BrokeCamera(ent)
|
||||
ent:ResetSequence("desactiv")
|
||||
ent:SetSequence("desactiv")
|
||||
ent:SetRptCam(true)
|
||||
ent:SetRptRotate("nil")
|
||||
ent.DestroyCam = true
|
||||
|
||||
-- Restore the health and the animation of the camera
|
||||
timer.Create("camera_respawn"..ent:EntIndex(), Realistic_Police.CameraRestart, 0, function()
|
||||
if IsValid(ent) then
|
||||
if ent:GetRptCam() then
|
||||
if Realistic_Police.CountRepairMan() == 0 then
|
||||
ent:ResetSequence("active")
|
||||
ent:SetSequence("active")
|
||||
ent:SetRptCam(false)
|
||||
ent.HealthEntity = Realistic_Police.CameraHealth
|
||||
ent.DestroyCam = false
|
||||
timer.Remove("camera_respawn"..ent:EntIndex())
|
||||
end
|
||||
else
|
||||
timer.Remove("camera_respawn"..ent:EntIndex())
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
|
||||
-- Initialize Folder ( Criminal Record / Report )
|
||||
hook.Add("InitPostEntity", "RPT:InitializeServer", function()
|
||||
if not file.Exists("realistic_police", "DATA") then
|
||||
file.CreateDir("realistic_police")
|
||||
end
|
||||
if not file.Exists("realistic_police/report", "DATA") then
|
||||
file.CreateDir("realistic_police/report")
|
||||
end
|
||||
if not file.Exists("realistic_police/record", "DATA") then
|
||||
file.CreateDir("realistic_police/record")
|
||||
end
|
||||
|
||||
-- Create a loop for broke sometime a camera
|
||||
timer.Create("rpt_loop_camera", 400, 0, function()
|
||||
|
||||
-- Check if count of camera Repairer is > 0
|
||||
if Realistic_Police.CameraBroke then
|
||||
local RandomId = math.random(1, #ents.FindByClass("realistic_police_camera"))
|
||||
if math.random(1, 2) == 1 then
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if k == RandomId && not IsValid(v:CPPIGetOwner()) then
|
||||
Realistic_Police.BrokeCamera(v)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
hook.Add("onLockpickCompleted", "RPT:onLockpickCompleted", function(Player, Success, CuffedP)
|
||||
if IsValid(CuffedP) && CuffedP:IsPlayer() then
|
||||
if istable(CuffedP.WeaponRPT) then
|
||||
if CuffedP.WeaponRPT["Cuff"] then
|
||||
if Success then
|
||||
Realistic_Police.UnCuff(CuffedP, Player)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerUse", "RPT:PlayerUse", function( ply, ent )
|
||||
if IsValid(ply) && ply:IsPlayer() then
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("canLockpick", "RPT:canLockpick", function(Player, CuffedP, Trace)
|
||||
if IsValid(CuffedP) && CuffedP:IsPlayer() then
|
||||
if istable(CuffedP.WeaponRPT) then
|
||||
if CuffedP.WeaponRPT["Cuff"] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("lockpickTime", "RPT:lockpickTime", function(Player, Entity)
|
||||
if IsValid(Entity) && Entity:IsPlayer() then
|
||||
if istable(Entity.WeaponRPT) then
|
||||
if Entity.WeaponRPT["Cuff"] then
|
||||
return 10
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canArrest", "RPT:canArrest", function(Player, ArrestedPlayer)
|
||||
if istable(ArrestedPlayer.WeaponRPT) then
|
||||
if ArrestedPlayer.WeaponRPT["Cuff"] then
|
||||
Realistic_Police.UnCuff(ArrestedPlayer, Player)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canUnarrest", "RPT:canUnarrest", function(Player, ArrestedPlayer)
|
||||
if istable(ArrestedPlayer.WeaponRPT) then
|
||||
if ArrestedPlayer.WeaponRPT["Cuff"] then
|
||||
Realistic_Police.UnCuff(ArrestedPlayer, Player)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- All hook which are desactivate when the player is Cuffed or Surrender
|
||||
|
||||
hook.Add("PlayerSpawnProp", "RPT:PlayerSpawnProp", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("CanPlayerSuicide","RPT:CanPlayerSuicide",function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerCanPickupWeapon", "RPT:PlayerCanPickupWeapon", function(ply, wep)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if wep:GetClass() != "weapon_rpt_surrender" && wep:GetClass() != "weapon_rpt_cuffed" && not ply.RPTInfo then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canGoAFK", "RPT:canGoAFK", function(ply, wep)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canSleep", "RPT:canSleep", function(ply, wep)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerDroppedWeapon", "RPT:PlayerDroppedWeapon", function(ply, wep)
|
||||
if istable(ply.RPTInfo) && ply.RPTInfo["RWeapon"] then
|
||||
ply.RPTInfo["RWeapon"][wep:GetClass()] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canDropWeapon", "RPT:canDropWeapon", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("playerCanChangeTeam", "RPT:playerCanChangeTeam", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canBuyVehicle", "RPT:canBuyVehicle", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end )
|
||||
|
||||
hook.Add("canBuyShipment", "RPT:canBuyShipment", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canBuyPistol", "RPT:canBuyPistol", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canBuyAmmo", "RPT:canBuyAmmo", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("canBuyCustomEntity", "RPT:canBuyCustomEntity", function(ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("VC_canSwitchSeat", "RPT:VC_canSwitchSeat", function(ply, ent_from, ent_to)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("CanExitVehicle", "RPT:CanExitVehicle", function(vehc, ply)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["EnterExit"] then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then
|
||||
ply:EnterVehicle(vehc)
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerSwitchWeapon", "RPT:PlayerSwitchWeapon", function(ply, oldWeapon, newWeapon)
|
||||
local class = newWeapon:GetClass()
|
||||
if class == "weapon_rpt_cuffed" or class == "weapon_rpt_surrender" then return end
|
||||
|
||||
ply.WeaponRPT = ply.WeaponRPT or {}
|
||||
if timer.Exists("rpt_animation"..ply:EntIndex()) or ply.WeaponRPT["processCuff"] then
|
||||
return true
|
||||
end
|
||||
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] or ply.WeaponRPT["processCuff"] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
--------------------------------------------------------------------------------------
|
||||
|
||||
hook.Add("PlayerInitialSpawn", "RPT:PlayerInitialSpawn", function(ply)
|
||||
timer.Simple(8, function()
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.WeaponRPT = {}
|
||||
-- Generate a plate if the player doesn't have it
|
||||
Realistic_Police.GeneratePlate(ply)
|
||||
|
||||
-- Send the Table of Custom Vehicles ( Configurate by the owner of the server with the tool )
|
||||
local RealisticPoliceFil = file.Read("realistic_police/vehicles.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
local CompressTable = util.Compress(RealisticPoliceFil)
|
||||
|
||||
net.Start("RealisticPolice:SendInformation")
|
||||
net.WriteInt(CompressTable:len(), 32)
|
||||
net.WriteData(CompressTable, CompressTable:len())
|
||||
net.Send(ply)
|
||||
end)
|
||||
end)
|
||||
|
||||
hook.Add("OnEntityCreated", "RPT:OnEntityCreated", function(ent)
|
||||
-- Set information of the plate on the vehicle
|
||||
timer.Simple(2, function()
|
||||
if IsValid(ent) then
|
||||
Realistic_Police.SetInfoVehc(ent)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Check if the Vehicle have a fine and the player can enter into the vehicle
|
||||
hook.Add("CanPlayerEnterVehicle", "RPT:PlayerEnteredVehicle", function(ply, vehc)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Surrender"] then return false end
|
||||
if istable(vehc.WeaponRPT) then
|
||||
if istable(vehc.WeaponRPT["TableFine"]) && not ply.WeaponRPT["EnterVehc"] then
|
||||
net.Start("RealisticPolice:FiningSystem")
|
||||
net.WriteTable(vehc.WeaponRPT["TableFine"])
|
||||
net.Send(ply)
|
||||
ply.WeaponRPT["Fine"] = vehc
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Avoid change seat if you are surrender or handcuffed in a svmod seat
|
||||
if SVMOD and ply:InVehicle() then
|
||||
local currentVehicle = ply:GetVehicle()
|
||||
if not IsValid(currentVehicle) then return end
|
||||
|
||||
if currentVehicle:GetNW2Bool("SV_IsSeat") and istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then return false end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Set the plate on the vehicle when the player buy the vehicle
|
||||
hook.Add("PlayerBuyVehicle", "RPT:PlayerBuyVehicle", function(ent)
|
||||
timer.Simple(2, function()
|
||||
if IsValid(ent) then
|
||||
Realistic_Police.SetInfoVehc(ent)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Add to the PVS Police Camera
|
||||
hook.Add("SetupPlayerVisibility", "RPT:SetupPlayerVisibility", function(ply)
|
||||
if ply.RPTShowEntity != nil && IsValid(ply.RPTShowEntity) then
|
||||
AddOriginToPVS(ply.RPTShowEntity:GetPos())
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add( "PlayerButtonDown", "RPT:PlayerButtonDownS", function( ply, button )
|
||||
-- Open the Tablet on the vehicle
|
||||
if button == Realistic_Police.KeyOpenTablet then
|
||||
if ply:InVehicle() then
|
||||
if IsValid(ply:GetVehicle()) then
|
||||
if Realistic_Police.PoliceVehicle[ply:GetVehicle():GetVehicleClass()] then
|
||||
if isbool(Realistic_Police.PoliceVehicle[ply:GetVehicle():GetVehicleClass()]) then
|
||||
net.Start("RealisticPolice:Open")
|
||||
net.WriteString("OpenMainMenu")
|
||||
net.WriteEntity(ply:GetVehicle())
|
||||
net.WriteBool(true)
|
||||
net.Send(ply)
|
||||
end
|
||||
end
|
||||
end
|
||||
if IsValid(ply:GetVehicle():GetParent()) then
|
||||
if Realistic_Police.PoliceVehicle[ply:GetVehicle():GetParent():GetVehicleClass()] then
|
||||
if isbool(Realistic_Police.PoliceVehicle[ply:GetVehicle():GetParent():GetVehicleClass()]) then
|
||||
net.Start("RealisticPolice:Open")
|
||||
net.WriteString("OpenMainMenu")
|
||||
net.WriteEntity(ply:GetVehicle():GetParent())
|
||||
net.WriteBool(true)
|
||||
net.Send(ply)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if Realistic_Police.SurrenderActivate then
|
||||
if istable(ply.WeaponRPT) then
|
||||
-- Check if the player is not cuffed for surrender
|
||||
if not ply.WeaponRPT["Cuff"] then
|
||||
if button == Realistic_Police.SurrenderKey then
|
||||
if ply:InVehicle() then return end
|
||||
if not ply.WeaponRPT["Surrender"] then
|
||||
hook.Run("RPT:Surrender", ply)
|
||||
|
||||
timer.Create("rpt_surrender"..ply:EntIndex(), 0.5, 1, function()
|
||||
if IsValid(ply) then
|
||||
local wep, oldWeapon = ply:GetActiveWeapon()
|
||||
if IsValid(wep) then
|
||||
oldWeapon = wep:GetClass()
|
||||
end
|
||||
|
||||
ply.WeaponRPT["oldWeapon"] = oldWeapon
|
||||
|
||||
ply:Give("weapon_rpt_surrender")
|
||||
ply:SelectWeapon("weapon_rpt_surrender")
|
||||
|
||||
ply.WeaponRPT["Surrender"] = true
|
||||
end
|
||||
end)
|
||||
else
|
||||
ply:StripWeapon("weapon_rpt_surrender")
|
||||
ply.WeaponRPT["Surrender"] = false
|
||||
|
||||
if isstring(ply.WeaponRPT["oldWeapon"]) && ply:HasWeapon(ply.WeaponRPT["oldWeapon"]) then
|
||||
ply:SelectWeapon(ply.WeaponRPT["oldWeapon"])
|
||||
|
||||
ply.WeaponRPT["oldWeapon"] = nil
|
||||
end
|
||||
|
||||
-- Give back his weapons
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneSurrender, ply)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add( "PlayerButtonUp", "RPT:PlayerButtonUpS", function( ply, button )
|
||||
if istable(ply.WeaponRPT) then
|
||||
if not ply.WeaponRPT["Cuff"] then
|
||||
if button == Realistic_Police.SurrenderKey then
|
||||
-- If timer of surrending exist then remove when the player up the button
|
||||
if timer.Exists("rpt_surrender"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_surrender"..ply:EntIndex())
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
local CMoveData = FindMetaTable("CMoveData")
|
||||
function CMoveData:RemoveKeys(ADLKey)
|
||||
local ADLButtons = bit.band(self:GetButtons(), bit.bnot(ADLKey))
|
||||
self:SetButtons(ADLButtons)
|
||||
end
|
||||
|
||||
hook.Add("SetupMove", "RPT:Move", function(ply, data)
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] or ply.WeaponRPT["Surrender"] then
|
||||
data:SetMaxClientSpeed( 80 )
|
||||
if data:KeyDown(IN_JUMP) then
|
||||
data:RemoveKeys(IN_JUMP)
|
||||
end
|
||||
end
|
||||
-- this hook is the hook for drag the player
|
||||
if IsValid(ply.WeaponRPT["DragedBy"]) then
|
||||
if ply:GetPos():DistToSqr(ply.WeaponRPT["DragedBy"]:GetPos()) < 40000 then
|
||||
if IsValid(ply.WeaponRPT["DragedBy"]) then
|
||||
local VectorDrag = ply.WeaponRPT["DragedBy"]:GetPos() - ply:GetPos()
|
||||
data:SetVelocity(Vector(VectorDrag.x*4, VectorDrag.y*4, -100))
|
||||
end
|
||||
else
|
||||
ply.WeaponRPT["DragedBy"] = nil
|
||||
end
|
||||
end
|
||||
else
|
||||
ply.WeaponRPT = {}
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("playerBoughtCustomEntity", "RPT:BoughtEntity", function(ply, enttbl, ent, price)
|
||||
-- Set the owner of the Camera and the Screen
|
||||
if ent:GetClass() == "realistic_police_camera" or ent:GetClass() == "realistic_police_screen" then
|
||||
ent:CPPISetOwner(ply)
|
||||
end
|
||||
end )
|
||||
|
||||
-- Give ammo
|
||||
hook.Add("WeaponEquip", "RPT:WeaponEquip", function(weapon, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
if weapon:GetClass() == "weapon_rpt_stungun" then
|
||||
ply:GiveAmmo((Realistic_Police.StungunAmmo or 40), "Pistol", false)
|
||||
end
|
||||
end)
|
||||
-- d4ec95c252515613de193db925956fba07d4ff50f580a4b42b7f507f9c716945
|
||||
|
||||
-- When the Police Man disconnect unfreez the player
|
||||
hook.Add("PlayerDisconnected", "RPT:PlayerDisconnected", function(ply)
|
||||
if IsValid(ply) then
|
||||
if istable(ply.WeaponRPT) then
|
||||
if IsValid(ply.WeaponRPT["Fine"]) && ply.WeaponRPT["Fine"]:IsPlayer() then
|
||||
ply.WeaponRPT["Fine"]:Freeze(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("PlayerDeath", "RPT:PlayerDeath", function(ply)
|
||||
|
||||
if timer.Exists("rpt_stungun"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_stungun"..ply:EntIndex())
|
||||
end
|
||||
|
||||
if not Realistic_Police.UseDefaultArrest then
|
||||
if timer.Exists("rpt_timerarrest"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_timerarrest"..ply:EntIndex())
|
||||
end
|
||||
else
|
||||
Realistic_Police.UnCuff(ply)
|
||||
end
|
||||
|
||||
ply.WeaponRPT = {}
|
||||
-- Reset Bone position
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneCuffed, ply)
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneSurrender, ply)
|
||||
|
||||
for k,v in pairs(ents.GetAll()) do
|
||||
if v:GetClass() == "realistic_police_camera" or v:GetClass() == "realistic_police_screen" then
|
||||
if v:CPPIGetOwner() == ply then
|
||||
v:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add("OnPlayerChangeTeam", "RPT:OnPlayerChangeTeam", function(ply)
|
||||
|
||||
if timer.Exists("rpt_stungun"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_stungun"..ply:EntIndex())
|
||||
end
|
||||
|
||||
ply.WeaponRPT = {}
|
||||
-- Reset Bone position
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneCuffed, ply)
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneSurrender, ply)
|
||||
|
||||
for k,v in pairs(ents.GetAll()) do
|
||||
if v:GetClass() == "realistic_police_camera" or v:GetClass() == "realistic_police_screen" then
|
||||
if v:CPPIGetOwner() == ply then
|
||||
v:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -0,0 +1,768 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
|
||||
util.AddNetworkString("RealisticPolice:Open")
|
||||
util.AddNetworkString("RealisticPolice:Report")
|
||||
util.AddNetworkString("RealisticPolice:CriminalRecord")
|
||||
util.AddNetworkString("RealisticPolice:SecurityCamera")
|
||||
util.AddNetworkString("RealisticPolice:NameCamera")
|
||||
util.AddNetworkString("RealisticPolice:FiningSystem")
|
||||
util.AddNetworkString("RealisticPolice:HandCuff")
|
||||
util.AddNetworkString("RealisticPolice:StunGun")
|
||||
util.AddNetworkString("RealisticPolice:SetupVehicle")
|
||||
util.AddNetworkString("RealisticPolice:SendInformation")
|
||||
util.AddNetworkString("RealisticPolice:UpdateInformation")
|
||||
util.AddNetworkString("RealisticPolice:PlaceProp")
|
||||
util.AddNetworkString("RealisticPolice:SetWantedStatus")
|
||||
|
||||
-- Check if the player is near a computer / jailer or a police vehicle
|
||||
local function CheckEnts(Player)
|
||||
for k,v in pairs(ents.FindInSphere(Player:GetPos(), 600)) do
|
||||
if IsValid(v) then
|
||||
if v:GetClass() == "realistic_police_computer" or v:GetClass() == "realistic_police_computer_sbu" or v:GetClass() == "realistic_police_jailer" then
|
||||
return true
|
||||
end
|
||||
end
|
||||
if IsValid(v) && v:IsVehicle() then
|
||||
if Realistic_Police.PoliceVehicle[v:GetVehicleClass()] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
if IsValid(v:GetParent()) && v:GetParent():IsVehicle() then
|
||||
if Realistic_Police.PoliceVehicle[v:GetParent():GetVehicleClass()] then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Net For the setup a license plate on a vehicle
|
||||
net.Receive("RealisticPolice:SetupVehicle", function(len,ply)
|
||||
|
||||
-- Check if the Player is valid and have the correct rank for setup the vehicle
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
if not Realistic_Police.AdminRank[ply:GetUserGroup()] then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 0.1
|
||||
|
||||
-- This table contains the position , size , rotation of the plate
|
||||
local Table = net.ReadTable() or {}
|
||||
if not istable(Table) then return end
|
||||
|
||||
-- This entity is the vehicle to configure
|
||||
local EntityDelete = net.ReadEntity()
|
||||
if not IsValid(EntityDelete) then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/vehicles.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
-- Remove before position of the vehicle in the data
|
||||
RealisticPoliceTab[EntityDelete:GetModel()] = nil
|
||||
table.Merge(RealisticPoliceTab, Table)
|
||||
|
||||
file.Write("realistic_police/vehicles.txt", util.TableToJSON(RealisticPoliceTab))
|
||||
|
||||
-- Here we send the table to the client for have the license plate information
|
||||
timer.Simple(0.1, function()
|
||||
|
||||
-- Compress the table for send information
|
||||
local RealisticPoliceFil = file.Read("realistic_police/vehicles.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
local CompressTable = util.Compress(RealisticPoliceFil)
|
||||
net.Start("RealisticPolice:SendInformation")
|
||||
net.WriteInt(CompressTable:len(), 32)
|
||||
net.WriteData(CompressTable, CompressTable:len() )
|
||||
net.Broadcast()
|
||||
|
||||
-- Delete the vehicle preview
|
||||
if IsValid(EntityDelete) then
|
||||
EntityDelete:Remove()
|
||||
end
|
||||
end )
|
||||
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:Report", function(len, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 0.1
|
||||
|
||||
-- RPTInt = Int for delete / Edit
|
||||
local RPTInt = net.ReadUInt(10)
|
||||
|
||||
-- RPTString = Information of the action
|
||||
local RPTString = net.ReadString()
|
||||
if string.len(RPTString) > 30 then return end
|
||||
|
||||
-- RPTSteamID64 = Steamid64 of the player
|
||||
local RPTEntity = net.ReadEntity()
|
||||
|
||||
-- RPTText = Text of the Report
|
||||
local RPTText = net.ReadString()
|
||||
if string.len(RPTText) > 1184 then return end
|
||||
|
||||
local RPTSteamID64 = ""
|
||||
|
||||
-- Check if it's a unknow report or a player report
|
||||
local RPTName = ""
|
||||
if IsValid(RPTEntity) && RPTEntity:IsPlayer() then
|
||||
RPTSteamID64 = RPTEntity:SteamID64()
|
||||
RPTName = RPTEntity:Name()
|
||||
else
|
||||
RPTSteamID64 = "unknown"
|
||||
RPTName = Realistic_Police.GetSentence("unknown")
|
||||
end
|
||||
local RealisticPoliceFil = file.Read("realistic_police/report/"..RPTSteamID64..".txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
-- Create the table of the report for save it after
|
||||
local TableReport = {
|
||||
RPTText = RPTText,
|
||||
RPTDate = os.date("%d/%m/%Y", os.time()),
|
||||
RPTPolice = ply:Name(),
|
||||
RPTCriminal = RPTName,
|
||||
RPTSteamID64 = RPTSteamID64,
|
||||
}
|
||||
|
||||
-- Check if the player is near a Computer or a vehicle for add the report
|
||||
if not CheckEnts(ply) then return end
|
||||
|
||||
-- Save the report into the data
|
||||
if RPTString == "SaveReport" then
|
||||
|
||||
-- Check if the player have the job for add a report
|
||||
if Realistic_Police.JobEditReport[Realistic_Police.GetPlayerJob(ply)] then
|
||||
|
||||
-- Check if the Player is not the PoliceMan
|
||||
if ply == RPTEntity then return end
|
||||
|
||||
-- Check if RealisticPoliceTab contains more report than the max report
|
||||
if #RealisticPoliceTab >= Realistic_Police.MaxReport then
|
||||
table.remove(RealisticPoliceTab, 1)
|
||||
end
|
||||
|
||||
-- If the RPTSteamID64 is unknow then I set the model to ""
|
||||
if RPTSteamID64 != "unknown" then
|
||||
TableReport["Model"] = RPTEntity:GetModel()
|
||||
else
|
||||
TableReport["Model"] = ""
|
||||
end
|
||||
|
||||
RealisticPoliceTab[#RealisticPoliceTab + 1] = TableReport
|
||||
file.Write("realistic_police/report/"..RPTSteamID64..".txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
|
||||
-- Send The table of the player to the client
|
||||
Realistic_Police.SendReport(RPTSteamID64, ply)
|
||||
end
|
||||
|
||||
elseif RPTString == "SendInformation" then
|
||||
|
||||
Realistic_Police.SendReport(RPTSteamID64, ply)
|
||||
|
||||
elseif RPTString == "EditReport" then
|
||||
|
||||
-- Check if the player can edit the report
|
||||
if Realistic_Police.JobEditReport[Realistic_Police.GetPlayerJob(ply)] then
|
||||
|
||||
-- Check if the Player is not the PoliceMan
|
||||
if ply == RPTEntity then return end
|
||||
|
||||
RealisticPoliceTab[RPTInt]["RPTText"] = TableReport["RPTText"]
|
||||
file.Write("realistic_police/report/"..RPTSteamID64..".txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
Realistic_Police.SendReport(RPTSteamID64, ply)
|
||||
end
|
||||
|
||||
elseif RPTString == "RemoveReport" then
|
||||
|
||||
-- Check if the player can remove the report
|
||||
if Realistic_Police.JobDeleteReport[Realistic_Police.GetPlayerJob(ply)] then
|
||||
|
||||
-- Check if the Player is not the PoliceMan
|
||||
if ply == RPTEntity then return end
|
||||
|
||||
table.remove(RealisticPoliceTab, RPTInt)
|
||||
file.Write("realistic_police/report/"..RPTSteamID64..".txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
|
||||
Realistic_Police.SendReport(RPTSteamID64, ply)
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("RealisticPolice:CriminalRecord", function(len, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 0.1
|
||||
|
||||
-- RPTInt = Int for delete a criminal record
|
||||
local RPTInt = net.ReadUInt(10)
|
||||
|
||||
-- RPTString = Information of the action
|
||||
local RPTString = net.ReadString()
|
||||
if string.len(RPTString) > 50 then return end
|
||||
|
||||
local RPTEntity = net.ReadEntity()
|
||||
if not IsValid(RPTEntity) then return end
|
||||
|
||||
-- RPTText = Text of the criminal record
|
||||
local RPTText = net.ReadString()
|
||||
if string.len(RPTText) > 1050 then return end
|
||||
|
||||
-- Create the table of the criminal record for save it after
|
||||
local Table = {
|
||||
Date = os.date("%d/%m/%Y", os.time()),
|
||||
Motif = RPTText,
|
||||
}
|
||||
-- Check if the Policeman is near a Jail , A computer or a Vehicle for add a criminal record
|
||||
if not IsValid(RPTEntity) or not CheckEnts(ply) then return end
|
||||
|
||||
local RealisticPoliceFil = file.Read("realistic_police/record/"..RPTEntity:SteamID64()..".txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
if RPTString == "AddRecord" then
|
||||
|
||||
if Realistic_Police.JobEditRecord[Realistic_Police.GetPlayerJob(ply)] then
|
||||
|
||||
-- Check if the Player is not the PoliceMan
|
||||
if ply == RPTEntity then return end
|
||||
|
||||
-- Add a criminal Record
|
||||
Realistic_Police.AddCriminalRecord(RPTEntity, Table)
|
||||
|
||||
-- Send The table of the player to the client
|
||||
Realistic_Police.SendRecord(RPTEntity:SteamID64(), ply)
|
||||
end
|
||||
|
||||
elseif RPTString == "SendRecord" then
|
||||
|
||||
Realistic_Police.SendRecord(RPTEntity:SteamID64(), ply)
|
||||
|
||||
elseif RPTString == "RemoveRecord" then
|
||||
|
||||
if Realistic_Police.JobDeleteRecord[Realistic_Police.GetPlayerJob(ply)] then
|
||||
|
||||
-- Check if the Player is not the PoliceMan
|
||||
if ply == RPTEntity then return end
|
||||
|
||||
RealisticPoliceTab[RPTInt] = nil
|
||||
file.Write("realistic_police/record/"..RPTEntity:SteamID64()..".txt", util.TableToJSON(RealisticPoliceTab, true))
|
||||
|
||||
Realistic_Police.SendRecord(RPTEntity:SteamID64(), ply)
|
||||
end
|
||||
|
||||
end
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:SecurityCamera", function(len, ply) -- Send Police Camera
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 0.1
|
||||
|
||||
-- RPTString = Information of the action
|
||||
local RPTString = net.ReadString()
|
||||
if string.len(RPTString) > 60 then return end
|
||||
|
||||
-- RPTEnt = This entity is the camera which the player want to rotate
|
||||
local RPTEnt = net.ReadEntity()
|
||||
|
||||
-- RPTStringRotate = Rotate on the left or on the Right
|
||||
local RPTStringRotate = net.ReadString()
|
||||
if string.len(RPTStringRotate) > 30 then return end
|
||||
|
||||
-- Check if the player is near a Computer or a vehicle
|
||||
if not CheckEnts(ply) then return end
|
||||
|
||||
if RPTString == "RotateCamera" then
|
||||
|
||||
if not isentity(RPTEnt) or RPTEnt:GetClass() != "realistic_police_camera" then return end
|
||||
RPTEnt:SetRptRotate(RPTStringRotate)
|
||||
|
||||
elseif RPTString == "ShowCamera" then
|
||||
|
||||
ply.RPTShowEntity = RPTEnt
|
||||
|
||||
elseif RPTString == "DontShowCamera" then
|
||||
|
||||
ply.RPTShowEntity = nil
|
||||
|
||||
elseif RPTString != "RotateCamera" && RPTString != "ShowCamera" then
|
||||
|
||||
-- Send all administrator camera to the client for the police
|
||||
local TableToSend = {}
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
if v.RPTCam then
|
||||
table.insert(TableToSend, v)
|
||||
end
|
||||
end
|
||||
|
||||
-- Send the table to the client
|
||||
net.Start("RealisticPolice:SecurityCamera")
|
||||
net.WriteTable(TableToSend)
|
||||
net.Send(ply)
|
||||
end
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:FiningSystem", function(len,ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 1
|
||||
|
||||
-- RPTString = Information of the action
|
||||
local RPTString = net.ReadString()
|
||||
|
||||
-- RPTStringTbl = All infraction send on this string
|
||||
local RPTStringTbl = net.ReadString()
|
||||
if #RPTStringTbl > 1000 then return end
|
||||
|
||||
-- Convert the string to a table for use it
|
||||
local FineTable = string.Explode("§", RPTStringTbl)
|
||||
table.remove(FineTable, 1)
|
||||
|
||||
local rptEnt = nil
|
||||
if IsValid(ply.WeaponRPT["Fine"]) then
|
||||
rptEnt = ply.WeaponRPT["Fine"]
|
||||
end
|
||||
if IsValid(rptEnt) then if not istable(rptEnt.WeaponRPT) then rptEnt.WeaponRPT = {} end end
|
||||
|
||||
if RPTString == "SendFine" then
|
||||
|
||||
-- Check if the Player have the correct job for add a fine
|
||||
if Realistic_Police.JobCanAddFine[Realistic_Police.GetPlayerJob(ply)] then
|
||||
if IsValid(rptEnt) then
|
||||
|
||||
-- Check if the Player or the Vehicle is near the PoliceMan
|
||||
if rptEnt:GetPos():DistToSqr(ply:GetPos()) > 40000 then return end
|
||||
if #FineTable > Realistic_Police.MaxPenalty or #FineTable == 0 then return end
|
||||
|
||||
-- Check if the Ent is a vehicle and check if the vehicle is owned by the Policeman
|
||||
if rptEnt:IsVehicle() then
|
||||
if rptEnt:CPPIGetOwner() == ply then Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("cantAddFineToHimVehicle")) return end
|
||||
end
|
||||
|
||||
-- Check if the player have already a fine or not
|
||||
if rptEnt:IsPlayer() then
|
||||
if isnumber(rptEnt.WeaponRPT["AmountFine"]) then
|
||||
rptEnt:Freeze(false)
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("personAlreadyHaveFine"))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if the vehicle have already a fine or not
|
||||
if istable(rptEnt.WeaponRPT["TableFine"]) then
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("vehicleHaveFine"))
|
||||
return
|
||||
end
|
||||
|
||||
-- Calculate the amount of the fine
|
||||
local Amount = 0
|
||||
for k,v in pairs(Realistic_Police.FiningPolice) do
|
||||
if table.HasValue(FineTable, v.Name) then
|
||||
Amount = Amount + v.Price
|
||||
end
|
||||
end
|
||||
|
||||
if rptEnt:IsPlayer() then
|
||||
|
||||
-- Check if the Player Can have a fine or not
|
||||
if not Realistic_Police.JobCantHaveFine[Realistic_Police.GetPlayerJob(rptEnt)] then
|
||||
rptEnt.WeaponRPT["AmountFine"] = Amount
|
||||
rptEnt.WeaponRPT["PlayerFiner"] = ply
|
||||
net.Start("RealisticPolice:FiningSystem")
|
||||
net.WriteTable(FineTable)
|
||||
net.Send(rptEnt)
|
||||
|
||||
hook.Run("RealisticPolice:FinePlayer", ply, rptEnt )
|
||||
else
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("userCantReceiveFine"))
|
||||
end
|
||||
rptEnt:Freeze(false)
|
||||
|
||||
elseif rptEnt:IsVehicle() then
|
||||
|
||||
-- Check if the vehicle can have a fine or not
|
||||
if not Realistic_Police.VehicleCantHaveFine[rptEnt:GetClass()] then
|
||||
rptEnt.WeaponRPT["AmountFine"] = Amount
|
||||
rptEnt.WeaponRPT["TableFine"] = FineTable
|
||||
rptEnt.WeaponRPT["PlayerFiner"] = ply
|
||||
|
||||
hook.Run("RealisticPolice:FineVehicle", ply, rptEnt )
|
||||
else
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("vehicleCantReceiveFine"))
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
-- Play the sound/animation of the weapon
|
||||
ply:GetActiveWeapon():EmitSound("rptfiningsound.mp3")
|
||||
ply:GetActiveWeapon():SendWeaponAnim( ACT_VM_PRIMARYATTACK )
|
||||
ply:GetActiveWeapon():SetNextPrimaryFire( CurTime() + ply:GetActiveWeapon():SequenceDuration() )
|
||||
|
||||
timer.Create("rpt_animation"..ply:EntIndex(), ply:GetActiveWeapon():SequenceDuration(), 1, function()
|
||||
if IsValid(ply) && ply:IsPlayer() then
|
||||
ply:GetActiveWeapon():SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
end)
|
||||
|
||||
ply.WeaponRPT["Fine"] = nil
|
||||
else
|
||||
-- Send the notification if the person can't add a fine
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("noGoodJob"))
|
||||
end
|
||||
|
||||
elseif RPTString == "BuyFine" then
|
||||
|
||||
if ply:IsPlayer() && not IsValid(rptEnt) then
|
||||
|
||||
-- Check if is valid amount for the fine
|
||||
local amount = ply.WeaponRPT["AmountFine"]
|
||||
if isnumber(amount) then
|
||||
local playerMoney = ply:getDarkRPVar("money")
|
||||
|
||||
-- Check if the Player can buy the fine
|
||||
local buyedFine = false
|
||||
|
||||
if ply:canAfford(amount) then
|
||||
ply:addMoney(-amount)
|
||||
|
||||
buyedFine = true
|
||||
elseif Realistic_Police.CompatibilitiesATM(ply, playerMoney, amount) then
|
||||
ply:addMoney(-playerMoney)
|
||||
Realistic_Police.PayWithBank(ply, amount)
|
||||
|
||||
buyedFine = true
|
||||
else
|
||||
if Realistic_Police.PlayerWanted then
|
||||
ply:wanted(nil, Realistic_Police.GetSentence("noPayFine"), 120)
|
||||
end
|
||||
end
|
||||
|
||||
if buyedFine == true then
|
||||
-- Send Money & Notification to the Police Man and the person who receive the fine
|
||||
if IsValid(ply.WeaponRPT["PlayerFiner"]) && ply.WeaponRPT["PlayerFiner"]:IsPlayer() then
|
||||
ply.WeaponRPT["PlayerFiner"]:addMoney((amount*Realistic_Police.PourcentPay)/100)
|
||||
Realistic_Police.SendNotify(ply.WeaponRPT["PlayerFiner"], Realistic_Police.GetSentence("youWon").." "..DarkRP.formatMoney((amount*Realistic_Police.PourcentPay)/100))
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("justPaid").." "..DarkRP.formatMoney(amount))
|
||||
end
|
||||
end
|
||||
|
||||
-- Reset Variables of the player
|
||||
ply.WeaponRPT["TableFine"] = nil
|
||||
ply.WeaponRPT["PlayerFiner"] = nil
|
||||
ply.WeaponRPT["AmountFine"] = nil
|
||||
|
||||
ply:Freeze(false)
|
||||
end
|
||||
|
||||
elseif rptEnt:IsVehicle() then
|
||||
|
||||
-- Check if is valid amount for the fine
|
||||
local amount = rptEnt.WeaponRPT["AmountFine"]
|
||||
if isnumber(amount) then
|
||||
local buyedFine = false
|
||||
|
||||
if ply:canAfford(amount) then
|
||||
ply:addMoney(-amount)
|
||||
|
||||
buyedFine = true
|
||||
elseif Realistic_Police.CompatibilitiesATM(ply, playerMoney, amount) then
|
||||
ply:addMoney(-playerMoney)
|
||||
Realistic_Police.PayWithBank(ply, amount)
|
||||
|
||||
buyedFine = true
|
||||
end
|
||||
|
||||
if buyedFine == true then
|
||||
-- Send Money & Notification to the Police Man and the person who receive the fine
|
||||
if IsValid(rptEnt.WeaponRPT["PlayerFiner"]) && rptEnt.WeaponRPT["PlayerFiner"]:IsPlayer() then
|
||||
rptEnt.WeaponRPT["PlayerFiner"]:addMoney((rptEnt.WeaponRPT["AmountFine"]*Realistic_Police.PourcentPay)/100)
|
||||
Realistic_Police.SendNotify(rptEnt.WeaponRPT["PlayerFiner"], Realistic_Police.GetSentence("youWon").." "..DarkRP.formatMoney((rptEnt.WeaponRPT["AmountFine"]*Realistic_Police.PourcentPay)/100))
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("justPaid").." "..DarkRP.formatMoney(rptEnt.WeaponRPT["AmountFine"]))
|
||||
end
|
||||
|
||||
rptEnt.WeaponRPT["TableFine"] = nil
|
||||
rptEnt.WeaponRPT["PlayerFiner"] = nil
|
||||
rptEnt.WeaponRPT["AmountFine"] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
elseif RPTString == "RefuseFine" then
|
||||
|
||||
if isnumber(ply.WeaponRPT["AmountFine"]) then
|
||||
ply:Freeze(false)
|
||||
if Realistic_Police.PlayerWanted then
|
||||
-- Check if the Fine is on a vehicle or a Player ( If the fine is on a vehicle and the player don't pay the fine he's not gonna be wanted )
|
||||
if not istable(ply.WeaponRPT["TableFine"]) then
|
||||
if IsValid(ply.WeaponRPT["PlayerFiner"]) then
|
||||
ply:wanted(ply.WeaponRPT["PlayerFiner"], Realistic_Police.GetSentence("noPayFine"), 120)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Reset Amount and unfreeze the player also add a wanted
|
||||
ply.WeaponRPT["PlayerFiner"] = nil
|
||||
ply.WeaponRPT["AmountFine"] = nil
|
||||
ply.WeaponRPT["Fine"] = nil
|
||||
end
|
||||
|
||||
elseif RPTString == "StopFine" then
|
||||
|
||||
-- Stop the fine && reset variables
|
||||
if not Realistic_Police.JobCanAddFine[Realistic_Police.GetPlayerJob(ply)] then return end
|
||||
|
||||
if IsValid(rptEnt) && rptEnt:IsPlayer() then
|
||||
rptEnt:Freeze(false)
|
||||
|
||||
-- Reset Amount and unfreeze the player also add a wanted
|
||||
ply.WeaponRPT["PlayerFiner"] = nil
|
||||
ply.WeaponRPT["AmountFine"] = nil
|
||||
ply.WeaponRPT["Fine"] = nil
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:HandCuff", function(len, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 0.1
|
||||
|
||||
-- RPTString = Information of the action
|
||||
local RPTString = net.ReadString()
|
||||
|
||||
if RPTString == "ArrestPlayer" then
|
||||
|
||||
-- RPTInt = Jail Time
|
||||
local RPTInt = net.ReadUInt(10)
|
||||
if RPTInt > Realistic_Police.MaxDay then return end
|
||||
|
||||
-- RPTText = Why the player is arrested
|
||||
local RPTText = net.ReadString()
|
||||
if string.len(RPTText) > 1050 then return end
|
||||
|
||||
if not Realistic_Police.CanCuff[Realistic_Police.GetPlayerJob(ply)] then return end
|
||||
|
||||
-- Check if the Police Man drag a player and if the player is cuffed
|
||||
if IsValid(ply.WeaponRPT["Drag"]) && ply.WeaponRPT["Drag"].WeaponRPT["Cuff"] then
|
||||
|
||||
-- Check if RPTTableBailer is not a table
|
||||
if not istable(RPTTableBailer) then
|
||||
RPTTableBailer = {}
|
||||
end
|
||||
|
||||
-- Arrest the Player
|
||||
Realistic_Police.SendNotify(ply.WeaponRPT["Drag"], Realistic_Police.GetSentence("youArrestBy").." "..ply:Name())
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("youHaveArrest").." "..ply.WeaponRPT["Drag"]:Name())
|
||||
|
||||
-- Create The table to add on the Criminal Record
|
||||
local Table = {
|
||||
Date = os.date("%d/%m/%Y", os.time()),
|
||||
Motif = RPTText,
|
||||
}
|
||||
|
||||
-- Add autaumatically a penalty on the criminal record
|
||||
Realistic_Police.AddCriminalRecord(ply.WeaponRPT["Drag"], Table)
|
||||
|
||||
-- Insert into the bailer table the player
|
||||
table.insert(RPTTableBailer, {
|
||||
vEnt = ply.WeaponRPT["Drag"],
|
||||
vName = ply.WeaponRPT["Drag"]:Name(),
|
||||
vMotif = RPTText,
|
||||
vPrice = RPTInt*Realistic_Police.PriceDay,
|
||||
vModel = ply.WeaponRPT["Drag"]:GetModel(),
|
||||
})
|
||||
|
||||
Realistic_Police.ArresPlayer(ply.WeaponRPT["Drag"], RPTInt*Realistic_Police.DayEqual, ply)
|
||||
ply.WeaponRPT["Drag"] = nil
|
||||
end
|
||||
|
||||
elseif RPTString == "Bailer" then
|
||||
|
||||
local PlayerArrested = net.ReadEntity()
|
||||
|
||||
-- RPTInt = Int of the bailer menu
|
||||
local RPTInt = net.ReadUInt(10)
|
||||
|
||||
-- Check if the player is valid
|
||||
if IsValid(PlayerArrested) then
|
||||
|
||||
-- Check if the Player can buy
|
||||
if istable(RPTTableBailer[RPTInt]) && ply:canAfford(RPTTableBailer[RPTInt]["vPrice"]) then
|
||||
|
||||
-- Remove the timer arrest and prisoner's release
|
||||
if timer.Exists("rpt_timerarrest"..PlayerArrested:EntIndex()) then
|
||||
ply:addMoney(-RPTTableBailer[RPTInt]["vPrice"])
|
||||
|
||||
Realistic_Police.UnArrest(PlayerArrested)
|
||||
Realistic_Police.SendNotify(PlayerArrested, Realistic_Police.GetSentence("youUnarrestBy").." "..ply:Name())
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("justPaid").." "..DarkRP.formatMoney(RPTTableBailer[RPTInt]["vPrice"]))
|
||||
|
||||
local weapon = PlayerArrested:GetWeapon("weapon_rpt_cuffed")
|
||||
if IsValid(weapon) then
|
||||
PlayerArrested:StripWeapon("weapon_rpt_cuffed")
|
||||
end
|
||||
|
||||
PlayerArrested:SetNWInt("rpt_arrest_time", 0)
|
||||
timer.Remove("rpt_timerarrest"..PlayerArrested:EntIndex())
|
||||
|
||||
RPTTableBailer[RPTInt] = nil
|
||||
end
|
||||
|
||||
else
|
||||
-- Send a notification if the player don't have enought money
|
||||
Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("cantAfford"))
|
||||
end
|
||||
end
|
||||
|
||||
elseif RPTString == "StripWeapon" then
|
||||
if not Realistic_Police.CanConfiscateWeapon then return end
|
||||
|
||||
local PlayerArrested = net.ReadEntity()
|
||||
local class = net.ReadString()
|
||||
|
||||
if IsValid(PlayerArrested) && PlayerArrested:IsPlayer() then
|
||||
if not Realistic_Police.CanCuff[Realistic_Police.GetPlayerJob(ply)] then return end
|
||||
|
||||
-- Check if the player is near the Police Man
|
||||
if PlayerArrested:GetPos():DistToSqr(ply:GetPos()) < 40000 && PlayerArrested.WeaponRPT["Cuff"] then
|
||||
PlayerArrested:StripWeapon(class)
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:PlaceProp", function(len, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 0.1
|
||||
|
||||
-- RPTString = String of the props into the table of the trunk
|
||||
local RPTString = net.ReadString()
|
||||
|
||||
-- Check if the Player can Open the trunk
|
||||
if not Realistic_Police.CanOpenTrunk[Realistic_Police.GetPlayerJob(ply)] then return end
|
||||
|
||||
-- Check if the props is on the table of the trunk
|
||||
if not istable(Realistic_Police.Trunk[RPTString]) then return end
|
||||
|
||||
if Realistic_Police.GetPoliceProps(ply) > Realistic_Police.MaxPropsTrunk then Realistic_Police.SendNotify(ply, Realistic_Police.GetSentence("tooMuchEntities")) return end
|
||||
|
||||
-- Create The props
|
||||
local RPTProps = ents.Create( "prop_physics" )
|
||||
RPTProps:SetModel( RPTString )
|
||||
RPTProps:SetPos( ply:GetEyeTrace().HitPos + Realistic_Police.Trunk[RPTString]["GhostPos"] )
|
||||
RPTProps:SetAngles(Angle(0,ply:GetAngles().y + 90,0))
|
||||
RPTProps:CPPISetOwner(ply)
|
||||
RPTProps:Spawn()
|
||||
-- Add the props to the undo list
|
||||
undo.Create("prop")
|
||||
undo.AddEntity(RPTProps)
|
||||
undo.SetPlayer(ply)
|
||||
undo.Finish()
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:Open", function(len,ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
|
||||
ply.RPTAntiSpam = ply.RPTAntiSpam or CurTime()
|
||||
if ply.RPTAntiSpam > CurTime() then return end
|
||||
ply.RPTAntiSpam = CurTime() + 1
|
||||
|
||||
local EntityC = net.ReadEntity()
|
||||
if EntityC:GetClass() != "realistic_police_computer" && EntityC:GetClass() != "realistic_police_computer_sbu" && ply:GetPos():DistToSqr(EntityC:GetPos()) > 10000 then return end
|
||||
|
||||
-- check if the player is near a computer or a vehicle
|
||||
if not CheckEnts(ply) then return end
|
||||
|
||||
-- Set the Boolen on the vehicle / the computer for the hack
|
||||
if IsValid(EntityC) && (EntityC:GetClass() == "realistic_police_computer" or EntityC:GetClass() == "realistic_police_computer_sbu") or EntityC:IsVehicle() then
|
||||
EntityC:SetNWBool("rpt_hack", true)
|
||||
timer.Create("rpt_resolve"..EntityC:EntIndex(), Realistic_Police.ResolveHack, 1, function()
|
||||
if IsValid(EntityC) then
|
||||
EntityC:SetNWBool("rpt_hack", false)
|
||||
end
|
||||
end )
|
||||
end
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:NameCamera", function(len, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
if not Realistic_Police.AdminRank[ply:GetUserGroup()] then return end
|
||||
|
||||
local RPTEntity = net.ReadEntity()
|
||||
if not IsValid(RPTEntity) then return end
|
||||
|
||||
local String = net.ReadString() or ""
|
||||
RPTEntity:SetNWString("rpt_name_camera", String)
|
||||
end )
|
||||
|
||||
net.Receive("RealisticPolice:SetWantedStatus", function(len, ply)
|
||||
if not IsValid(ply) or not ply:IsPlayer() then return end
|
||||
if not Realistic_Police.JobEditRecord[Realistic_Police.GetPlayerJob(ply)] then return end
|
||||
|
||||
local target = net.ReadEntity()
|
||||
local status = net.ReadBool()
|
||||
|
||||
if not IsValid(target) or not target:IsPlayer() then return end
|
||||
|
||||
local char = target:GetCharacter()
|
||||
if not char then return end
|
||||
|
||||
-- Определяем организацию на основе работы игрока
|
||||
local job = Realistic_Police.GetPlayerJob(ply)
|
||||
local org = "fsb"
|
||||
if job == "СБУ" then
|
||||
org = "sbu"
|
||||
end
|
||||
|
||||
char:SetData("wanted_" .. org, status)
|
||||
target:SetNWBool("ix_wanted_" .. org, status)
|
||||
|
||||
-- Синхронизируем общий статус ix_wanted для совместимости
|
||||
target:SetNWBool("ix_wanted", target:GetNWBool("ix_wanted_fsb") or target:GetNWBool("ix_wanted_sbu"))
|
||||
-- Также сохраняем в общее поле для военного билета
|
||||
char:SetData("wanted", char:GetData("wanted_fsb", false) or char:GetData("wanted_sbu", false))
|
||||
|
||||
if status then
|
||||
local orgName = (org == "sbu") and "СБУ" or "ФСБ"
|
||||
Realistic_Police.SendNotify(ply, "Вы объявили " .. target:Name() .. " в розыск (" .. orgName .. ").")
|
||||
else
|
||||
local orgName = (org == "sbu") and "СБУ" or "ФСБ"
|
||||
Realistic_Police.SendNotify(ply, "Вы сняли розыск (" .. orgName .. ") с " .. target:Name() .. ".")
|
||||
end
|
||||
end)
|
||||
|
||||
-- Синхронизация статусов при загрузке персонажа
|
||||
hook.Add("OnCharacterLoaded", "RealisticPolice:SyncWantedStatus", function(char)
|
||||
local ply = char:GetPlayer()
|
||||
if IsValid(ply) then
|
||||
local w_fsb = char:GetData("wanted_fsb", false)
|
||||
local w_sbu = char:GetData("wanted_sbu", false)
|
||||
|
||||
ply:SetNWBool("ix_wanted_fsb", w_fsb)
|
||||
ply:SetNWBool("ix_wanted_sbu", w_sbu)
|
||||
ply:SetNWBool("ix_wanted", w_fsb or w_sbu)
|
||||
end
|
||||
end)
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
-- Save Computer / Camera and police Screen on the map
|
||||
function Realistic_Police.SaveEntity()
|
||||
timer.Simple(1, function()
|
||||
file.Delete("realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt")
|
||||
local data = {}
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
table.insert(data, {
|
||||
Class = ent:GetClass(),
|
||||
Pos = ent:GetPos(),
|
||||
CName = ent:GetNWString("rpt_name_camera"),
|
||||
GetAngle = ent:GetAngles()
|
||||
})
|
||||
file.Write("realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt", util.TableToJSON(data))
|
||||
end
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_computer")) do
|
||||
table.insert(data, {
|
||||
Class = ent:GetClass(),
|
||||
Pos = ent:GetPos(),
|
||||
GetAngle = ent:GetAngles()
|
||||
})
|
||||
file.Write("realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt", util.TableToJSON(data))
|
||||
end
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_policescreen")) do
|
||||
table.insert(data, {
|
||||
Class = ent:GetClass(),
|
||||
Pos = ent:GetPos(),
|
||||
GetAngle = ent:GetAngles()
|
||||
})
|
||||
file.Write("realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt", util.TableToJSON(data))
|
||||
end
|
||||
end)
|
||||
end
|
||||
function Realistic_Police.Load(String)
|
||||
local directory = "realistic_police/" .. game.GetMap() .. String .. ".txt"
|
||||
if file.Exists(directory, "DATA") then
|
||||
local data = file.Read(directory, "DATA")
|
||||
data = util.JSONToTable(data)
|
||||
for k, v in pairs(data) do
|
||||
local rpt_entity = ents.Create(v.Class)
|
||||
rpt_entity:SetPos(v.Pos)
|
||||
rpt_entity:SetAngles(v.GetAngle)
|
||||
rpt_entity:Spawn()
|
||||
rpt_entity.RPTCam = true
|
||||
rpt_entity.HealthEntity = Realistic_Police.CameraHealth
|
||||
if isstring(v.CName) then
|
||||
rpt_entity:SetNWString("rpt_name_camera", v.CName)
|
||||
end
|
||||
rpt_entity.DestroyCam = false
|
||||
rpt_entity.RotateBack = false
|
||||
if v.Class == "realistic_police_camera" then
|
||||
rpt_entity:SetRptRotate("nil")
|
||||
end
|
||||
local rpt_entityload = rpt_entity:GetPhysicsObject()
|
||||
if (rpt_entityload:IsValid()) then
|
||||
rpt_entityload:Wake()
|
||||
rpt_entityload:EnableMotion(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
concommand.Add("rpt_save", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
Realistic_Police.SaveEntity()
|
||||
end
|
||||
end)
|
||||
concommand.Add("rpt_cleaupentities", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
ent:Remove()
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
concommand.Add("rpt_removedata", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
if file.Exists("realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt", "DATA") then
|
||||
file.Delete( "realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt" )
|
||||
concommand.Run(ply,"rpt_cleaupentities")
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
concommand.Add("rpt_reloadentities", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
concommand.Run(ply, "rpt_cleaupentities")
|
||||
Realistic_Police.Load("_rpt_entities")
|
||||
end
|
||||
end )
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
function Realistic_Police.SaveJailEntity()
|
||||
timer.Simple(1, function()
|
||||
if #ents.FindByClass("realistic_police_jailer") >= 1 && #ents.FindByClass("realistic_police_bailer") >= 1 then
|
||||
file.Delete("realistic_police/" .. game.GetMap() .. "_rpt_entities" .. ".txt")
|
||||
end
|
||||
local data = {}
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_bailer")) do
|
||||
table.insert(data, {
|
||||
Class = ent:GetClass(),
|
||||
Pos = ent:GetPos(),
|
||||
GetAngle = ent:GetAngles()
|
||||
})
|
||||
file.Write("realistic_police/" .. game.GetMap() .. "_rpt_jailents" .. ".txt", util.TableToJSON(data))
|
||||
end
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_jailer")) do
|
||||
table.insert(data, {
|
||||
Class = ent:GetClass(),
|
||||
Pos = ent:GetPos(),
|
||||
GetAngle = ent:GetAngles()
|
||||
})
|
||||
file.Write("realistic_police/" .. game.GetMap() .. "_rpt_jailents" .. ".txt", util.TableToJSON(data))
|
||||
end
|
||||
if #ents.FindByClass("realistic_police_jailpos") >= 1 then
|
||||
file.Delete("realistic_police/" .. game.GetMap() .. "_rpt_jailpos" .. ".txt")
|
||||
end
|
||||
local data = {}
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_jailpos")) do
|
||||
table.insert(data, {
|
||||
Pos = ent:GetPos(),
|
||||
})
|
||||
file.Write("realistic_police/" .. game.GetMap() .. "_rpt_jailpos" .. ".txt", util.TableToJSON(data))
|
||||
ent:Remove()
|
||||
end
|
||||
end)
|
||||
end
|
||||
concommand.Add("rpt_savejailpos", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
Realistic_Police.SaveJailEntity()
|
||||
end
|
||||
end)
|
||||
concommand.Add("rpt_reloadjailent", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
concommand.Run(ply, "rpt_removejail")
|
||||
Realistic_Police.Load("_rpt_jailents")
|
||||
end
|
||||
end )
|
||||
|
||||
concommand.Add("rpt_removedatajail", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
concommand.Run(ply, "rpt_removejail")
|
||||
if file.Exists("realistic_police/" .. game.GetMap() .. "_rpt_jailents" .. ".txt", "DATA") then
|
||||
file.Delete( "realistic_police/" .. game.GetMap() .. "_rpt_jailents" .. ".txt" )
|
||||
end
|
||||
if file.Exists("realistic_police/" .. game.GetMap() .. "_rpt_jailpos" .. ".txt", "DATA") then
|
||||
file.Delete( "realistic_police/" .. game.GetMap() .. "_rpt_jailpos" .. ".txt" )
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
concommand.Add("rpt_removejail", function(ply, cmd, args)
|
||||
if Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_jailer")) do
|
||||
ent:Remove()
|
||||
end
|
||||
for u, ent in pairs(ents.FindByClass("realistic_police_bailer")) do
|
||||
ent:Remove()
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
hook.Add("InitPostEntity", "realistic_policeInit", function()
|
||||
Realistic_Police.Load("_rpt_entities")
|
||||
Realistic_Police.Load("_rpt_jailents")
|
||||
end)
|
||||
|
||||
hook.Add("PostCleanupMap", "realistic_policeLoad", function()
|
||||
Realistic_Police.Load("_rpt_entities")
|
||||
Realistic_Police.Load("_rpt_jailents")
|
||||
end )
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,519 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police = Realistic_Police or {}
|
||||
|
||||
-- Helix Sync: Helper to get job name respecting units
|
||||
function Realistic_Police.GetPlayerJob(ply)
|
||||
if not IsValid(ply) then return "" end
|
||||
local char = ply.GetCharacter and ply:GetCharacter()
|
||||
if not char then return team.GetName(ply:Team()) end
|
||||
|
||||
local faction = char:GetFaction()
|
||||
local podrId = char:GetPodr()
|
||||
|
||||
if faction == (FACTION_RUSSIAN or -1) then
|
||||
if podrId == 6 then -- 6 is FSB Unit ID
|
||||
return "ФСБ «Вымпел»"
|
||||
end
|
||||
elseif faction == (FACTION_UKRAINE or -1) then
|
||||
if podrId == 5 then -- 5 is SBU Unit ID
|
||||
return "СБУ"
|
||||
end
|
||||
end
|
||||
|
||||
return team.GetName(ply:Team())
|
||||
end
|
||||
|
||||
Realistic_Police.PlateConfig = Realistic_Police.PlateConfig or {}
|
||||
Realistic_Police.Application = Realistic_Police.Application or {}
|
||||
Realistic_Police.PlateVehicle = Realistic_Police.PlateVehicle or {}
|
||||
Realistic_Police.FiningPolice = Realistic_Police.FiningPolice or {}
|
||||
Realistic_Police.Trunk = Realistic_Police.Trunk or {}
|
||||
Realistic_Police.TrunkPosition = Realistic_Police.TrunkPosition or {}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
---------------------------- Main Configuration------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.Lang = "ru" -- You can choose fr , en , tr , cn
|
||||
|
||||
Realistic_Police.DefaultJob = true -- Default Job Activate/Desactivate (Camera Repairer )
|
||||
|
||||
Realistic_Police.TrunkSystem = true -- Do you want to use the trunk system ?
|
||||
|
||||
Realistic_Police.KeyOpenTablet = KEY_I -- Key for open the tablet into a vehicle
|
||||
|
||||
Realistic_Police.WantedMessage = "Розыск ФСБ" -- Message when you wanted someone with the computer
|
||||
|
||||
Realistic_Police.StungunAmmo = 40 -- Stungun ammo
|
||||
|
||||
Realistic_Police.DisableWantedButton = false -- Do you want to disable wanted button
|
||||
|
||||
Realistic_Police.CanConfiscateWeapon = true -- If the functionality for confiscate is activate or desactivate
|
||||
|
||||
Realistic_Police.UseDefaultArrest = false -- use the default DarkRP arrest system
|
||||
|
||||
Realistic_Police.UseDarkRPNotify = false -- if you want to use the darkrp notification
|
||||
|
||||
Realistic_Police.CameraUpdateRate = 0.5 -- Update rate to optimise camera
|
||||
|
||||
Realistic_Police.SetModelWhenJail = false -- Set the model when the player is in jail
|
||||
|
||||
-- Set the model when the player is in jail
|
||||
Realistic_Police.ModelWhenJail = {
|
||||
"models/smalls_civilians/pack2/male/hoodie_jeans/male_01_hoodiejeans_pm.mdl",
|
||||
}
|
||||
|
||||
Realistic_Police.AdminRank = { -- Rank Admin
|
||||
["superadmin"] = true,
|
||||
["admin"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.OpenComputer = { -- Which job can open the computer
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.PoliceVehicle = { -- Police Vehicle
|
||||
["sierratdm"] = true,
|
||||
["Chevrolet Tahoe - RAID"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.TrunkPosition["Chevrolet Tahoe - RAID"] = {
|
||||
["Pos"] = Vector(0,0,0),
|
||||
["Ang"] = Angle(0,0,0),
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
------------------------- Computer Configuration-----------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.MaxReport = 5 -- Max report per persson
|
||||
|
||||
Realistic_Police.MaxCriminalRecord = 30 -- Max Criminal Record per persson
|
||||
|
||||
Realistic_Police.Application[1] = { -- Unique Id
|
||||
["Name"] = "Интернет", -- Name of the Application
|
||||
["Materials"] = Material("rpt_internet.png"), -- Material of the Application
|
||||
["Function"] = Realistic_Police.FireFox, -- Function Application
|
||||
["Type"] = "police",
|
||||
}
|
||||
|
||||
-- Removed Cameras app
|
||||
|
||||
|
||||
Realistic_Police.Application[3] = { -- Unique Id
|
||||
["Name"] = "Криминальная база", -- Name of the Application
|
||||
["Materials"] = Material("rpt_law.png"), -- Material of the Application
|
||||
["Function"] = Realistic_Police.CriminalRecord, -- Function Application
|
||||
["Type"] = "police",
|
||||
}
|
||||
Realistic_Police.Application[4] = { -- Unique Id
|
||||
["Name"] = "Подача жалоб", -- Name of the Application
|
||||
["Materials"] = Material("rpt_cloud.png"), -- Material of the Application
|
||||
["Function"] = Realistic_Police.ReportMenu, -- Function application
|
||||
["Type"] = "police",
|
||||
}
|
||||
|
||||
Realistic_Police.Application[5] = { -- Unique Id
|
||||
["Name"] = "Список жалоб", -- Name of the Application
|
||||
["Materials"] = Material("rpt_documents.png"), -- Material of the Application
|
||||
["Function"] = Realistic_Police.ListReport, -- Function Application
|
||||
["Type"] = "police",
|
||||
}
|
||||
|
||||
-- Removed Plates app
|
||||
|
||||
|
||||
Realistic_Police.Application[7] = { -- Unique Id
|
||||
["Name"] = "Терминал ФСБ", -- Name of the Application
|
||||
["Materials"] = Material("rpt_cmd.png"), -- Material of the Application
|
||||
["Function"] = Realistic_Police.Cmd, -- Function Application
|
||||
["Type"] = "hacker",
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--------------------------- Plate Configuration------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.PlateActivate = true -- If Module plate is activate
|
||||
|
||||
Realistic_Police.LangagePlate = "eu" -- You can choose eu or us
|
||||
|
||||
Realistic_Police.PlateConfig["us"] = {
|
||||
["Image"] = Material("rpt_plate_us.png"), -- Background of the plate
|
||||
["ImageServer"] = nil, -- Image server or Image of the department
|
||||
["TextColor"] = Color(24, 55, 66), -- Color Text of the plate
|
||||
["Country"] = "ARIZONA", -- Country Name
|
||||
["CountryPos"] = {2, 5}, -- The pos of the text
|
||||
["CountryColor"] = Color(26, 134, 185), -- Color of the country text
|
||||
["Department"] = "",
|
||||
["PlatePos"] = {2, 1.5}, -- Plate Pos
|
||||
["PlateText"] = false, -- AABCDAA
|
||||
}
|
||||
|
||||
Realistic_Police.PlateConfig["eu"] = {
|
||||
["Image"] = Material("rpt_plate_eu.png"), -- Background of the plate
|
||||
["ImageServer"] = Material("rpt_department_eu.png"), -- Image server or Image of the department
|
||||
["TextColor"] = Color(0, 0, 0, 255), -- Color Text of the plate
|
||||
["Country"] = "F", -- Country Name
|
||||
["CountryPos"] = {1.065, 1.4}, -- The pos of the text
|
||||
["CountryColor"] = Color(255, 255, 255), -- Color of the country text
|
||||
["Department"] = "77", -- Department
|
||||
["PlatePos"] = {2, 2}, -- Plate Pos
|
||||
["PlateText"] = true, -- AA-BCD-AA
|
||||
}
|
||||
|
||||
Realistic_Police.PlateVehicle["crsk_alfaromeo_8cspider"] = "us"
|
||||
|
||||
--Realistic_Police.PlateVehicle["class"] = "nameplate"
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
---------------------------- Trunk Configuration-----------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.KeyForOpenTrunk = KEY_E -- https://wiki.facepunch.com/gmod/Enums/KEY
|
||||
|
||||
Realistic_Police.KeyTrunkHUD = true -- Activate/desactivate the hud of the vehicle
|
||||
|
||||
Realistic_Police.CanOpenTrunk = {
|
||||
["Civil Protection"] = true,
|
||||
["Civil Protection Chief"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.VehiclePoliceTrunk = {
|
||||
["Airboat"] = true,
|
||||
["Jeep"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.MaxPropsTrunk = 10 -- Max props trunk
|
||||
|
||||
Realistic_Police.Trunk["models/props_wasteland/barricade002a.mdl"] = {
|
||||
["GhostPos"] = Vector(0,0,35),
|
||||
["GhostAngle"] = Vector(0,0,0),
|
||||
}
|
||||
Realistic_Police.Trunk["models/props_wasteland/barricade001a.mdl"] = {
|
||||
["GhostPos"] = Vector(0,0,30),
|
||||
["GhostAngle"] = Vector(0,0,0),
|
||||
}
|
||||
|
||||
Realistic_Police.Trunk["models/props_junk/TrafficCone001a.mdl"] = {
|
||||
["GhostPos"] = Vector(0,0,16),
|
||||
["GhostAngle"] = Vector(0,0,0),
|
||||
}
|
||||
|
||||
Realistic_Police.Trunk["models/props_c17/streetsign004f.mdl"] = {
|
||||
["GhostPos"] = Vector(0,0,12),
|
||||
["GhostAngle"] = Vector(0,0,0),
|
||||
}
|
||||
|
||||
Realistic_Police.Trunk["models/props_c17/streetsign001c.mdl"] = {
|
||||
["GhostPos"] = Vector(0,0,12),
|
||||
["GhostAngle"] = Vector(0,0,0),
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-------------------------- HandCuff Configuration----------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.MaxDay = 10 -- Max Jail Day
|
||||
|
||||
Realistic_Police.DayEqual = 60 -- 1 day = 60 Seconds
|
||||
|
||||
Realistic_Police.PriceDay = 5000 -- Price to pay with the bailer per day
|
||||
|
||||
Realistic_Police.JailerName = "Начальник тюрьмы" -- Jailer Name
|
||||
|
||||
Realistic_Police.BailerName = "Сотрудник ФССП" -- Bailer Name
|
||||
|
||||
Realistic_Police.SurrenderKey = KEY_T -- The key for surrender
|
||||
|
||||
Realistic_Police.SurrenderInfoKey = "T" -- The Key
|
||||
|
||||
Realistic_Police.SurrenderActivate = true
|
||||
|
||||
Realistic_Police.CanCuff = { -- Job which can arrest someone
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
|
||||
Realistic_Police.CantBeCuff = { -- Job which can't be cuff
|
||||
["Civil Protection"] = false,
|
||||
["Citizen"] = false,
|
||||
}
|
||||
|
||||
Realistic_Police.CantConfiscate = { -- Job which can't be cuff
|
||||
["gmod_tool"] = true,
|
||||
["weapon_physgun"] = true,
|
||||
["gmod_camera"] = true,
|
||||
["weapon_physcannon"] = true,
|
||||
["weapon_rpt_cuffed"] = true,
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-------------------------- Stungun Configuration-----------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.CantBeStun = { -- Job which can't be cuff
|
||||
["Civil Protection"] = true,
|
||||
["Citizen"] = false,
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--------------------------- Camera Configuration-----------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.CameraHealth = 50 -- Health of the Camera
|
||||
|
||||
Realistic_Police.CameraRestart = 60 -- Camera restart when they don't have humans for repair
|
||||
Realistic_Police.CameraRepairTimer = 10 -- Time to repair the camera 10s
|
||||
|
||||
Realistic_Police.CameraBrokeHud = true -- If when a camera was broken the Camera Worker have a Popup on his screen
|
||||
|
||||
Realistic_Police.CameraBroke = true -- if camera broke sometime when a camera repairer is present on the server
|
||||
|
||||
Realistic_Police.CameraWorker = { -- Job which can repair the camera
|
||||
["Camera Repairer"] = true,
|
||||
["Citizen"] = false,
|
||||
}
|
||||
|
||||
Realistic_Police.CameraGiveMoney = 500 -- Money give when a player repair a camera
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--------------------------- Report Configuration-----------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.JobDeleteReport = { -- Which job can delete Report
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
|
||||
Realistic_Police.JobEditReport = { -- Which job can create / edit report
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
------------------------ Criminal Record Configuration ----------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.JobDeleteRecord = { -- Which job can delete Criminal Record
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
|
||||
Realistic_Police.JobEditRecord = { -- Which job can create / edit Criminal Record
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
---------------------------- Fining System ----------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.PlayerWanted = true -- if the player is wanted when he doesn't pay the fine
|
||||
|
||||
Realistic_Police.PourcentPay = 10 -- The amount pourcent which are give when the player pay the fine
|
||||
|
||||
Realistic_Police.MaxPenalty = 2 -- Maxe Penalty on the same player
|
||||
|
||||
Realistic_Police.JobCanAddFine = { -- Which job can add fine
|
||||
["ФСБ «Вымпел»"] = true,
|
||||
["СБУ"] = true,
|
||||
}
|
||||
|
||||
|
||||
Realistic_Police.JobCantHaveFine = { -- Which job can't receive fine
|
||||
["Civil Protection"] = true,
|
||||
["Civil Protection Chief"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.VehicleCantHaveFine = { -- Which vehicle can't receive fine
|
||||
["lam_reventon_lw"] = false,
|
||||
["sierratdm"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[1] = {
|
||||
["Name"] = "Вуайеризм", -- Unique Name is require
|
||||
["Price"] = 1000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[2] = {
|
||||
["Name"] = "Ложные вызовы", -- Unique Name is require
|
||||
["Price"] = 1500,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[3] = {
|
||||
["Name"] = "Сопротивление при аресте", -- Unique Name is require
|
||||
["Price"] = 2500,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[4] = {
|
||||
["Name"] = "Неподчинение требованиям", -- Unique Name is require
|
||||
["Price"] = 1000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[5] = {
|
||||
["Name"] = "Пособничество преступнику", -- Unique Name is require
|
||||
["Price"] = 5000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[6] = {
|
||||
["Name"] = "Оскорбления/Мат", -- Unique Name is require
|
||||
["Price"] = 500,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[7] = {
|
||||
["Name"] = "Проституция", -- Unique Name is require
|
||||
["Price"] = 1000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[8] = {
|
||||
["Name"] = "Вандализм", -- Unique Name is require
|
||||
["Price"] = 2000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[9] = {
|
||||
["Name"] = "Хранение каннабиса", -- Unique Name is require
|
||||
["Price"] = 2000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[10] = {
|
||||
["Name"] = "Массовые беспорядки", -- Unique Name is require
|
||||
["Price"] = 2000,
|
||||
["Vehicle"] = false,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[11] = {
|
||||
["Name"] = "Езда с неисправными тормозами", -- Unique Name is require
|
||||
["Price"] = 500,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[12] = {
|
||||
["Name"] = "Езда с неисправным рулём", -- Unique Name is require
|
||||
["Price"] = 750,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[13] = {
|
||||
["Name"] = "Парковка в неположенном месте", -- Unique Name is require
|
||||
["Price"] = 1000,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[14] = {
|
||||
["Name"] = "Превышение скорости", -- Unique Name is require
|
||||
["Price"] = 250,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[15] = {
|
||||
["Name"] = "Побег с места ДТП", -- Unique Name is require
|
||||
["Price"] = 600,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[16] = {
|
||||
["Name"] = "Неисправные тормоза", -- Unique Name is require
|
||||
["Price"] = 1200,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[17] = {
|
||||
["Name"] = "Нарушение скоростного режима", -- Unique Name is require
|
||||
["Price"] = 1500,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[18] = {
|
||||
["Name"] = "Угон транспортного средства", -- Unique Name is require
|
||||
["Price"] = 700,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
Realistic_Police.FiningPolice[19] = {
|
||||
["Name"] = "Нарушение скоростного режима", -- Unique Name is require
|
||||
["Price"] = 160,
|
||||
["Vehicle"] = true,
|
||||
["Category"] = "General",
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
--------------------------- Hacking System ----------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Realistic_Police.NameOs = "АСД-ФСБ" -- The name of the os
|
||||
|
||||
Realistic_Police.ResolveHack = 120 -- Time which the computer will be repair
|
||||
|
||||
Realistic_Police.WordCount = 10 -- How many word the people have to write for hack the computer
|
||||
|
||||
Realistic_Police.HackerJob = { -- Which are not able to use the computer without hack the computer
|
||||
["Citizen"] = true,
|
||||
["Hobo"] = true,
|
||||
}
|
||||
|
||||
Realistic_Police.WordHack = { -- Random Word for hack the computer
|
||||
"run.hack.exe",
|
||||
"police.access.hack",
|
||||
"rootip64",
|
||||
"delete.password",
|
||||
"password.breaker",
|
||||
"run.database.sql",
|
||||
"delete.access",
|
||||
"recompil",
|
||||
"connect.police.system",
|
||||
"datacompil",
|
||||
"username",
|
||||
"mysqlbreaker",
|
||||
"camera.exe",
|
||||
"criminal.record.exe",
|
||||
"deleteusergroup",
|
||||
"license.plate.exe",
|
||||
"cameracitizen.exe",
|
||||
"loaddatapublic",
|
||||
"internet.exe",
|
||||
"reportmenu.exe",
|
||||
"listreport.exe",
|
||||
}
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
Realistic_Police.Colors = Realistic_Police.Colors or {}
|
||||
|
||||
Realistic_Police.Colors["white"] = Color( 255, 255, 255 )
|
||||
Realistic_Police.Colors["white250"] = Color( 255, 255, 255, 250 )
|
||||
Realistic_Police.Colors["white240"] = Color( 255, 255, 255, 240 )
|
||||
Realistic_Police.Colors["white200"] = Color( 255, 255, 255, 200 )
|
||||
Realistic_Police.Colors["white150"] = Color( 255, 255, 255, 150 )
|
||||
Realistic_Police.Colors["gray"] = Color( 230, 230, 230 )
|
||||
Realistic_Police.Colors["gray240"] = Color( 240, 240, 240 )
|
||||
Realistic_Police.Colors["gray220"] = Color( 220, 220, 220 )
|
||||
Realistic_Police.Colors["gray200"] = Color( 240, 240, 240, 200 )
|
||||
Realistic_Police.Colors["gray150"] = Color( 240, 240, 240, 150 )
|
||||
Realistic_Police.Colors["gray100"] = Color( 100, 100, 100, 255 )
|
||||
Realistic_Police.Colors["black"] = Color(0, 0, 0)
|
||||
Realistic_Police.Colors["black240"] = Color(25, 28, 29, 240)
|
||||
Realistic_Police.Colors["black100"] = Color(0, 0, 0, 100)
|
||||
Realistic_Police.Colors["black49"] = Color(49, 49, 49, 240)
|
||||
Realistic_Police.Colors["black25"] = Color(25, 28, 29)
|
||||
Realistic_Police.Colors["black25200"] = Color(25, 28, 29, 200)
|
||||
Realistic_Police.Colors["black25150"] = Color(25, 28, 29, 150)
|
||||
Realistic_Police.Colors["black13"] = Color(13, 13, 13, 240)
|
||||
Realistic_Police.Colors["black180"] = Color(0, 0, 0, 180)
|
||||
Realistic_Police.Colors["black15"] = Color(13, 13, 15, 255)
|
||||
Realistic_Police.Colors["black2510"] = Color(25, 28, 29, 10)
|
||||
Realistic_Police.Colors["black49"] = Color(40, 40, 40, 240)
|
||||
Realistic_Police.Colors["black49255"] = Color(40, 40, 40, 255)
|
||||
Realistic_Police.Colors["black20"] = Color(20, 20, 20, 255)
|
||||
Realistic_Police.Colors["black15200"] = Color(13, 13, 15, 200)
|
||||
Realistic_Police.Colors["gray50"] = Color(50, 50, 50)
|
||||
Realistic_Police.Colors["gray60"] = Color( 60, 60, 60, 255 )
|
||||
Realistic_Police.Colors["gray60200"] = Color( 60, 60, 60, 255 )
|
||||
Realistic_Police.Colors["green"] = Color(39, 174, 96, 240)
|
||||
Realistic_Police.Colors["red"] = Color(232, 17, 35)
|
||||
Realistic_Police.Colors["lightblue"] = Color(53,156,224)
|
||||
Realistic_Police.Colors["darkblue"] = Color(34, 47, 62)
|
||||
Realistic_Police.Colors["bluetool"] = Color(52, 73, 94)
|
||||
Realistic_Police.Colors["blue41200"] = Color(41, 128, 185, 200)
|
||||
Realistic_Police.Colors["black41200"] = Color(41,42,53,200)
|
||||
Realistic_Police.Colors["black41200"] = Color(41,42,53,200)
|
||||
Realistic_Police.Colors["white240"] = Color(255,255,255,210)
|
||||
Realistic_Police.Colors["black18220"] = Color(18, 30, 42, 220)
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
Realistic_Police.Colors["Material1"] = Material("rpt_trash.png")
|
||||
Realistic_Police.Colors["Material2"] = Material("rpt_background_v2.png", "smooth")
|
||||
Realistic_Police.Colors["Material3"] = Material("rpt_toolbar.png")
|
||||
Realistic_Police.Colors["Material4"] = Material("rpt_keybord.png")
|
||||
Realistic_Police.Colors["Material5"] = Material("rpt_camerahud.png")
|
||||
Realistic_Police.Colors["Material6"] = Material("rpt_turnoff.png")
|
||||
Realistic_Police.Colors["Material7"] = Material("rpt_bell.png")
|
||||
Realistic_Police.Colors["Material8"] = Material("rpt_resize.png")
|
||||
Realistic_Police.Colors["Material9"] = Material("rpt_logo_police.png")
|
||||
Realistic_Police.Colors["Material2_SBU"] = Material("rpt_background_v2_sbu.png", "smooth")
|
||||
Realistic_Police.Colors["Material9_SBU"] = Material("rpt_logo_sbu.png")
|
||||
Realistic_Police.Colors["Material10"] = Material("rpt_tablette_background.png")
|
||||
-- 76561198219964937
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
|
||||
--[[ Make sure sentence exist and also langage exist]]
|
||||
function Realistic_Police.GetSentence(string)
|
||||
local result = "Lang Problem"
|
||||
|
||||
local key = string
|
||||
if CLIENT and IsValid(Realistic_Police.CurrentComputer) and Realistic_Police.CurrentComputer.IsSBU and Realistic_Police.CurrentComputer:IsSBU() then
|
||||
if Realistic_Police.Language[Realistic_Police.Lang] and Realistic_Police.Language[Realistic_Police.Lang][string .. "_SBU"] then
|
||||
key = string .. "_SBU"
|
||||
end
|
||||
end
|
||||
|
||||
local sentence = istable(Realistic_Police.Language[Realistic_Police.Lang]) and Realistic_Police.Language[Realistic_Police.Lang][key] or "Lang Problem"
|
||||
|
||||
if istable(Realistic_Police.Language[Realistic_Police.Lang]) and isstring(sentence) then
|
||||
result = sentence
|
||||
elseif istable(Realistic_Police.Language["en"]) and isstring(Realistic_Police.Language["en"][sentence]) then
|
||||
result = Realistic_Police.Language["en"][sentence]
|
||||
end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
@@ -0,0 +1,138 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
TOOL.Category = "Realistic Police"
|
||||
TOOL.Name = "Camera-Setup"
|
||||
TOOL.Author = "Kobralost"
|
||||
RPTDeployTool = false
|
||||
|
||||
if CLIENT then
|
||||
TOOL.Information = {
|
||||
{ name = "left" },
|
||||
{ name = "right" },
|
||||
}
|
||||
language.Add("tool.realistic_police_camera_tool.name", "Camera Setup")
|
||||
language.Add("tool.realistic_police_camera_tool.desc", "Create or modify Position of your Camera")
|
||||
language.Add("tool.realistic_police_camera_tool.left", "Left-Click to place the camera in your server" )
|
||||
language.Add("tool.realistic_police_camera_tool.right", "Right-Click to delete the camera on your server" )
|
||||
end
|
||||
|
||||
function TOOL:Deploy()
|
||||
RPTDeployTool = true
|
||||
end
|
||||
|
||||
function TOOL:LeftClick(trace)
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.5
|
||||
local ply = self:GetOwner()
|
||||
if SERVER then
|
||||
if not IsValid( ply ) && not ply:IsPlayer() then return end
|
||||
local trace = ply:GetEyeTrace()
|
||||
local position = trace.HitPos
|
||||
local angle = ply:GetAngles()
|
||||
local rpt_createent = ents.Create( "realistic_police_camera" )
|
||||
rpt_createent:SetPos(position + Vector(0, 0, 0))
|
||||
rpt_createent:SetAngles(Angle(0, angle.Yaw - 90, 0))
|
||||
rpt_createent:Spawn()
|
||||
rpt_createent:Activate()
|
||||
rpt_createent.RPTCam = true
|
||||
timer.Simple(0.1, function()
|
||||
net.Start("RealisticPolice:NameCamera")
|
||||
net.WriteEntity(rpt_createent)
|
||||
net.Send(self:GetOwner())
|
||||
end )
|
||||
else
|
||||
if not RPTDeployTool then RPTDeployTool = true end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:RightClick()
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.01
|
||||
|
||||
if SERVER then
|
||||
local TraceEntity = self:GetOwner():GetEyeTrace().Entity
|
||||
if IsValid(TraceEntity) && TraceEntity:GetClass() == "realistic_police_camera" then
|
||||
TraceEntity:Remove()
|
||||
else
|
||||
if IsValid(ents.FindByClass("realistic_police_camera")[#ents.FindByClass("realistic_police_camera")]) then
|
||||
ents.FindByClass("realistic_police_camera")[#ents.FindByClass("realistic_police_camera")]:Remove()
|
||||
end
|
||||
end
|
||||
Realistic_Police.SaveEntity()
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:CreateRPTEnt()
|
||||
if CLIENT then
|
||||
if IsValid(self.RPTEnt) then else
|
||||
self.RPTEnt = ClientsideModel("models/wasted/wasted_kobralost_camera.mdl", RENDERGROUP_OPAQUE)
|
||||
self.RPTEnt:SetModel("models/wasted/wasted_kobralost_camera.mdl")
|
||||
self.RPTEnt:SetMaterial("models/wireframe")
|
||||
self.RPTEnt:SetPos(Vector(0,0,0))
|
||||
self.RPTEnt:SetAngles(Angle(0,0,0))
|
||||
self.RPTEnt:Spawn()
|
||||
self.RPTEnt:Activate()
|
||||
self.RPTEnt.Ang = Angle(0,0,0)
|
||||
self.RPTEnt:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
self.RPTEnt:SetColor(Realistic_Police.Colors["white"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Think()
|
||||
if IsValid(self.RPTEnt) then
|
||||
ply = self:GetOwner()
|
||||
trace = util.TraceLine(util.GetPlayerTrace(ply))
|
||||
ang = ply:GetAimVector():Angle()
|
||||
Pos = Vector(trace.HitPos.X, trace.HitPos.Y, trace.HitPos.Z)
|
||||
Ang = Angle(0, ang.Yaw - 90, 0) + self.RPTEnt.Ang
|
||||
self.RPTEnt:SetPos(Pos)
|
||||
self.RPTEnt:SetAngles(Ang)
|
||||
else
|
||||
self:CreateRPTEnt()
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Holster()
|
||||
if IsValid(self.RPTEnt) then
|
||||
self.RPTEnt:Remove()
|
||||
end
|
||||
RPTDeployTool = false
|
||||
end
|
||||
hook.Add("HUDPaint", "RPT:HUDPaint", function()
|
||||
if RPTDeployTool then
|
||||
for k,v in pairs(ents.FindByClass("realistic_police_camera")) do
|
||||
local tscreen = v:GetPos():ToScreen()
|
||||
draw.SimpleText( k, "rpt_font_2", tscreen.x, tscreen.y + 20, Realistic_Police.Colors["white"],1,1)
|
||||
draw.SimpleText( "☑" , "rpt_font_2", tscreen.x, tscreen.y, Realistic_Police.Colors["white"],1,1)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function TOOL.BuildCPanel( CPanel )
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Save Realistic Police Entities" })
|
||||
CPanel:Button("Save Entities", "rpt_save")
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Remove all Entities in The Data" })
|
||||
CPanel:Button("Remove Entities Data", "rpt_removedata")
|
||||
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Remove all Entities in The Map" })
|
||||
CPanel:Button("Remove Entities Map", "rpt_cleaupentities")
|
||||
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Reload all Entities in The Map" })
|
||||
CPanel:Button("Reload Entities Map", "rpt_reloadentities")
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
TOOL.Category = "Realistic Police"
|
||||
TOOL.Name = "HandCuff-Setup"
|
||||
TOOL.Author = "Kobralost"
|
||||
TOOL.StepId = 1
|
||||
|
||||
if CLIENT then
|
||||
TOOL.Information = {
|
||||
{ name = "left" },
|
||||
{ name = "right" },
|
||||
{ name = "use" },
|
||||
{ name = "reload" },
|
||||
}
|
||||
language.Add("tool.realistic_police_handcuff_tool.name", "HandCuff Setup")
|
||||
language.Add("tool.realistic_police_handcuff_tool.desc", "Create or modify Position of Bailor, Jailor & Jail")
|
||||
language.Add("tool.realistic_police_handcuff_tool.left", "Left-Click to place entities on the server" )
|
||||
language.Add("tool.realistic_police_handcuff_tool.right", "Right-Click to delete the last entity" )
|
||||
language.Add("tool.realistic_police_handcuff_tool.use", "USE to return to the previous step" )
|
||||
language.Add("tool.realistic_police_handcuff_tool.reload", "RELOAD to go to the next step" )
|
||||
end
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
|
||||
function TOOL:Deploy()
|
||||
self.StepId = 1
|
||||
end
|
||||
|
||||
-- Create the Entity ( Jailer , Bailer )
|
||||
function Realistic_Police.CreateEntityTool(Player, model, ent)
|
||||
local angle = Player:GetAimVector():Angle()
|
||||
local ang = Angle(0,angle.yaw + 180,0)
|
||||
|
||||
local EntityT = ents.Create( ent )
|
||||
EntityT:SetModel(model)
|
||||
if ent == "realistic_police_jailpos" then
|
||||
EntityT:SetPos( Player:GetEyeTrace().HitPos + Vector(0,0,13) )
|
||||
else
|
||||
EntityT:SetPos( Player:GetEyeTrace().HitPos + Vector(0,0,0) )
|
||||
end
|
||||
EntityT:SetAngles(ang)
|
||||
EntityT:Spawn()
|
||||
end
|
||||
|
||||
function TOOL:LeftClick(trace)
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.1
|
||||
if SERVER then
|
||||
if self.StepId == 1 then
|
||||
Realistic_Police.CreateEntityTool(self:GetOwner(), "models/Humans/Group01/Female_02.mdl", "realistic_police_jailer")
|
||||
elseif self.StepId == 2 then
|
||||
Realistic_Police.CreateEntityTool(self:GetOwner(), "models/Humans/Group01/Female_02.mdl", "realistic_police_bailer")
|
||||
elseif self.StepId == 3 then
|
||||
Realistic_Police.CreateEntityTool(self:GetOwner(), "models/hunter/blocks/cube05x05x05.mdl", "realistic_police_jailpos")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:RightClick()
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.1
|
||||
|
||||
if SERVER then
|
||||
local Ent = self:GetOwner():GetEyeTrace().Entity
|
||||
if IsValid(Ent) then
|
||||
if Ent:GetClass() == "realistic_police_bailer" or Ent:GetClass() == "realistic_police_jailer" or Ent:GetClass() == "realistic_police_jailpos" then
|
||||
Ent:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function TOOL:DrawToolScreen( w, h )
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
if CLIENT then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["darkblue"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Color(52, 73, 94) )
|
||||
surface.DrawRect( 15, 20 + ( self.StepId * 70 ) - 70, w-30, 74 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.DrawRect( 15, 20 + ( self.StepId * 70 ) - 70, w-30, 2 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.DrawRect( 15, 20 + ( self.StepId * 70 ) + 5, w-30, 2 )
|
||||
draw.SimpleText( "Jailor NPC", "rpt_font_18", w / 2, h / 4.7, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
draw.SimpleText( "Bailor NPC", "rpt_font_18", w / 2, h / 2, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
draw.SimpleText( "Jail Position", "rpt_font_18", w / 2, h / 1.3, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER )
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:CreateGhostRPTEnt(Model)
|
||||
if CLIENT then
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
if not IsValid(self.RPTGhostEnt) then
|
||||
self.RPTGhostEnt = ClientsideModel(Model, RENDERGROUP_OPAQUE)
|
||||
self.RPTGhostEnt:SetModel(Model)
|
||||
self.RPTGhostEnt:SetMaterial("models/wireframe")
|
||||
self.RPTGhostEnt:SetPos(Vector(0,0,0))
|
||||
self.RPTGhostEnt:SetAngles(self:GetOwner():GetAngles())
|
||||
self.RPTGhostEnt:Spawn()
|
||||
self.RPTGhostEnt:Activate()
|
||||
self.RPTGhostEnt.Ang = self:GetOwner():GetAngles()
|
||||
|
||||
self.RPTGhostEnt:SetRenderMode(RENDERMODE_TRANSALPHA)
|
||||
self.RPTGhostEnt:SetColor(Realistic_Police.Colors["white"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Reload(trace)
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.1
|
||||
|
||||
if self.StepId != 3 then
|
||||
self.StepId = self.StepId + 1
|
||||
if self.StepId == 1 or self.StepId == 2 then
|
||||
if IsValid(self.RPTGhostEnt) then
|
||||
self.RPTGhostEnt:Remove()
|
||||
end
|
||||
self:CreateGhostRPTEnt("models/Humans/Group01/Female_02.mdl")
|
||||
else
|
||||
if IsValid(self.RPTGhostEnt) then
|
||||
self.RPTGhostEnt:Remove()
|
||||
end
|
||||
self:CreateGhostRPTEnt("models/hunter/blocks/cube05x05x05.mdl")
|
||||
end
|
||||
else
|
||||
if IsValid(self.RPTGhostEnt) then
|
||||
self.RPTGhostEnt:Remove()
|
||||
end
|
||||
self.StepId = 1
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Think()
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
|
||||
if self.StepId >= 1 or self.StepId <= 3 then
|
||||
if IsValid(self.RPTGhostEnt) then
|
||||
ply = self:GetOwner()
|
||||
trace = util.TraceLine(util.GetPlayerTrace(ply))
|
||||
angle = ply:GetAimVector():Angle()
|
||||
ang = Angle(0,angle.yaw + 180,0)
|
||||
if self.StepId != 3 then
|
||||
Pos = Vector(trace.HitPos.X, trace.HitPos.Y, trace.HitPos.Z)
|
||||
else
|
||||
Pos = Vector(trace.HitPos.X, trace.HitPos.Y, trace.HitPos.Z + 13)
|
||||
end
|
||||
self.RPTGhostEnt:SetPos(Pos)
|
||||
self.RPTGhostEnt:SetAngles(ang)
|
||||
else
|
||||
if self.StepId == 1 or self.StepId == 2 then
|
||||
self:CreateGhostRPTEnt("models/Humans/Group01/Female_02.mdl")
|
||||
else
|
||||
self:CreateGhostRPTEnt("models/hunter/blocks/cube05x05x05.mdl")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Holster()
|
||||
if IsValid(self.RPTGhostEnt) then
|
||||
if IsValid(self.RPTGhostEnt) then
|
||||
self.RPTGhostEnt:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL.BuildCPanel( CPanel )
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Save Jailer / Bailer / Jail Pos Entities" })
|
||||
CPanel:Button("Save Entities", "rpt_savejailpos")
|
||||
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Remove all Handcuff Entities in The Data" })
|
||||
CPanel:Button("Remove Entities Data", "rpt_removedatajail")
|
||||
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Remove all Handcuff Entities in The Map" })
|
||||
CPanel:Button("Remove Entities Map", "rpt_removejail")
|
||||
|
||||
CPanel:AddControl("label", {
|
||||
Text = "Reload all Handcuff Entities in The Map" })
|
||||
CPanel:Button("Reload Entities Map", "rpt_reloadjailent")
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,324 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
TOOL.Category = "Realistic Police"
|
||||
TOOL.Name = "Plate-Setup"
|
||||
TOOL.Author = "Kobralost"
|
||||
TOOL.StepID = 1
|
||||
|
||||
if CLIENT then
|
||||
RPTStepID = 1
|
||||
TOOL.Information = {
|
||||
{ name = "left" },
|
||||
{ name = "right" },
|
||||
{ name = "use" },
|
||||
{ name = "reload" },
|
||||
}
|
||||
language.Add("tool.realistic_police_plate_tool.name", "License Plate Setup")
|
||||
language.Add("tool.realistic_police_plate_tool.desc", "Create or modify License Plate in your server")
|
||||
language.Add("tool.realistic_police_plate_tool.left", "Left-Click to select the vehicle & Place the License Plate" )
|
||||
language.Add("tool.realistic_police_plate_tool.use", "Use to return to the previous step and modify the first License Plate" )
|
||||
language.Add("tool.realistic_police_plate_tool.right", "Right-Click to delete the license plate of the vehicle" )
|
||||
language.Add("tool.realistic_police_plate_tool.reload", "Reload to go to the next step & Place two License Plate" )
|
||||
end
|
||||
-- Reset Variables of the Plate ( Rotation , Size , Position)
|
||||
local function ResetPosition()
|
||||
RPTPosition = {
|
||||
[1] = 0,
|
||||
[2] = 0,
|
||||
[3] = 0,
|
||||
[4] = 0,
|
||||
[5] = 0,
|
||||
[6] = 0,
|
||||
[7] = 0,
|
||||
[8] = 0,
|
||||
}
|
||||
RPTPosition2 = {
|
||||
[1] = 0,
|
||||
[2] = 0,
|
||||
[3] = 0,
|
||||
[4] = 0,
|
||||
[5] = 0,
|
||||
[6] = 0,
|
||||
[7] = 0,
|
||||
[8] = 0,
|
||||
}
|
||||
end
|
||||
|
||||
function TOOL:Deploy()
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
if SERVER then
|
||||
self.StepID = 1
|
||||
elseif CLIENT then
|
||||
RPTToolSetup = false
|
||||
RPTStepID = 1
|
||||
RPTGhostActivate = true
|
||||
ResetPosition()
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Reload()
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.1
|
||||
-- dcb587233a6e567b06ae4da5655e3e9649694e7946f4d648e8f3181d8bc95b5f
|
||||
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
if CLIENT then
|
||||
if RPTStepID == 2 then
|
||||
if PosPlate != nil then
|
||||
RPTStepID = 3
|
||||
RPTGhostActivate = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("KeyPress", "RealisticPolice:KeyPress", function(ply, key)
|
||||
if ( key == IN_USE ) then
|
||||
if CLIENT then
|
||||
if IsValid(ply) && ply:IsPlayer() then
|
||||
if Realistic_Police && Realistic_Police.AdminRank && Realistic_Police.AdminRank[ply:GetUserGroup()] then
|
||||
if RPTStepID == 3 then
|
||||
RPTStepID = 2
|
||||
RPTGhostActivate = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end )
|
||||
function TOOL:RightClick() -- Remove the Plate
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.5
|
||||
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
|
||||
if CLIENT then
|
||||
if Realistic_Police.AdminRank[LocalPlayer():GetUserGroup()] then
|
||||
if RPTStepID == 2 then
|
||||
PosPlate = nil
|
||||
RPTGhostActivate = true
|
||||
end
|
||||
if RPTStepID == 3 then
|
||||
PosPlate2 = nil
|
||||
RPTGhostActivate = true
|
||||
end
|
||||
end
|
||||
elseif SERVER then
|
||||
local EntityTrace = self:GetOwner():GetEyeTrace().Entity
|
||||
local RealisticPoliceFil = file.Read("realistic_police/vehicles.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
|
||||
if istable(RealisticPoliceTab[EntityTrace:GetModel()]) then
|
||||
if EntityTrace:IsVehicle() then
|
||||
RealisticPoliceTab[EntityTrace:GetModel()] = nil
|
||||
file.Write("realistic_police/vehicles.txt", util.TableToJSON(RealisticPoliceTab))
|
||||
timer.Simple(0.1, function()
|
||||
local RealisticPoliceFil = file.Read("realistic_police/vehicles.txt", "DATA") or ""
|
||||
local RealisticPoliceTab = util.JSONToTable(RealisticPoliceFil) or {}
|
||||
local CompressTable = util.Compress(RealisticPoliceFil)
|
||||
net.Start("RealisticPolice:SendInformation")
|
||||
net.WriteInt(CompressTable:len(), 32)
|
||||
net.WriteData(CompressTable, CompressTable:len() )
|
||||
net.Broadcast()
|
||||
end )
|
||||
end
|
||||
else
|
||||
EntityTrace:Remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Think() -- Debug
|
||||
if SERVER then
|
||||
if not IsValid(self.car_setup) then
|
||||
if self.StepID > 1 then
|
||||
net.Start("RealisticPolice:UpdateInformation")
|
||||
net.Send(self:GetOwner())
|
||||
self.StepID = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
net.Receive("RealisticPolice:UpdateInformation", function()
|
||||
if IsValid(RPTMain) then RPTMain:Remove() end
|
||||
RPTStepID = 1
|
||||
RPTToolSetup = false
|
||||
PosPlate = nil
|
||||
RPTGhostActivate = true
|
||||
PosPlate2 = nil
|
||||
RPTGhostActivate = true
|
||||
ResetPosition()
|
||||
end )
|
||||
end
|
||||
|
||||
function TOOL:LeftClick(trace) -- Place the Plate
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
self:GetOwner().AntiSpam = self:GetOwner().AntiSpam or CurTime()
|
||||
if self:GetOwner().AntiSpam > CurTime() then return end
|
||||
self:GetOwner().AntiSpam = CurTime() + 0.3
|
||||
|
||||
if SERVER then
|
||||
local EntityTrace = trace.Entity
|
||||
if EntityTrace:IsVehicle() then
|
||||
if IsValid(self.car_setup) then
|
||||
self.car_setup:Remove()
|
||||
self.StepID = 2
|
||||
end
|
||||
end
|
||||
if self.StepID == 2 then
|
||||
timer.Simple(0.2, function()
|
||||
if IsValid(self:GetOwner()) then
|
||||
net.Start("RealisticPolice:SetupVehicle")
|
||||
net.WriteEntity(self.car_setup)
|
||||
net.Send(self:GetOwner())
|
||||
end
|
||||
end )
|
||||
end
|
||||
if self.StepID == 1 then
|
||||
if IsValid(EntityTrace) then
|
||||
local EntitiyLook = self:GetOwner():GetEyeTrace().Entity
|
||||
self.car_setup = ents.Create( "prop_physics" )
|
||||
self.car_setup:SetModel( EntitiyLook:GetModel() )
|
||||
self.car_setup:SetPos( EntitiyLook:GetPos() )
|
||||
self.car_setup:SetAngles( Angle(0,0,0) )
|
||||
self.car_setup.VehicleSetupRPT = true
|
||||
self.car_setup.Owner = self:GetOwner()
|
||||
self.car_setup:Spawn()
|
||||
local phys = self.car_setup:GetPhysicsObject()
|
||||
if phys and phys:IsValid() then
|
||||
phys:EnableMotion(false)
|
||||
end
|
||||
timer.Create("rpt_timer_setupvehicle"..self.car_setup:EntIndex(), 0.1, 0, function()
|
||||
if not IsValid(self.car_setup) then timer.Remove("rpt_timer_setupvehicle") RPTToolSetup = false end
|
||||
if IsValid(self.car_setup) then
|
||||
self.car_setup:SetAngles( Angle(0,0,0) )
|
||||
local phys = self.car_setup:GetPhysicsObject()
|
||||
if phys and phys:IsValid() then
|
||||
phys:EnableMotion(false)
|
||||
end
|
||||
end
|
||||
end )
|
||||
EntitiyLook:Remove()
|
||||
self.StepID = 2
|
||||
end
|
||||
end
|
||||
elseif CLIENT then
|
||||
ResetPosition()
|
||||
local EntityTrace = trace.Entity
|
||||
if RPTStepID == 2 then
|
||||
if RPTToolSetup then
|
||||
PosPlate = LocalPlayer():GetEyeTrace().HitPos
|
||||
local ang = LocalPlayer():GetAimVector():Angle()
|
||||
AngPlate = Angle(0, ang.Yaw + -90, 90):SnapTo( "y", 1 )
|
||||
RPTGhostActivate = false
|
||||
end
|
||||
end
|
||||
if RPTStepID == 3 then
|
||||
PosPlate2 = LocalPlayer():GetEyeTrace().HitPos
|
||||
local ang = LocalPlayer():GetAimVector():Angle()
|
||||
AngPlate2 = Angle(0, ang.Yaw + -90, 90):SnapTo( "y", 1 )
|
||||
RPTGhostActivate = false
|
||||
end
|
||||
if EntityTrace:IsVehicle() then
|
||||
RPTGhostActivate = true
|
||||
RPTToolSetup = true
|
||||
RPTStepID = 2
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TOOL:Holster()
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
if CLIENT then
|
||||
RPTToolSetup = false
|
||||
RPTGhostActivate = false
|
||||
PosPlate = nil
|
||||
PosPlate2 = nil
|
||||
if IsValid(RPTMain) then RPTMain:Remove() end
|
||||
ResetPosition()
|
||||
else
|
||||
if IsValid(self.car_setup) then self.car_setup:Remove() end
|
||||
end
|
||||
end
|
||||
|
||||
local toolGun = {
|
||||
[1] = Realistic_Police.GetSentence("configureLicenseplate"),
|
||||
[2] = Realistic_Police.GetSentence("placeLicenseplate"),
|
||||
[3] = Realistic_Police.GetSentence("placeLicenseplate2"),
|
||||
}
|
||||
|
||||
function TOOL:DrawToolScreen( w, h )
|
||||
if not Realistic_Police.AdminRank[self:GetOwner():GetUserGroup()] then return end
|
||||
if CLIENT then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["black"] )
|
||||
surface.DrawRect( 0, 0, w, h )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["bluetool"] )
|
||||
surface.DrawRect( 15, 20, w-30, 70 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.DrawRect( 15, 85 , w-30, 2 )
|
||||
surface.SetDrawColor( Realistic_Police.Colors["white"] )
|
||||
surface.DrawRect( 15, 25, w-30, 2 )
|
||||
draw.SimpleText("Step "..RPTStepID, "rpt_font_18", w/2, h/5,Realistic_Police.Colors["white"],TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
|
||||
draw.DrawText(toolGun[RPTStepID], "rpt_font_18", w/2, h/2.3,Realistic_Police.Colors["white"],TEXT_ALIGN_CENTER)
|
||||
end
|
||||
end
|
||||
|
||||
local function RealisticPoliceGhost(pos, ang, RptTable)
|
||||
cam.Start3D2D( pos, ang, 0.02 )
|
||||
if Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["Image"] != nil then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray"] )
|
||||
surface.SetMaterial( Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["Image"] )
|
||||
surface.DrawTexturedRect( 0, 0, 1400 + RptTable[7], 400 + RptTable[8])
|
||||
end
|
||||
if Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["Country"] != nil then
|
||||
local Country = Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["Country"]
|
||||
draw.SimpleText(Country, Realistic_Police.Fonts((1400 + RptTable[7])/12 + RptTable[8]*0.05), (1400 + RptTable[7]) - (1400 + RptTable[7])/Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["CountryPos"][1], (400 + RptTable[8])/Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["CountryPos"][2], Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["CountryColor"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
if Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["Department"] != nil then
|
||||
draw.SimpleText(Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["Department"], Realistic_Police.Fonts((1400 + RptTable[7])/13+ RptTable[8]*0.05), (1400 + RptTable[7])/1.06, (400 + RptTable[8])/1.4, Realistic_Police.Colors["gray"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
if not Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlateText"] then
|
||||
draw.SimpleText("ABDS582D", Realistic_Police.Fonts((1400 + RptTable[7])/6 + RptTable[8]*0.05),(1400 + RptTable[7])/Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][1] - 5, (400 + RptTable[8])/ Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][2]+5, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText("ABDS582D", Realistic_Police.Fonts((1400 + RptTable[7])/6 + RptTable[8]*0.05), (1400 + RptTable[7])/Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][1], (400 + RptTable[8])/ Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][2], Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["TextColor"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
else
|
||||
draw.SimpleText("AA-123-BB", Realistic_Police.Fonts((1400 + RptTable[7])/6 + RptTable[8]*0.05),(1400 + RptTable[7])/Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][1] - 5, (400 + RptTable[8])/ Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][2]+5, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
draw.SimpleText("AA-123-BB", Realistic_Police.Fonts((1400 + RptTable[7])/6 + RptTable[8]*0.05),(1400 + RptTable[7])/Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][1], (400 + RptTable[8])/ Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["PlatePos"][2], Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["TextColor"], TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
|
||||
end
|
||||
if Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["ImageServer"] != nil then
|
||||
surface.SetDrawColor( Realistic_Police.Colors["gray"] )
|
||||
surface.SetMaterial( Realistic_Police.PlateConfig[Realistic_Police.LangagePlate]["ImageServer"] )
|
||||
surface.DrawTexturedRect( (1400 + RptTable[7])/1.104, (400 + RptTable[8])/6, (1400 + RptTable[7])/14,(400 + RptTable[8])/3 )
|
||||
end
|
||||
cam.End3D2D()
|
||||
end
|
||||
if CLIENT then -- Preview of the Plate
|
||||
hook.Add("PostDrawTranslucentRenderables", "RPT:LicensePlateTool", function() -- Draw Plate
|
||||
if RPTToolSetup then
|
||||
if PosPlate != nil then
|
||||
RealisticPoliceGhost(PosPlate + Vector(RPTPosition[1],RPTPosition[2],RPTPosition[3]), AngPlate + Angle(RPTPosition[4],RPTPosition[5],RPTPosition[6]), RPTPosition)
|
||||
end
|
||||
if PosPlate == nil or PosPlate2 == nil then
|
||||
if RPTGhostActivate then
|
||||
local Pos = LocalPlayer():GetEyeTrace().HitPos
|
||||
local ang = LocalPlayer():GetAimVector():Angle()
|
||||
RPTAngSnap = Angle(0, ang.Yaw + -90, 90):SnapTo( "y", 1 )
|
||||
RealisticPoliceGhost(Pos, RPTAngSnap + Angle(RPTPosition[4],RPTPosition[5],RPTPosition[6]), RPTPosition)
|
||||
end
|
||||
end
|
||||
if PosPlate2 != nil then
|
||||
RealisticPoliceGhost(PosPlate2 + Vector(RPTPosition2[1],RPTPosition2[2],RPTPosition2[3]), AngPlate2 + Angle(RPTPosition2[4],RPTPosition2[5],RPTPosition2[6]), RPTPosition2)
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Cuffed"
|
||||
SWEP.Author = "Kobralost"
|
||||
SWEP.Purpose = ""
|
||||
|
||||
SWEP.Slot = 2
|
||||
SWEP.SlotPos = 1
|
||||
|
||||
SWEP.Spawnable = false
|
||||
|
||||
SWEP.Category = "Realistic Police"
|
||||
SWEP.ViewModel = Model( "" )
|
||||
SWEP.WorldModel = Model("models/realistic_police/handcuffs/w_deploy_handcuffs.mdl")
|
||||
SWEP.ViewModelFOV = 75
|
||||
SWEP.UseHands = false
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = true
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
SWEP.HitDistance = 125
|
||||
|
||||
SWEP.DarkRPCanLockpick = true
|
||||
function SWEP:Deploy()
|
||||
local Owner = self:GetOwner()
|
||||
-- Manipulate the Bone of the Player
|
||||
timer.Simple(0.2, function()
|
||||
for k,v in pairs(Realistic_Police.ManipulateBoneCuffed) do
|
||||
local bone = Owner:LookupBone(k)
|
||||
if bone then
|
||||
Owner:ManipulateBoneAngles(bone, v)
|
||||
end
|
||||
end
|
||||
self:SetHoldType("passive")
|
||||
end)
|
||||
end
|
||||
if CLIENT then
|
||||
local WorldModel = ClientsideModel(SWEP.WorldModel)
|
||||
|
||||
WorldModel:SetSkin(1)
|
||||
WorldModel:SetNoDraw(true)
|
||||
|
||||
function SWEP:DrawWorldModel()
|
||||
local _Owner = self:GetOwner()
|
||||
|
||||
if (IsValid(_Owner)) then
|
||||
|
||||
local offsetVec = Vector(5, 1, -9)
|
||||
local offsetAng = Angle(190, 140, -20)
|
||||
|
||||
local boneid = _Owner:LookupBone("ValveBiped.Bip01_R_Hand")
|
||||
if !boneid then return end
|
||||
|
||||
local matrix = _Owner:GetBoneMatrix(boneid)
|
||||
if !matrix then return end
|
||||
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
|
||||
|
||||
WorldModel:SetPos(newPos)
|
||||
WorldModel:SetAngles(newAng)
|
||||
WorldModel:SetupBones()
|
||||
else
|
||||
WorldModel:SetPos(self:GetPos())
|
||||
WorldModel:SetAngles(self:GetAngles())
|
||||
end
|
||||
|
||||
WorldModel:DrawModel()
|
||||
end
|
||||
WorldModel:SetModelScale( WorldModel:GetModelScale() * 1.3, 0 )
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
function SWEP:DrawHUD()
|
||||
draw.SimpleTextOutlined(Realistic_Police.GetSentence("youArrest"),"rpt_font_9", ScrW()/2, ScrH()/15, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM,2, Realistic_Police.Colors["black"])
|
||||
if math.Round(LocalPlayer():GetNWInt("rpt_arrest_time") - CurTime()) > 0 then
|
||||
draw.SimpleTextOutlined("[ "..math.Round(LocalPlayer():GetNWInt("rpt_arrest_time") - CurTime()).." ] - "..Realistic_Police.GetSentence("seconds"),"rpt_font_9", ScrW()/2, ScrH()/11, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM,2, Realistic_Police.Colors["black"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:CanPrimaryAttack() end
|
||||
function SWEP:CanSecondaryAttack() end
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Книга штрафов"
|
||||
SWEP.Author = "Kobralost"
|
||||
SWEP.Purpose = ""
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
|
||||
SWEP.Spawnable = true
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
|
||||
SWEP.Category = "Realistic Police"
|
||||
SWEP.ViewModel = Model( "models/realistic_police/finebook/c_notebook.mdl" )
|
||||
SWEP.WorldModel = Model("models/realistic_police/finebook/w_notebook.mdl")
|
||||
SWEP.ViewModelFOV = 75
|
||||
SWEP.UseHands = true
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = true
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
SWEP.HitDistance = 125
|
||||
|
||||
function SWEP:Deploy()
|
||||
local Owner = self:GetOwner()
|
||||
|
||||
self:SendWeaponAnim( ACT_VM_DRAW )
|
||||
self:SetNextPrimaryFire( CurTime() + self:SequenceDuration() )
|
||||
-- Play the idle animation next the primary attack
|
||||
timer.Create("rpt_animation"..self:GetOwner():EntIndex(), self:SequenceDuration(), 1, function()
|
||||
if IsValid(self) && IsValid(Owner) then
|
||||
if Owner:GetActiveWeapon() == self then
|
||||
self:SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
local Owner = self:GetOwner()
|
||||
|
||||
Owner.AntiSpam = Owner.AntiSpam or CurTime()
|
||||
if Owner.AntiSpam > CurTime() then return end
|
||||
Owner.AntiSpam = CurTime() + 1
|
||||
|
||||
if SERVER then
|
||||
Owner.WeaponRPT["Fine"] = Owner:GetEyeTrace().Entity
|
||||
if IsValid(Owner.WeaponRPT["Fine"]) then
|
||||
|
||||
-- Check if the entity is a vehicle or a player
|
||||
if Owner.WeaponRPT["Fine"]:IsPlayer() or Owner.WeaponRPT["Fine"]:IsVehicle() then
|
||||
|
||||
-- Check if the Police Man is near the entity
|
||||
if Owner:GetPos():DistToSqr(Owner.WeaponRPT["Fine"]:GetPos()) < 140^2 then
|
||||
|
||||
-- Check if the player can add a fine
|
||||
if not Realistic_Police.JobCanAddFine[Realistic_Police.GetPlayerJob(Owner)] then
|
||||
Realistic_Police.SendNotify(Owner, Realistic_Police.GetSentence("noGoodJob"))
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if the Player can have a fine
|
||||
if Owner.WeaponRPT["Fine"]:IsPlayer() then
|
||||
if Realistic_Police.JobCantHaveFine[Realistic_Police.GetPlayerJob(Owner.WeaponRPT["Fine"])] then
|
||||
Realistic_Police.SendNotify(Owner, Realistic_Police.GetSentence("userCantReceiveFine"))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if this type of vehicle can have a fine
|
||||
if Owner.WeaponRPT["Fine"]:IsVehicle() then
|
||||
if Realistic_Police.VehicleCantHaveFine[Owner.WeaponRPT["Fine"]:GetVehicleClass()] then
|
||||
Realistic_Police.SendNotify(Owner, Realistic_Police.GetSentence("vehicleCantHaveFine"))
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Send information about the type of the entity if it's a player or a vehicle
|
||||
local RPTCheck = nil
|
||||
if Owner.WeaponRPT["Fine"]:IsPlayer() then
|
||||
Owner.WeaponRPT["Fine"]:Freeze(true)
|
||||
RPTCheck = false
|
||||
else
|
||||
RPTCheck = true
|
||||
end
|
||||
|
||||
-- Remove the Unfreeze timer of the player
|
||||
if timer.Exists("rpt_stungun_unfreeze"..Owner.WeaponRPT["Fine"]:EntIndex()) then
|
||||
timer.Remove("rpt_stungun_unfreeze"..Owner.WeaponRPT["Fine"]:EntIndex())
|
||||
end
|
||||
|
||||
net.Start("RealisticPolice:Open")
|
||||
net.WriteString("OpenFiningMenu")
|
||||
net.WriteBool(RPTCheck)
|
||||
net.Send(Owner)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack() end
|
||||
|
||||
|
||||
@@ -0,0 +1,272 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Наручники"
|
||||
SWEP.Author = "Kobralost"
|
||||
SWEP.Purpose = ""
|
||||
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
|
||||
SWEP.Spawnable = true
|
||||
|
||||
SWEP.Category = "Realistic Police"
|
||||
|
||||
SWEP.ViewModel = Model("models/realistic_police/handcuffs/c_handcuffs.mdl")
|
||||
SWEP.WorldModel = Model("models/realistic_police/handcuffs/w_handcuffs.mdl")
|
||||
SWEP.ViewModelFOV = 80
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = true
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
SWEP.HitDistance = 125
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
local Owner = self:GetOwner()
|
||||
if not IsValid(Owner) then return end
|
||||
|
||||
local ply = Owner:GetEyeTrace().Entity
|
||||
if not IsValid(ply) then return end
|
||||
|
||||
Owner.AntiSpam = Owner.AntiSpam or CurTime()
|
||||
if Owner.AntiSpam > CurTime() then return end
|
||||
Owner.AntiSpam = CurTime() + 1
|
||||
|
||||
if DarkRP and ply:IsPlayer() then
|
||||
if ply.isArrested && ply:isArrested() then return end
|
||||
end
|
||||
|
||||
-- Check if the Police Man Can Cuff the player
|
||||
if not Realistic_Police.CanCuff[Realistic_Police.GetPlayerJob(Owner)] then
|
||||
if SERVER then
|
||||
Realistic_Police.SendNotify(Owner, Realistic_Police.GetSentence("noGoodJobToArrestuser"))
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- Check if the player can be cuff or not
|
||||
if IsValid(ply) && ply:IsPlayer() then
|
||||
if Realistic_Police.CantBeCuff[Realistic_Police.GetPlayerJob(ply)] then
|
||||
if SERVER then
|
||||
Realistic_Police.SendNotify(Owner, Realistic_Police.GetSentence("cantArrestPlayer"))
|
||||
end
|
||||
return
|
||||
end
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
if Owner:GetPos():DistToSqr(ply:GetPos()) > 20000 then return end
|
||||
|
||||
if SERVER then
|
||||
|
||||
if ply.WeaponRPT["Cuff"] == nil or not ply.WeaponRPT["Cuff"] then
|
||||
|
||||
-- Freeze the Player and The police man
|
||||
ply:Freeze(true)
|
||||
Owner:Freeze(true)
|
||||
ply.WeaponRPT["processCuff"] = true
|
||||
|
||||
-- Remove the Unfreeze timer of the player
|
||||
if timer.Exists("rpt_stungun_unfreeze"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_stungun_unfreeze"..ply:EntIndex())
|
||||
end
|
||||
|
||||
timer.Simple(self:SequenceDuration(), function()
|
||||
if IsValid(ply) && IsValid(Owner) then
|
||||
Realistic_Police.Cuff(ply, Owner)
|
||||
|
||||
if IsValid(ply) then ply:Freeze(false) end
|
||||
if IsValid(Owner) then Owner:Freeze(false) end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Send the Weapon Animation and the weapon sound
|
||||
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
|
||||
self:SetNextPrimaryFire( CurTime() + 4 )
|
||||
|
||||
-- Play the idle animation next the primary attack
|
||||
timer.Create("rpt_animation"..self:GetOwner():EntIndex(), self:SequenceDuration(), 1, function()
|
||||
if IsValid(self) && IsValid(Owner) then
|
||||
if Owner:GetActiveWeapon() == self then
|
||||
self:SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
end
|
||||
end )
|
||||
|
||||
elseif ply.WeaponRPT["Cuff"] then
|
||||
|
||||
-- Freeze the Player and The police man
|
||||
ply:Freeze(true)
|
||||
Owner:Freeze(true)
|
||||
|
||||
-- Remove the Unfreeze timer of the player
|
||||
if timer.Exists("rpt_stungun_unfreeze"..ply:EntIndex()) then
|
||||
timer.Remove("rpt_stungun_unfreeze"..ply:EntIndex())
|
||||
end
|
||||
|
||||
timer.Simple(self:SequenceDuration(), function()
|
||||
if IsValid(ply) && IsValid(Owner) then
|
||||
Realistic_Police.UnCuff(ply, Owner)
|
||||
if IsValid(ply) then ply:Freeze(false) end
|
||||
if IsValid(Owner) then Owner:Freeze(false) end
|
||||
end
|
||||
end )
|
||||
-- Send the Weapon Animation and the weapon sound
|
||||
self:SendWeaponAnim( ACT_VM_SECONDARYATTACK )
|
||||
self:SetNextSecondaryFire( CurTime() + 4 )
|
||||
|
||||
-- Play the idle animation next the primary attack
|
||||
timer.Create("rpt_animation"..self:GetOwner():EntIndex(), self:SequenceDuration(), 1, function()
|
||||
if IsValid(self) && IsValid(Owner) then
|
||||
if Owner:GetActiveWeapon() == self then
|
||||
self:SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
end
|
||||
|
||||
self.Weapon:EmitSound("rpthandcuffleftclick.mp3")
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
local Owner = self:GetOwner()
|
||||
local ply = Owner:GetEyeTrace().Entity
|
||||
|
||||
Owner.AntiSpam = Owner.AntiSpam or CurTime()
|
||||
if Owner.AntiSpam > CurTime() then return end
|
||||
Owner.AntiSpam = CurTime() + 1
|
||||
|
||||
if SERVER then
|
||||
-- Check if the Player is Near the Police Man
|
||||
if IsValid(ply) && IsValid(Owner) && not ply:IsVehicle() then
|
||||
if istable(ply.WeaponRPT) then
|
||||
if ply.WeaponRPT["Cuff"] then
|
||||
Realistic_Police.Drag(ply, Owner)
|
||||
end
|
||||
end
|
||||
|
||||
elseif ply:IsVehicle() then
|
||||
if IsValid(Owner.WeaponRPT["Drag"]) then
|
||||
Owner.WeaponRPT["Drag"].WeaponRPT["EnterExit"] = false
|
||||
if SVMOD && SVMOD:GetAddonState() then
|
||||
for i, seat in ipairs(ply.SV_Data.Seats) do
|
||||
if not seat.Entity and i ~= 1 then
|
||||
|
||||
local seat = ply:SV_CreateSeat(i)
|
||||
Owner.WeaponRPT["Drag"]:EnterVehicle(seat)
|
||||
end
|
||||
end
|
||||
elseif VC then
|
||||
Owner.WeaponRPT["Drag"]:EnterVehicle(Realistic_Police.PlaceVehicle(Owner, ply))
|
||||
else
|
||||
local tr = util.TraceLine( {
|
||||
start = Owner:EyePos(),
|
||||
endpos = Owner:EyePos() + Owner:EyeAngles():Forward() * 100,
|
||||
})
|
||||
|
||||
for k, v in pairs(ents.FindInSphere(tr.HitPos, 75)) do
|
||||
if not IsValid(v) or not v:IsVehicle() then continue end
|
||||
|
||||
Owner.WeaponRPT["Drag"]:EnterVehicle(v)
|
||||
end
|
||||
end
|
||||
Owner.WeaponRPT["Drag"].WeaponRPT["EnterExit"] = true
|
||||
|
||||
-- Reset Drag Player
|
||||
Owner.WeaponRPT["Drag"].WeaponRPT["DragedBy"] = nil
|
||||
Owner.WeaponRPT["Drag"] = nil
|
||||
else
|
||||
if SVMOD && SVMOD:GetAddonState() then
|
||||
local playerInVehicle = ply:SV_GetAllPlayers()
|
||||
if istable(playerInVehicle) then
|
||||
for k,v in pairs(playerInVehicle) do
|
||||
if v.WeaponRPT["Cuff"] then
|
||||
v.WeaponRPT["EnterExit"] = false
|
||||
v:ExitVehicle()
|
||||
v.WeaponRPT["EnterExit"] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif VC then
|
||||
local playerInVehicle = ply:VC_getPlayers()
|
||||
if istable(playerInVehicle) then
|
||||
for k,v in pairs(playerInVehicle) do
|
||||
if v.WeaponRPT["Cuff"] then
|
||||
v.WeaponRPT["EnterExit"] = false
|
||||
v:ExitVehicle()
|
||||
v.WeaponRPT["EnterExit"] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
local tr = util.TraceLine( {
|
||||
start = Owner:EyePos(),
|
||||
endpos = Owner:EyePos() + Owner:EyeAngles():Forward() * 100,
|
||||
})
|
||||
|
||||
for k, v in pairs(ents.FindInSphere(tr.HitPos, 75)) do
|
||||
if not IsValid(v) or not v:IsPlayer() then continue end
|
||||
if v.WeaponRPT["Cuff"] then
|
||||
v.WeaponRPT["EnterExit"] = false
|
||||
v:ExitVehicle()
|
||||
v.WeaponRPT["EnterExit"] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Reload()
|
||||
local Owner = self:GetOwner()
|
||||
local ply = Owner:GetEyeTrace().Entity
|
||||
|
||||
Owner.AntiSpam = Owner.AntiSpam or CurTime()
|
||||
if Owner.AntiSpam > CurTime() then return end
|
||||
Owner.AntiSpam = CurTime() + 1
|
||||
|
||||
if SERVER then
|
||||
if IsValid(ply) && ply:IsPlayer() && ply.WeaponRPT && ply.WeaponRPT["Cuff"] then
|
||||
-- Open the inspect menu for confiscate weapons
|
||||
net.Start("RealisticPolice:HandCuff")
|
||||
net.WriteString("Inspect")
|
||||
net.WriteEntity(ply)
|
||||
net.Send(Owner)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:Deploy()
|
||||
local Owner = self:GetOwner()
|
||||
self:SendWeaponAnim( ACT_VM_DRAW )
|
||||
self.Weapon:EmitSound("rpthandcuffdeploy.mp3")
|
||||
-- Play the idle animation next the primary attack
|
||||
timer.Create("rpt_animation"..self:GetOwner():EntIndex(), self:SequenceDuration(), 1, function()
|
||||
if IsValid(self) && IsValid(Owner) then
|
||||
if Owner:GetActiveWeapon() == self then
|
||||
self:SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
SWEP.PrintName = "Электрошокер"
|
||||
SWEP.Author = "Kobralost"
|
||||
SWEP.Purpose = ""
|
||||
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
|
||||
SWEP.Spawnable = true
|
||||
|
||||
SWEP.Category = "Realistic Police"
|
||||
|
||||
SWEP.ViewModel = Model("models/realistic_police/taser/c_taser.mdl")
|
||||
SWEP.WorldModel = Model("models/realistic_police/taser/w_taser.mdl")
|
||||
SWEP.ViewModelFOV = 60
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Base = "weapon_base"
|
||||
|
||||
local ShootSound = Sound("Weapon_Pistol.Single")
|
||||
SWEP.Primary.Damage = 1
|
||||
SWEP.Primary.TakeAmmo = 1
|
||||
SWEP.Primary.ClipSize = 1
|
||||
SWEP.Primary.Ammo = "Pistol"
|
||||
|
||||
SWEP.Primary.DefaultClip = 1
|
||||
SWEP.Primary.Spread = 0.1
|
||||
SWEP.Primary.NumberofShots = 1
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.Recoil = .2
|
||||
SWEP.Primary.Delay = 0.1
|
||||
SWEP.Primary.Force = 100
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = false
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.DrawAmmo = true
|
||||
|
||||
SWEP.HitDistance = 125
|
||||
|
||||
function SWEP:Deploy()
|
||||
local Owner = self:GetOwner()
|
||||
self:SendWeaponAnim( ACT_VM_DRAW )
|
||||
-- Play the idle animation next the primary attack
|
||||
timer.Create("rpt_animation"..self:GetOwner():EntIndex(), self:SequenceDuration(), 1, function()
|
||||
if IsValid(self) && IsValid(Owner) then
|
||||
if Owner:GetActiveWeapon() == self then
|
||||
self:SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
end
|
||||
end )
|
||||
end
|
||||
|
||||
function SWEP:Trace()
|
||||
local mins = Vector( -30, 0, 0 )
|
||||
local maxs = Vector( 30, 0, 0 )
|
||||
|
||||
local startpos = self.Owner:GetPos() + self.Owner:GetForward() * 40 + self.Owner:GetUp() * 60
|
||||
local dir = self.Owner:GetAngles():Forward()
|
||||
local len = 500
|
||||
|
||||
local tr = util.TraceHull( {
|
||||
start = startpos,
|
||||
endpos = startpos + dir * len,
|
||||
maxs = maxs,
|
||||
mins = mins,
|
||||
filter = self.Owner,
|
||||
})
|
||||
|
||||
return tr
|
||||
end
|
||||
function SWEP:PrimaryAttack()
|
||||
local Owner = self:GetOwner()
|
||||
if ( !self:CanPrimaryAttack() ) then return end
|
||||
|
||||
local bullet = {}
|
||||
bullet.Num = self.Primary.NumberofShots
|
||||
bullet.Src = self.Owner:GetShootPos()
|
||||
bullet.Dir = self.Owner:GetAimVector()
|
||||
bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 0)
|
||||
bullet.Tracer = 1
|
||||
bullet.Force = self.Primary.Force
|
||||
bullet.Damage = self.Primary.Damage
|
||||
bullet.AmmoType = self.Primary.Ammo
|
||||
|
||||
local rnda = self.Primary.Recoil * -1
|
||||
local rndb = self.Primary.Recoil * math.random(-1, 1)
|
||||
|
||||
self:ShootEffects()
|
||||
|
||||
local tr = self:Trace()
|
||||
local ply = tr.Entity
|
||||
local tracepos = util.TraceLine(util.GetPlayerTrace( self.Owner ))
|
||||
local effect = EffectData()
|
||||
effect:SetOrigin( tracepos.HitPos )
|
||||
effect:SetStart( self.Owner:GetShootPos() )
|
||||
effect:SetAttachment( 1 )
|
||||
effect:SetEntity( self )
|
||||
util.Effect( "ToolTracer", effect )
|
||||
-- Take a bullet of primary ammo
|
||||
self.Weapon:EmitSound("rptstungunshot2.mp3")
|
||||
|
||||
if IsValid(ply) && ply:IsPlayer() then
|
||||
-- Check if the player is near the player
|
||||
if Owner:GetPos():DistToSqr(ply:GetPos()) < 600^2 then
|
||||
if SERVER then
|
||||
if not Realistic_Police.CantBeStun[Realistic_Police.GetPlayerJob(ply)] then
|
||||
ply:EmitSound( "ambient/voices/m_scream1.wav" )
|
||||
Realistic_Police.Tazz(ply)
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneCuffed, ply)
|
||||
Realistic_Police.ResetBonePosition(Realistic_Police.ManipulateBoneSurrender, ply)
|
||||
ply:EmitSound("rptstungunmain.mp3")
|
||||
|
||||
hook.Run("RealisticPolice:Tazz", ply, self:GetOwner() )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
self:TakePrimaryAmmo(self.Primary.TakeAmmo)
|
||||
self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
|
||||
end
|
||||
|
||||
function SWEP:Reload()
|
||||
local wep = self:GetOwner():GetActiveWeapon()
|
||||
if ( !IsValid( wep ) ) then return -1 end
|
||||
local ammo = self:GetOwner():GetAmmoCount( wep:GetPrimaryAmmoType() )
|
||||
|
||||
if self:Clip1() == 0 && ammo != 0 then
|
||||
self.Weapon:EmitSound("rptstungunreload.mp3")
|
||||
self.Weapon:DefaultReload( ACT_VM_RELOAD );
|
||||
end
|
||||
end
|
||||
function SWEP:SecondaryAttack() end
|
||||
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
AddCSLuaFile()
|
||||
|
||||
SWEP.PrintName = "Сдаться"
|
||||
SWEP.Author = "Kobralost"
|
||||
SWEP.Purpose = ""
|
||||
|
||||
SWEP.Slot = 2
|
||||
SWEP.SlotPos = 1
|
||||
|
||||
SWEP.Spawnable = false
|
||||
SWEP.Category = "Realistic Police"
|
||||
|
||||
SWEP.ViewModel = Model( "models/weapons/sycreations/Kobralost/handsup.mdl" )
|
||||
SWEP.WorldModel = Model("")
|
||||
SWEP.ViewModelFOV = 55
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = true
|
||||
SWEP.Primary.Ammo = "none"
|
||||
-- d4ec95c252515613de193db925956fba07d4ff50f580a4b42b7f507f9c716945
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = true
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
|
||||
SWEP.HitDistance = 125
|
||||
-- a91f6942e11bb9a70ff8e3d7a0dcc737fd407c85d2d10ff95a1cfed59177e84a
|
||||
|
||||
function SWEP:Deploy()
|
||||
local Owner = self:GetOwner()
|
||||
-- Manipulate the Bone of the Player
|
||||
timer.Simple(0.2, function()
|
||||
if not IsValid(self) or not IsValid(Owner) then return end
|
||||
|
||||
for k,v in pairs(Realistic_Police.ManipulateBoneSurrender) do
|
||||
local bone = Owner:LookupBone(k)
|
||||
if bone then
|
||||
Owner:ManipulateBoneAngles(bone, v)
|
||||
end
|
||||
end
|
||||
self:SetHoldType("passive")
|
||||
Owner.RPTSurrender = true
|
||||
end )
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
function SWEP:DrawHUD()
|
||||
draw.SimpleTextOutlined(Realistic_Police.GetSentence("youSurrender").." ( Press "..Realistic_Police.SurrenderInfoKey.." )","rpt_font_9", ScrW()/2, ScrH()/15, Realistic_Police.Colors["white"], TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM,2, Realistic_Police.Colors["black"])
|
||||
end
|
||||
end
|
||||
|
||||
function SWEP:CanPrimaryAttack() end
|
||||
function SWEP:CanSecondaryAttack() end
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
|
||||
/*
|
||||
Addon id: e7709ac2-cc0b-41b1-845d-7528015000ee
|
||||
Version: v1.7.8 (stable)
|
||||
*/
|
||||
|
||||
-- 3aaf217dbda72c52d8532897f5c9000ac85eca339f30615d1f3f36b925d66cfe
|
||||
|
||||
AddCSLuaFile()
|
||||
SWEP.PrintName = "Гаечный ключ"
|
||||
SWEP.Author = "Kobralost"
|
||||
SWEP.Purpose = ""
|
||||
|
||||
SWEP.Slot = 0
|
||||
SWEP.SlotPos = 4
|
||||
|
||||
SWEP.Spawnable = true
|
||||
|
||||
SWEP.Category = "Realistic Police"
|
||||
|
||||
SWEP.ViewModel = Model( "models/weapons/sycreations/Kobralost/v_ajustableWrench.mdl" )
|
||||
SWEP.WorldModel = Model( "models/weapons/sycreations/Kobralost/w_ajustableWrench.mdl" )
|
||||
|
||||
SWEP.ViewModelFOV = 55
|
||||
SWEP.UseHands = true
|
||||
|
||||
SWEP.Primary.ClipSize = -1
|
||||
SWEP.Primary.DefaultClip = -1
|
||||
SWEP.Primary.Automatic = false
|
||||
SWEP.Primary.Ammo = "none"
|
||||
|
||||
SWEP.Secondary.ClipSize = -1
|
||||
SWEP.Secondary.DefaultClip = -1
|
||||
SWEP.Secondary.Automatic = true
|
||||
SWEP.Secondary.Ammo = "none"
|
||||
|
||||
SWEP.DrawAmmo = false
|
||||
SWEP.HitDistance = 48
|
||||
|
||||
function SWEP:Initialize()
|
||||
self:SetHoldType( "slam" )
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
if ( CLIENT ) then return end
|
||||
local Owner = self:GetOwner()
|
||||
local ply = Owner:GetEyeTrace().Entity
|
||||
|
||||
-- Check if the entity trace is a camera
|
||||
if IsValid(ply) && ply:GetClass() == "realistic_police_camera" then
|
||||
|
||||
-- Check if the player is near the entity
|
||||
if Owner:GetPos():DistToSqr(ply:GetPos()) < 125^2 then
|
||||
|
||||
-- Check if the Camera is broke
|
||||
if ply.DestroyCam then
|
||||
-- Check if the Player have the correct job for repair the camera
|
||||
if Realistic_Police.CameraWorker[Realistic_Police.GetPlayerJob(Owner)] then
|
||||
|
||||
-- Play the Primary Attack animation
|
||||
Owner:Freeze(true)
|
||||
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
|
||||
|
||||
timer.Create("rpt_repair_camera2"..Owner:EntIndex(), 5, (Realistic_Police.CameraRepairTimer/5) - 1, function()
|
||||
if IsValid(Owner) then
|
||||
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
|
||||
end
|
||||
end)
|
||||
|
||||
-- Create Movement on the camera of the player
|
||||
local Punch = { 0.1, 0.5, 1, 1.2, 0.3, -0.5, -0.9, -1.6, -0.4, -0.8 }
|
||||
timer.Create("rpt_repeat_anim"..Owner:EntIndex(), 1, Realistic_Police.CameraRepairTimer, function()
|
||||
if IsValid(Owner) then
|
||||
Owner:ViewPunch( Angle( table.Random(Punch), table.Random(Punch), table.Random(Punch) ) )
|
||||
end
|
||||
end)
|
||||
|
||||
-- Reset Rotation , Player Active Sequence and Reset Health of the camera
|
||||
timer.Create("rpt_camera_repair"..Owner:EntIndex(), Realistic_Police.CameraRepairTimer, 1, function()
|
||||
if IsValid(ply) then
|
||||
-- Reset Camera Information
|
||||
ply:ResetSequence("active")
|
||||
ply:SetSequence("active")
|
||||
ply.HealthEntity = Realistic_Police.CameraHealth
|
||||
ply:SetRptCam(false)
|
||||
ply.DestroyCam = false
|
||||
|
||||
-- Unfreeze the Player && give the money
|
||||
Owner:Freeze(false)
|
||||
Owner:addMoney(Realistic_Police.CameraGiveMoney)
|
||||
Realistic_Police.SendNotify(Owner, Realistic_Police.GetSentence("youWon").." "..DarkRP.formatMoney(Realistic_Police.CameraGiveMoney))
|
||||
end
|
||||
end )
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function SWEP:SecondaryAttack() end
|
||||
|
||||
function SWEP:Holster()
|
||||
if SERVER then
|
||||
self:GetOwner():Freeze(false)
|
||||
timer.Remove("rpt_camera_repair"..self:GetOwner():EntIndex())
|
||||
timer.Remove("rpt_repair_camera2"..self:GetOwner():EntIndex())
|
||||
timer.Remove("rpt_repeat_anim"..self:GetOwner():EntIndex())
|
||||
self:SendWeaponAnim( ACT_VM_IDLE )
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user