mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 05:43:46 +03:00
Upload
This commit is contained in:
226
gamemodes/darkrp/plugins/combinesuits/cl_hooks.lua
Normal file
226
gamemodes/darkrp/plugins/combinesuits/cl_hooks.lua
Normal file
@@ -0,0 +1,226 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
PLUGIN.minDist = 500 * 500
|
||||
PLUGIN.maxDist = 1000 * 1000
|
||||
PLUGIN.newOverlay = ix.util.GetMaterial("effects/combine_mockup5")
|
||||
PLUGIN.traceFilter = {false, false}
|
||||
|
||||
local COMMAND_PREFIX = "/"
|
||||
local validBeeps = {
|
||||
["w"] = true,
|
||||
["y"] = true,
|
||||
}
|
||||
|
||||
function PLUGIN:GetHookCallPriority(hook)
|
||||
if (hook == "GetCharacterName") then
|
||||
return 1100
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:GetAdminESPTargets()
|
||||
local client = LocalPlayer()
|
||||
if (client:IsDispatch()) then
|
||||
local targets = {}
|
||||
for _ , v in ipairs(player.GetAll()) do
|
||||
if (v == client) then continue end
|
||||
if (!IsValid(v) or !v:Alive()) then continue end
|
||||
if (v:GetNetVar("combineSuitTracked") or v:IsDispatch()) then
|
||||
targets[#targets + 1] = v
|
||||
end
|
||||
end
|
||||
|
||||
return targets
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:GetCharacterName(client, chatType)
|
||||
if (!client) then return end
|
||||
if (LocalPlayer():HasActiveCombineMask() and client:GetNetVar("combineMaskEquipped") and client:GetNetVar("combineSuitName")) then
|
||||
return client:GetNetVar("combineSuitName")
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:PopulateCharacterInfo(client, character, tooltip)
|
||||
if (client:GetNetVar("combineSuitActive") and client:GetNetVar("combineSuitType") != 0) then
|
||||
local faction = ix.faction.Get(client:GetNetVar("combineSuitType"))
|
||||
if (!faction) then return end
|
||||
|
||||
local name = tooltip:GetRow("name")
|
||||
name:SetBackgroundColor(faction.color)
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:RenderScreenspaceEffects()
|
||||
if (LocalPlayer():HasActiveCombineMask()) then
|
||||
if (ix.option.Get("ColorModify", true)) then
|
||||
local colorModify = {}
|
||||
colorModify["$pp_colour_colour"] = 0.5 + ix.option.Get("ColorSaturation", 0)
|
||||
if (system.IsWindows()) then
|
||||
colorModify["$pp_colour_brightness"] = -0.02
|
||||
colorModify["$pp_colour_contrast"] = 1.2
|
||||
end
|
||||
DrawColorModify(colorModify)
|
||||
end
|
||||
|
||||
render.UpdateScreenEffectTexture()
|
||||
self.newOverlay:SetFloat("$alpha", ix.option.Get("CPGUIAlpha") / 100)
|
||||
self.newOverlay:SetInt("$ignorez", 1)
|
||||
render.SetMaterial(self.newOverlay)
|
||||
render.DrawScreenQuad()
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:IsPlayerRecognized(client)
|
||||
if ((LocalPlayer():HasActiveCombineMask() or LocalPlayer():IsDispatch()) and client:GetNetVar("combineSuitActive")) then
|
||||
return true
|
||||
end
|
||||
|
||||
if (LocalPlayer():IsDispatch() and (client:IsOTA() or client:IsCP() or client:IsDispatch())) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:InitializedPlugins()
|
||||
if (!IsValid(ix.gui.combine)) then
|
||||
vgui.Create("ixCombineDisplay")
|
||||
end
|
||||
|
||||
if (!IsValid(ix.gui.visor)) then
|
||||
vgui.Create("ixVisorScroller")
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:ChatTextChanged(text)
|
||||
local client = LocalPlayer()
|
||||
|
||||
if (!client:HasActiveCombineMask() or (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle())) then return end
|
||||
|
||||
local isTyping = text != ""
|
||||
|
||||
-- If it's starting with slash, it's a command
|
||||
if (text:utf8sub(1, 1) == COMMAND_PREFIX) then
|
||||
isTyping = false
|
||||
local start, _, commandTxt = text:find("/(%w+)%s")
|
||||
local command = ix.command.list[commandTxt]
|
||||
|
||||
-- If the command has the "combineBeep" property, we consider it as if the user is typing
|
||||
if (start == 1 and ((command and command.combineBeep) or validBeeps[commandTxt])) then
|
||||
isTyping = true
|
||||
end
|
||||
end
|
||||
|
||||
if (self.lastTypingState != isTyping) then
|
||||
self.lastTypingState = isTyping
|
||||
net.Start("ixTypingBeep")
|
||||
net.WriteBool(isTyping)
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:FinishChat()
|
||||
if (self.lastTypingState != false) then
|
||||
self.lastTypingState = false
|
||||
net.Start("ixTypingBeep")
|
||||
net.WriteBool(false)
|
||||
net.SendToServer()
|
||||
end
|
||||
end
|
||||
|
||||
local mat1 = CreateMaterial("GA0249aSFJ3","VertexLitGeneric",{
|
||||
["$basetexture"] = "models/debug/debugwhite",
|
||||
["$model"] = 1,
|
||||
["$translucent"] = 1,
|
||||
["$alpha"] = 1,
|
||||
["$nocull"] = 1,
|
||||
["$ignorez"] = 1
|
||||
})
|
||||
|
||||
function PLUGIN:HUDPaint()
|
||||
if (!ix.option.Get("CombineHud") or ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
local client = LocalPlayer()
|
||||
local isDispatch = client:IsDispatch()
|
||||
|
||||
if (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle() and !isDispatch) then return end
|
||||
if (!client:GetCharacter()) then return end
|
||||
|
||||
if (client:HasActiveCombineMask() or isDispatch) then
|
||||
local item = ix.item.instances[client:GetCharacter():GetCombineSuit()]
|
||||
|
||||
-- If the client it's dispatch then we don't care about the item at all
|
||||
-- the item must be a valid ota or cp suit
|
||||
if (!isDispatch and (!item or !item.isOTA and !item.isCP)) then return end
|
||||
|
||||
self.aimPoints = {}
|
||||
self.names = {}
|
||||
|
||||
cam.Start3D()
|
||||
local pos = client:EyePos()
|
||||
self.traceFilter[1] = client
|
||||
|
||||
for _ , p in ipairs(player.GetAll()) do
|
||||
if (p == client) then continue end
|
||||
if (!IsValid(p) or !p:Alive() or (p:GetMoveType() == MOVETYPE_NOCLIP and !p:InVehicle())) then continue end
|
||||
|
||||
local vEyePos = p:EyePos()
|
||||
local dist = vEyePos:DistToSqr(pos)
|
||||
local cAngle = client:GetAngles().y
|
||||
local pAngle = (p:GetPos() - client:GetPos()):Angle().y
|
||||
local angDiff = math.AngleDifference(cAngle, pAngle)
|
||||
local angCheck = 60
|
||||
|
||||
if (dist < self.maxDist and p:GetNetVar("combineSuitTracked") and client:IsLineOfSightClear(p:LocalToWorld(p:OBBCenter())) and math.abs(angDiff) <= angCheck) then
|
||||
local isOTA = p:GetNetVar("combineSuitType") == FACTION_OTA
|
||||
local isCP = p:GetNetVar("combineSuitType") == FACTION_CP
|
||||
|
||||
if (!isOTA and !isCP) then return end
|
||||
|
||||
local name = p:GetNetVar("combineSuitActive") and p:GetNetVar("combineSuitName") or "INCONNU"
|
||||
|
||||
if ((item and item.isOTA or isDispatch) and ix.option.Get("OTAESP")) then
|
||||
render.SuppressEngineLighting(true)
|
||||
render.SetColorModulation(isOTA and 255 or 0, 0, isCP and 255 or 0)
|
||||
|
||||
self.traceFilter[2] = p
|
||||
if (util.QuickTrace(pos, vEyePos - pos, self.traceFilter).Fraction < 0.95 or client:FlashlightIsOn()) then
|
||||
render.SetBlend(math.Remap(math.max(dist, self.minDist), self.minDist, self.maxDist, 1, 0))
|
||||
else
|
||||
render.SetBlend(math.Remap(math.max(dist, self.minDist), self.minDist, self.maxDist, 0.01, 0))
|
||||
end
|
||||
render.MaterialOverride(mat1)
|
||||
p:DrawModel()
|
||||
|
||||
render.MaterialOverride()
|
||||
render.SuppressEngineLighting(false)
|
||||
|
||||
if (isOTA and p:IsWepRaised()) then
|
||||
local trace2 = p:GetEyeTraceNoCursor()
|
||||
|
||||
local onScreen = trace2.HitPos:ToScreen()
|
||||
local x, y = onScreen.x, onScreen.y
|
||||
self.aimPoints[#self.aimPoints + 1] = {x, y, client:IsLineOfSightClear(trace2.HitPos), name}
|
||||
end
|
||||
end
|
||||
|
||||
self.names[#self.names + 1] = {p, isOTA, isCP, dist}
|
||||
end
|
||||
end
|
||||
cam.End3D()
|
||||
|
||||
self:RenderESPNames(item and item.isOTA or isDispatch)
|
||||
|
||||
if (item and item.isOTA or isDispatch) then
|
||||
self:RenderESPAimpoints()
|
||||
end
|
||||
end
|
||||
end
|
||||
120
gamemodes/darkrp/plugins/combinesuits/cl_plugin.lua
Normal file
120
gamemodes/darkrp/plugins/combinesuits/cl_plugin.lua
Normal file
@@ -0,0 +1,120 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local math = math
|
||||
local Vector = Vector
|
||||
local ix = ix
|
||||
local Color = Color
|
||||
local ipairs = ipairs
|
||||
local surface = surface
|
||||
local net = net
|
||||
local IsValid = IsValid
|
||||
local netstream = netstream
|
||||
local unpack = unpack
|
||||
|
||||
local red = Color(255, 0, 0, 255)
|
||||
local blue = Color(0, 125, 255, 255)
|
||||
|
||||
function PLUGIN:RenderESPNames(bIsOTA)
|
||||
local right = LocalPlayer():GetRight() * 25
|
||||
local scrW, scrH = ScrW(), ScrH()
|
||||
local marginX, marginY = scrH * .1, scrH * .1
|
||||
|
||||
for _, v in ipairs(self.names) do
|
||||
local ply, teamColor, distance = v[1], (v[2] and red) or (v[3] and blue), math.sqrt(v[4])
|
||||
local plyPos = ply:GetPos()
|
||||
|
||||
local min, max = ply:GetModelRenderBounds()
|
||||
min = min + plyPos + right
|
||||
max = max + plyPos + right
|
||||
|
||||
local barMin = Vector((min.x + max.x) / 2, (min.y + max.y) / 2, min.z):ToScreen()
|
||||
local barMax = Vector((min.x + max.x) / 2, (min.y + max.y) / 2, max.z):ToScreen()
|
||||
local eyePos = ply:EyePos():ToScreen()
|
||||
local rightS = math.min(math.max(barMin.x, barMax.x), eyePos.x + 150)
|
||||
|
||||
local barWidth = math.Remap(math.Clamp(distance, 500, 1000), 500, 1000, 120, 75)
|
||||
local barHeight = math.abs(barMax.y - barMin.y)
|
||||
local barX, barY = math.Clamp(rightS, marginX, scrW - marginX - barWidth), math.Clamp(barMin.y - barHeight + 18, marginY, scrH - marginY)
|
||||
|
||||
local alpha = math.Remap(math.Clamp(distance, 500, 1000), 500, 1000, 255, 0)
|
||||
|
||||
if (bIsOTA and v[2]) then
|
||||
local bArmor = ply:Armor() > 0
|
||||
surface.SetDrawColor(40, 40, 40, 200 * alpha / 255)
|
||||
surface.DrawRect(barX - 1, barY - 1, barWidth + 2, 5)
|
||||
if (bArmor) then surface.DrawRect(barX - 1, barY + 9, barWidth + 2, 5) end
|
||||
|
||||
surface.SetDrawColor(teamColor.r * 1.6, teamColor.g * 1.6, teamColor.b * 1.6, alpha)
|
||||
surface.DrawRect(barX, barY, barWidth * math.Clamp(ply:Health() / ply:GetMaxHealth(), 0, 1), 3)
|
||||
|
||||
if (bArmor) then
|
||||
extraHeight = 10
|
||||
surface.SetDrawColor(255, 255, 255, alpha)
|
||||
surface.DrawRect(barX, barY + 10, barWidth * math.Clamp(ply:Armor() / 50, 0, 1), 3)
|
||||
end
|
||||
end
|
||||
|
||||
surface.SetFont("ixGenericFont")
|
||||
local width, height = surface.GetTextSize(ply:Name())
|
||||
|
||||
surface.SetDrawColor(0, 0, 0, 175)
|
||||
surface.DrawRect(barX - 5, barY - 13 - height / 2, width + 10, height + 2)
|
||||
ix.util.DrawText(ply:Name(), barX, barY - 13, teamColor, TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, "ixGenericFont", 255)
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:RenderESPAimpoints()
|
||||
for _, v in ipairs(self.aimPoints) do
|
||||
local x, y = v[1], v[2]
|
||||
|
||||
surface.SetDrawColor(red)
|
||||
surface.DrawLine(x + 10, y, x - 10, y)
|
||||
surface.DrawLine(x, y + 10, x, y - 10)
|
||||
if (v[3]) then
|
||||
surface.DrawOutlinedRect(x - 5, y - 5, 11, 11)
|
||||
end
|
||||
|
||||
surface.SetFont("BudgetLabel")
|
||||
surface.SetTextColor(red)
|
||||
local width = surface.GetTextSize(v[4])
|
||||
surface.SetTextPos(x - width / 2, y + 17)
|
||||
surface.DrawText(v[4])
|
||||
end
|
||||
end
|
||||
|
||||
net.Receive("ixVisorNotify", function(len)
|
||||
if (IsValid(ix.gui.visor)) then
|
||||
ix.gui.visor:Open()
|
||||
end
|
||||
end)
|
||||
|
||||
netstream.Hook("CombineDisplayMessage", function(text, color, location, arguments, bObjective)
|
||||
if (!LocalPlayer():HasActiveCombineMask() and !LocalPlayer():IsDispatch()) then
|
||||
return
|
||||
end
|
||||
|
||||
local client = LocalPlayer()
|
||||
local character = client:GetCharacter()
|
||||
|
||||
if (IsValid(ix.gui.combine)) then
|
||||
ix.gui.combine:AddLine(text, color, location, unpack(arguments))
|
||||
end
|
||||
|
||||
if bObjective and character:IsCombine() then
|
||||
vgui.Create("ixObjectiveUpdate")
|
||||
end
|
||||
end)
|
||||
|
||||
netstream.Hook("ImportantCombineDisplayMessage", function(text, color, location, arguments)
|
||||
if (IsValid(ix.gui.combine)) then
|
||||
ix.gui.combine:AddImportantLine(text, color, location, unpack(arguments))
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,188 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
AccessorFunc(PANEL, "font", "Font", FORCE_STRING)
|
||||
AccessorFunc(PANEL, "maxLines", "MaxLines", FORCE_NUMBER)
|
||||
|
||||
function PANEL:Init()
|
||||
if (IsValid(ix.gui.combine)) then
|
||||
ix.gui.combine:Remove()
|
||||
end
|
||||
|
||||
self.lines = {}
|
||||
|
||||
self:SetMaxLines(10)
|
||||
self:SetFont("DebugFixedRadio")
|
||||
|
||||
self:SetPos(SScaleMin( 30 / 3 ), SScaleMin( 30 / 3 ))
|
||||
self:SetSize(ScrW(), self.maxLines * SScaleMin( 20 / 2 ))
|
||||
self:ParentToHUD()
|
||||
|
||||
ix.gui.combine = self
|
||||
end
|
||||
|
||||
-- Adds a line to the combine display. Set expireTime to 0 if it should never be removed.
|
||||
function PANEL:AddLine(text, color, location, ...)
|
||||
self:ExpireLines()
|
||||
|
||||
if (#self.lines >= self.maxLines) then
|
||||
for k, info in ipairs(self.lines) do
|
||||
if (info.expireTime != 0) then
|
||||
table.remove(self.lines, k)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- check for any phrases and replace the text
|
||||
if (text:utf8sub(1, 1) == "@") then
|
||||
text = L(text:utf8sub(2), ...)
|
||||
end
|
||||
|
||||
if (location) then
|
||||
text = text.." dans "..location
|
||||
end
|
||||
|
||||
table.insert(self.lines, {
|
||||
text = "<:: " .. text .. "...",
|
||||
color = color or color_white,
|
||||
expireTime = CurTime() + 30,
|
||||
character = 1,
|
||||
font = "ImportantDisplayMessage"
|
||||
})
|
||||
end
|
||||
|
||||
function PANEL:AddImportantLine(text, color, location, ...)
|
||||
self:ExpireLines()
|
||||
|
||||
if (#self.lines >= self.maxLines) then
|
||||
for k, info in ipairs(self.lines) do
|
||||
if (info.expireTime != 0) then
|
||||
table.remove(self.lines, k)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- check for any phrases and replace the text
|
||||
if (text:utf8sub(1, 1) == "@") then
|
||||
text = L(text:utf8sub(2), ...)
|
||||
end
|
||||
|
||||
if (location) then
|
||||
text = text.." dans "..string.upper(location)
|
||||
end
|
||||
|
||||
table.insert(self.lines, {
|
||||
text = "<:: " .. text .. "...",
|
||||
color = color or color_white,
|
||||
expireTime = CurTime() + 30,
|
||||
character = 1,
|
||||
important = true,
|
||||
font = "ImportantDisplayMessage"
|
||||
})
|
||||
|
||||
if (!LocalPlayer().HasActiveCombineMask or !LocalPlayer().IsDispatch) then return end
|
||||
|
||||
if (LocalPlayer():HasActiveCombineMask() or LocalPlayer():IsDispatch()) then
|
||||
surface.PlaySound("buttons/blip1.wav")
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:ExpireLines()
|
||||
local curTime = CurTime()
|
||||
for i = #self.lines, 1, -1 do
|
||||
if (self.lines[i].expireTime != 0 and curTime >= self.lines[i].expireTime) then
|
||||
table.remove(self.lines, i)
|
||||
continue
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
if (!IsValid(LocalPlayer())) then return end
|
||||
|
||||
if (LocalPlayer():HasActiveCombineMask() or LocalPlayer():IsDispatch()) then
|
||||
local x, y = self:GetPos()
|
||||
y = ix.bar.newTotalHeight or y
|
||||
if (ix.option.Get("HUDPosition") != "Top Left") then
|
||||
y = SScaleMin(10 / 3)
|
||||
end
|
||||
|
||||
self:SetPos(x, y)
|
||||
|
||||
self:ExpireLines()
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:Paint(width, height)
|
||||
if (!LocalPlayer():HasActiveCombineMask() and !LocalPlayer():IsDispatch()) then
|
||||
return
|
||||
end
|
||||
|
||||
local y = 0
|
||||
|
||||
surface.SetFont(self.font)
|
||||
|
||||
if (ix.plugin.list.combineutilities) then
|
||||
local teams = ix.plugin.list.combineutilities.teams
|
||||
for k, v in SortedPairs(teams) do
|
||||
if (table.IsEmpty(v.members)) then continue end
|
||||
surface.SetFont("ImportantDisplayMessage")
|
||||
surface.SetTextColor(color_white)
|
||||
surface.SetTextPos(0, y)
|
||||
local owner = v.owner
|
||||
local members = {}
|
||||
for _, v1 in pairs(v.members) do
|
||||
if (v1 == owner) then continue end
|
||||
if (!IsValid(v1)) then continue end
|
||||
members[#members + 1] = v1:GetName()
|
||||
end
|
||||
table.sort(members)
|
||||
|
||||
surface.DrawText(string.format("<:: PT-%d : %s%s; %s", k, IsValid(owner) and owner:GetName() or "no leader", IsValid(owner) and " (L)" or "", table.concat(members, ", ")))
|
||||
|
||||
local textHeight = draw.GetFontHeight("ImportantDisplayMessage")
|
||||
y = y + textHeight + 5
|
||||
end
|
||||
end
|
||||
|
||||
if (!ix.config.Get("suitsNoConnection")) then
|
||||
surface.SetFont("ImportantDisplayMessage")
|
||||
surface.SetTextColor(Schema.colors[GetNetVar("visorColor", "blue")] or color_white)
|
||||
surface.SetTextPos(0, y)
|
||||
surface.DrawText(string.upper("<:: CURRENT SOCIO-STATUS CODE: " .. GetNetVar("visorStatus", "blue")))
|
||||
|
||||
local textHeight = draw.GetFontHeight("ImportantDisplayMessage")
|
||||
y = y + textHeight + 5
|
||||
end
|
||||
|
||||
for _, info in ipairs(self.lines) do
|
||||
|
||||
if (info.character < info.text:utf8len()) then
|
||||
info.character = info.character + 1
|
||||
end
|
||||
|
||||
surface.SetFont(info.font)
|
||||
surface.SetTextColor(info.color)
|
||||
surface.SetTextPos(0, y)
|
||||
surface.DrawText(info.text:utf8sub(1, info.character))
|
||||
|
||||
local textHeight = draw.GetFontHeight(info.font)
|
||||
y = y + textHeight + 5
|
||||
end
|
||||
|
||||
surface.SetDrawColor(Color(0, 0, 0, 255))
|
||||
end
|
||||
|
||||
vgui.Register("ixCombineDisplay", PANEL, "Panel")
|
||||
156
gamemodes/darkrp/plugins/combinesuits/derma/cl_visorscroller.lua
Normal file
156
gamemodes/darkrp/plugins/combinesuits/derma/cl_visorscroller.lua
Normal file
@@ -0,0 +1,156 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
surface.CreateFont("VisorScrolling", {
|
||||
font = "Tahoma",
|
||||
size = ScreenScale(24 / 3),
|
||||
weight = 0,
|
||||
antialias = true,
|
||||
})
|
||||
|
||||
local PANEL = {}
|
||||
|
||||
function PANEL:Init()
|
||||
self.scrollingmessage = "SOCIO-STABILITÉ INTACTE" -- Default Message
|
||||
self.scrollspeed = 150 -- Default Scrollspeed
|
||||
self.scrollingcolor = "blue" -- If Color Is Not Defined Fallback On This
|
||||
self.width = ScrW() * 0.1823 -- Width Of The Box
|
||||
self.open = false
|
||||
self.closed = true
|
||||
|
||||
self:SetTall(0)
|
||||
self:SetWidth(self.width)
|
||||
self:SetPos(ScrW() - self.width / 2 - 50 - self.width / 2, 50)
|
||||
|
||||
ix.gui.visor = self
|
||||
end
|
||||
|
||||
function PANEL:DrawScrollingText(w, h)
|
||||
local text = self.scrollingmessage.." /// " -- So The Message Appears Like So, EX: JUDGEMENT WAIVER /// JUDGEMENT WAIVER
|
||||
surface.SetFont("VisorScrolling") -- Set The Font
|
||||
|
||||
local textw, _ = surface.GetTextSize(text) -- Text Size From The Font
|
||||
surface.SetTextColor(Schema.colors[self.scrollingcolor]) -- Set The Color To The Variable
|
||||
|
||||
local x = RealTime() * self.scrollspeed % textw * -1 -- Magic
|
||||
while (x < w) do -- More Magic
|
||||
surface.SetTextPos(x, 8.5)
|
||||
surface.DrawText(text)
|
||||
x = x + textw
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:DrawCorners(x, y, w, h)
|
||||
local length = 12
|
||||
local thickness = 3
|
||||
|
||||
surface.DrawRect(x, y, length, thickness) -- Top Left
|
||||
surface.DrawRect(x, y, thickness, length)
|
||||
|
||||
surface.DrawRect(x + (w - length), y, length, thickness) -- Top Right
|
||||
surface.DrawRect(x + (w - thickness), y, thickness, length)
|
||||
|
||||
surface.DrawRect(x, y + (h - length), thickness, length) -- Bottom Left
|
||||
surface.DrawRect(x, y + (h - thickness), length, thickness)
|
||||
|
||||
surface.DrawRect(x + (w - thickness), y + (h - length), thickness, length) -- Bottom Right
|
||||
surface.DrawRect(x + (w - length), y + (h - thickness), length, thickness)
|
||||
end
|
||||
|
||||
function PANEL:Open()
|
||||
if (self.open) then return end
|
||||
|
||||
-- check if close animation finished
|
||||
if (!self.closed) then
|
||||
self.shouldReopen = true
|
||||
end
|
||||
|
||||
surface.PlaySound("ui/hint.wav")
|
||||
|
||||
self.open = CurTime() -- It's open so it's set to true.
|
||||
self.closed = false
|
||||
|
||||
surface.SetFont("VisorScrolling")
|
||||
local _, textH = surface.GetTextSize("000")
|
||||
local x, y = self:GetPos()
|
||||
|
||||
self:SetAlpha(255) -- Make Sure Its Visible
|
||||
self:SizeTo(-1, textH + 15.5, 0.3, 0) -- Animation
|
||||
self:MoveTo(x, (y - (textH / 2)), 0.3, 0)
|
||||
end
|
||||
|
||||
function PANEL:Close()
|
||||
if (!self.open) then return end
|
||||
self.open = false -- It's not open so it's set to false.
|
||||
|
||||
surface.SetFont("VisorScrolling") -- Get The Height/Width Of The Font So We Can Move It Accordingly
|
||||
local _, textH = surface.GetTextSize("000")
|
||||
local x, y = self:GetPos()
|
||||
|
||||
self:SizeTo(-1, 0, 0.3, 0, -1, function()
|
||||
self.closed = true
|
||||
if (self.shouldReopen) then
|
||||
self.shouldReopen = nil
|
||||
-- make sure to reopen with latest data
|
||||
self.scrollingcolor = GetNetVar("visorColor", "blue")
|
||||
self.scrollingmessage = GetNetVar("visorText", "SOCIO-STABILITÉ INTACTE")
|
||||
self:Open()
|
||||
end
|
||||
end) -- Animation
|
||||
self:MoveTo(x, (y + (textH / 2)), 0.3, 0)
|
||||
end
|
||||
|
||||
function PANEL:Think()
|
||||
if (!IsValid(LocalPlayer())) then return end
|
||||
|
||||
if (LocalPlayer():HasActiveCombineMask() or LocalPlayer():IsDispatch()) then
|
||||
-- Close if blue and open for more than 10 seconds
|
||||
if (self.open and (self.open < CurTime() - 10)) then
|
||||
self:Close()
|
||||
end
|
||||
|
||||
-- Check if text/colors needs to be updated
|
||||
if (self.scrollingcolor != GetNetVar("visorColor", "blue") or self.scrollingmessage != GetNetVar("visorText", "SOCIO-STABILITÉ INTACTE")) then
|
||||
-- If open for at least five seconds, close
|
||||
-- If fully closed, update and open
|
||||
if (self.open and (self.open < CurTime() - 5)) then
|
||||
self:Close()
|
||||
elseif (self.closed) then
|
||||
self.scrollingcolor = GetNetVar("visorColor", "blue")
|
||||
self.scrollingmessage = GetNetVar("visorText", "SOCIO-STABILITÉ INTACTE")
|
||||
self:Open()
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function PANEL:Paint(w, h)
|
||||
if (!LocalPlayer():HasActiveCombineMask() and !LocalPlayer():IsDispatch()) then
|
||||
return
|
||||
end
|
||||
|
||||
if (self.closed) then
|
||||
return
|
||||
end
|
||||
|
||||
local color = Schema.colors[self.scrollingcolor]
|
||||
surface.SetDrawColor(color.r, color.g, color.b, 25) -- Background
|
||||
surface.DrawRect(0, 0, w, h)
|
||||
|
||||
self:DrawScrollingText(self.width, h) -- Scrolling Text
|
||||
|
||||
surface.SetDrawColor(color) -- Corners
|
||||
self:DrawCorners(0, 0, w, h)
|
||||
end
|
||||
|
||||
vgui.Register("ixVisorScroller", PANEL, Panel)
|
||||
@@ -0,0 +1,436 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local surface = surface
|
||||
local derma = derma
|
||||
local string = string
|
||||
local hook = hook
|
||||
local math = math
|
||||
local table = table
|
||||
local ipairs = ipairs
|
||||
local IsValid = IsValid
|
||||
local ix = ix
|
||||
local CAMI = CAMI
|
||||
local Derma_StringRequest = Derma_StringRequest
|
||||
local net = net
|
||||
|
||||
|
||||
ITEM.base = "base_outfit"
|
||||
ITEM.name = "Combine Suit Base"
|
||||
ITEM.description = "A base for Combine Suit functionality"
|
||||
ITEM.category = "Combine"
|
||||
|
||||
ITEM.maxArmor = 60
|
||||
ITEM.repairItem = "tool_repair"
|
||||
|
||||
ITEM.isRadio = true
|
||||
|
||||
if (CLIENT) then
|
||||
function ITEM:PaintOver(item, w, h)
|
||||
if (item:GetData("equip")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawOutlinedRect(1, 1, w - 2, h - 2)
|
||||
end
|
||||
|
||||
if (item:GetData("suitActive")) then
|
||||
surface.SetDrawColor(110, 255, 110, 100)
|
||||
surface.DrawRect(w - 14, h - 14, 8, 8)
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:PopulateTooltip(tooltip)
|
||||
local panel = tooltip:AddRowAfter("name", "armor")
|
||||
panel:SetBackgroundColor(derma.GetColor("Warning", tooltip))
|
||||
panel:SetText("Armure : " .. (self:GetData("equip") and LocalPlayer():Armor() or self:GetData("armor", self.maxArmor)))
|
||||
panel:SizeToContents()
|
||||
|
||||
panel = tooltip:AddRowAfter("armor", "name")
|
||||
panel:SetBackgroundColor(derma.GetColor("info", tooltip))
|
||||
panel:SetText("Nom : " .. self:GetData("ownerName", "INCONNU"))
|
||||
panel:SizeToContents()
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:GetChannels(bForce)
|
||||
if ((bForce or self:GetData("suitActive") != false) and self.channels) then
|
||||
return self.channels
|
||||
else
|
||||
return {}
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:CanEquipOutfit(client)
|
||||
local player = self.player or client
|
||||
local suit = player:GetCharacter():GetCombineSuit()
|
||||
if (suit and ix.item.instances[suit] and ix.item.instances[suit] != self) then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function ITEM:OnGetReplacement(client)
|
||||
local player = self.player or client
|
||||
if (self.replacement) then
|
||||
return self.replacement
|
||||
elseif (self.replacementString) then
|
||||
local model = "models/"..self.replacementString..string.match(player:GetModel(), "/%a+_?%d%d%.mdl$")
|
||||
if (string.find(model, "/male%d%d")) then
|
||||
model = string.gsub(model, "/male[01]", {["/male0"] = "/male_0", ["/male_1"] = "/male_1"}, 1)
|
||||
end
|
||||
return model
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:OnEquipped(client)
|
||||
local character = client:GetCharacter()
|
||||
client:SetArmor(self:GetData("armor", self.maxArmor))
|
||||
character:SetCombineSuit(self:GetID())
|
||||
|
||||
if (!self:GetData("ownerID")) then
|
||||
self:SetData("ownerID", character:GetID())
|
||||
self:SetData("ownerName", client:Name())
|
||||
elseif (self:GetData("ownerID") == character:GetID()) then
|
||||
self:SetData("ownerName", client:Name())
|
||||
if (self:GetData("trackingActive")) then
|
||||
self:SetData("suitActive", true)
|
||||
end
|
||||
elseif (self:GetData("trackingActive")) then
|
||||
ix.combineNotify:AddImportantNotification("WRN:// " .. self:GetData("ownerName") .. " détection d'une anomalie bio-signal de l'uniforme", nil, client, client:GetPos(), nil)
|
||||
end
|
||||
|
||||
local hairBGIndex = client:FindBodygroupByName("hair")
|
||||
local hairData = character:GetHair()
|
||||
if hairBGIndex != -1 then
|
||||
local groups = character:GetData("groups", {})
|
||||
groups[hairBGIndex] = hairData.hair or 0
|
||||
character:SetData("groups", groups)
|
||||
|
||||
client:SetBodygroup(hairBGIndex, hairData.hair or 0)
|
||||
end
|
||||
|
||||
if client and IsValid(client) then
|
||||
local replacements = self:OnGetReplacement(client) or self.replacement or client:GetModel()
|
||||
local skin = self.newSkin or client:GetSkin()
|
||||
local bodygroups = client:GetBodyGroups()
|
||||
|
||||
net.Start("ixRefreshBodygroupsInventoryModel")
|
||||
net.WriteString(replacements)
|
||||
net.WriteUInt(skin, 5)
|
||||
net.WriteTable(bodygroups)
|
||||
net.Send(client)
|
||||
end
|
||||
|
||||
hook.Run("OnPlayerCombineSuitChange", client, true, self:GetData("suitActive"), self)
|
||||
end
|
||||
|
||||
function ITEM:OnUnequipped(client)
|
||||
self:SetData("armor", math.Clamp(client:Armor(), 0, self.maxArmor))
|
||||
client:SetArmor(0)
|
||||
client:GetCharacter():SetCombineSuit(0)
|
||||
|
||||
if client and IsValid(client) then
|
||||
local replacements = client:GetModel()
|
||||
local skin = client:GetSkin()
|
||||
local bodygroups = client:GetBodyGroups()
|
||||
|
||||
net.Start("ixRefreshBodygroupsInventoryModel")
|
||||
net.WriteString(replacements)
|
||||
net.WriteUInt(skin, 5)
|
||||
net.WriteTable(bodygroups)
|
||||
net.Send(client)
|
||||
|
||||
local hairBGIndex = client:FindBodygroupByName("hair")
|
||||
local character = client:GetCharacter()
|
||||
local hairData = character:GetHair()
|
||||
if hairBGIndex != -1 then
|
||||
local groups = character:GetData("groups", {})
|
||||
groups[hairBGIndex] = hairData.hair or 0
|
||||
character:SetData("groups", groups)
|
||||
|
||||
client:SetBodygroup(hairBGIndex, hairData.hair or 0)
|
||||
end
|
||||
end
|
||||
|
||||
hook.Run("OnPlayerCombineSuitChange", client, false, false, self)
|
||||
end
|
||||
|
||||
function ITEM:OnDoDeathDrop(client)
|
||||
self:SetData("suitActive", false)
|
||||
end
|
||||
|
||||
function ITEM:OnInstanced()
|
||||
self:SetData("armor", self.maxArmor)
|
||||
self:SetData("suitActive", true)
|
||||
self:SetData("trackingActive", true)
|
||||
self:SetData("ownerName", "INCONNU")
|
||||
self.bodyGroups = table.Copy(ix.item.list[self.uniqueID].bodyGroups or {})
|
||||
end
|
||||
|
||||
function ITEM:OnLoadout()
|
||||
if (!self:CanEquipOutfit()) then
|
||||
self:SetData("equip", false)
|
||||
elseif (self:GetData("equip")) then
|
||||
self.player:SetArmor(self:GetData("armor", self.maxArmor))
|
||||
self.player:GetCharacter():SetCombineSuit(self:GetID())
|
||||
|
||||
hook.Run("OnPlayerCombineSuitChange", self.player, true, self:GetData("suitActive"), self, true)
|
||||
end
|
||||
|
||||
self.bodyGroups = table.Copy(ix.item.list[self.uniqueID].bodyGroups or {})
|
||||
self.bodyGroups.Pants = self:GetData("Pants")
|
||||
end
|
||||
|
||||
function ITEM:OnSave()
|
||||
if (self:GetData("equip") and self.maxArmor) then
|
||||
local armor = math.Clamp(self.player:Armor(), 0, self.maxArmor)
|
||||
self:SetData("armor", armor)
|
||||
if (armor != self.player:Armor()) then
|
||||
self.player:SetArmor(armor)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:OnRemoved()
|
||||
self:SetData("suitActive", false)
|
||||
|
||||
local owner = self:GetOwner()
|
||||
if (owner) then
|
||||
for _, v in ipairs(self:GetChannels(true)) do
|
||||
ix.radio:RemoveListenerFromChannel(owner, v)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ITEM:Repair(client, amount)
|
||||
amount = amount or self.maxArmor
|
||||
local repairItem = client:GetCharacter():GetInventory():HasItem(self.repairItem)
|
||||
|
||||
if (repairItem) then
|
||||
if (repairItem.isTool) then
|
||||
repairItem:DamageDurability(1)
|
||||
else
|
||||
repairItem:Remove()
|
||||
end
|
||||
self:SetData("armor", math.Clamp(self:GetData("armor") + amount, 0, self.maxArmor))
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.functions.Repair = {
|
||||
name = "Réparer",
|
||||
tip = "repairTip",
|
||||
icon = "icon16/wrench.png",
|
||||
OnRun = function(item)
|
||||
item:Repair(item.player)
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity) or !IsValid(item.player)) then return false end
|
||||
if (item:GetData("equip") == true) then return false end
|
||||
if (item.repairItem == nil) then return false end
|
||||
if (item:GetData("armor") == item.maxArmor) then return false end
|
||||
|
||||
return item.player:GetCharacter():GetInventory():HasItem(item.repairItem)
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.AdmActivate = {
|
||||
name = "(ADM) Activer tenue",
|
||||
icon = "icon16/connect.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("suitActive", true)
|
||||
ix.log.Add(item.player, "combineSuitsAdminActivate", item)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("equip") == true) then return false end
|
||||
if (item:GetData("suitActive") == true) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.AdmActivateDe = {
|
||||
name = "(ADM) Désactiver Tenue",
|
||||
icon = "icon16/disconnect.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("suitActive", false)
|
||||
ix.log.Add(item.player, "combineSuitsAdminActivate", item, true)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("equip") == true) then return false end
|
||||
if (item:GetData("suitActive") != true) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.AdmTracker = {
|
||||
name = "(ADM) Activer Traqueur",
|
||||
icon = "icon16/map_add.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("trackingActive", true)
|
||||
ix.log.Add(item.player, "combineSuitsAdminTracking", item)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("equip") == true) then return false end
|
||||
if (item:GetData("trackingActive") == true) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.AdmTrackerDe = {
|
||||
name = "(ADM) Désactiver Traqueur",
|
||||
icon = "icon16/map_delete.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("trackingActive", false)
|
||||
ix.log.Add(item.player, "combineSuitsAdminTracking", item, true)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("equip") == true) then return false end
|
||||
if (item:GetData("trackingActive") != true) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.AdmOwnerDisable = {
|
||||
name = "(ADM) Désactiver Propriétaire",
|
||||
icon = "icon16/user_delete.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("ownerID", -1)
|
||||
ix.log.Add(item.player, "combineSuitsAdminOwner", item)
|
||||
|
||||
if (item:GetData("trackingActive")) then
|
||||
item.player:NotifyLocalized("suitDisableTracker")
|
||||
end
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("ownerID") == -1) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.AdmOwnerClear = {
|
||||
name = "(ADM) Nettoyer le propriétaire",
|
||||
icon = "icon16/user_edit.png",
|
||||
OnRun = function(item)
|
||||
item:SetData("ownerID")
|
||||
ix.log.Add(item.player, "combineSuitsAdminOwnerClear", item)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("ownerID") == nil) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
ITEM.functions.AdmSetName = {
|
||||
name = "(ADM) Mettre un nom",
|
||||
icon = "icon16/vcard_edit.png",
|
||||
OnRun = function(item, data)
|
||||
if (data[1] == "") then return end
|
||||
|
||||
item:SetData("ownerName", data[1])
|
||||
ix.log.Add(item.player, "combineSuitsAdminName", item)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnClick = function(item)
|
||||
Derma_StringRequest("Mettre un nom", "Mettre un nom pour cette tenue :", item:GetData("ownerName"), function(text)
|
||||
if (text == "") then return end
|
||||
|
||||
net.Start("ixInventoryAction")
|
||||
net.WriteString("AdmSetName")
|
||||
net.WriteUInt(item.id, 32)
|
||||
net.WriteUInt(item.invID, 32)
|
||||
net.WriteTable({text})
|
||||
net.SendToServer()
|
||||
end)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
if (IsValid(item.entity)) then return false end
|
||||
if (item:GetData("equip") == true) then return false end
|
||||
if (item:GetData("ownerID") == nil) then return false end
|
||||
|
||||
local client = item.player
|
||||
if (client:GetMoveType() != MOVETYPE_NOCLIP or client:InVehicle()) then return false end
|
||||
|
||||
local inventory = ix.item.inventories[item.invID]
|
||||
if (inventory and inventory.owner == item:GetData("ownerID")) then return false end
|
||||
|
||||
return CAMI.PlayerHasAccess(client, "Helix - Combine Suit Admin Control")
|
||||
end
|
||||
}
|
||||
|
||||
ITEM.functions.Pants = {
|
||||
name = "Changer bottes",
|
||||
tip = "repairTip",
|
||||
icon = "icon16/user_suit.png",
|
||||
OnRun = function(item)
|
||||
local originalItem = ix.item.list[item.uniqueID]
|
||||
local actual = originalItem.bodyGroups.Pants or 0
|
||||
if (item.bodyGroups.Pants != actual) then
|
||||
item.bodyGroups.Pants = actual
|
||||
item:SetData("Pants", actual)
|
||||
item.player:Notify("Bottes normales enfilées.")
|
||||
else
|
||||
item.bodyGroups.Pants = 1
|
||||
item:SetData("Pants", 1)
|
||||
item.player:Notify("Bottes de combat enfilées.")
|
||||
end
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
local client = item.player
|
||||
return item.isCP != nil and item:GetData("equip") == false and
|
||||
!IsValid(item.entity) and IsValid(client)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.base = "base_bgclothes"
|
||||
|
||||
ITEM.isGasmask = true
|
||||
ITEM.isCombineMask = true
|
||||
ITEM.isMask = true
|
||||
|
||||
ITEM.hooks.Equip = function(item, data)
|
||||
local character = item.player:GetCharacter()
|
||||
if (character and character:GetCombineSuit() == 0) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
ITEM.postHooks.Equip = function(item, client)
|
||||
local player = item.player or client
|
||||
hook.Run("OnPlayerCombineMaskChange", player, true, player:GetActiveCombineSuit())
|
||||
end
|
||||
|
||||
ITEM.postHooks.EquipUn = function(item, client)
|
||||
local player = item.player or client
|
||||
hook.Run("OnPlayerCombineMaskChange", player, false, player:GetActiveCombineSuit())
|
||||
end
|
||||
|
||||
function ITEM:OnLoadout()
|
||||
if (self:GetData("equip")) then
|
||||
local client = self.player
|
||||
timer.Simple(1, function()
|
||||
if (!IsValid(client)) then return end
|
||||
hook.Run("OnPlayerCombineMaskChange",client, true, client:GetActiveCombineSuit())
|
||||
end)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - APF"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui des APF."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/jq/hlvr/characters/combine/suppressor/combine_suppressor_hlvr_ragdoll.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,30 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme PC - Recrue"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme auxiliaire de la Protection Civile. Design similaire, mais sans les technologies intégrées."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacementString = "wn7new/metropolice"
|
||||
ITEM.model = "models/wn7new/metropolice/cpuniform.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isCP = true
|
||||
ITEM.maxArmor = 25
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Pants"] = 0,
|
||||
["cp_Body"] = 0
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_cpuniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "OTA Charger Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Combine issued OTA Charger uniform."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/wallhammer.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota-tac", "tac-3", "tac-4", "tac-5", "cmb", "cca", "mcp"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,33 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Medium Command Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Containing a modified version of the original Level-2 Kevlar vest comes a uniform designed for Rank Leaders and above. Better comfort and utility compared to the standardized design."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacementString = "wn7new/metropolice"
|
||||
ITEM.model = "models/wn7new/metropolice/cpuniform.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isCP = true
|
||||
ITEM.maxArmor = 75
|
||||
|
||||
ITEM.channels = {"cmb", "tac-3", "tac-4", "tac-5"}
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Pants"] = 0,
|
||||
["cp_Body"] = 16
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_cpuniform"
|
||||
ITEM.energyConsumptionRate = 0.002 -- fatigue_system
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - COMMANDER"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui des COMMANDER, grade le plus élevé dans la hiérarchie."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ota_shotgunner.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 200
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,32 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme PC - Terrain"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme de la Protection Civile, porté par les unités possédant le grade i5 et plus."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacementString = "wn7new/metropolice"
|
||||
ITEM.model = "models/wn7new/metropolice/cpuniform.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isCP = true
|
||||
|
||||
ITEM.channels = {"pc", "tac-3"}
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Pants"] = 0,
|
||||
["cp_Body"] = 2
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_cpuniform"
|
||||
ITEM.energyConsumptionRate = 0.001 -- fatigue_system
|
||||
@@ -0,0 +1,32 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Light Command Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "A nicer set of the original Functionary uniform designed for those fitting of the rank 'Intention 2' and above."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacementString = "wn7new/metropolice"
|
||||
ITEM.model = "models/wn7new/metropolice/cpuniform.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isCP = true
|
||||
|
||||
ITEM.channels = {"cmb", "tac-3", "tac-4"}
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Pants"] = 0,
|
||||
["cp_Body"] = 2
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_cpuniform"
|
||||
ITEM.energyConsumptionRate = 0.001 -- fatigue_system
|
||||
@@ -0,0 +1,33 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Riot Functionary Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "A nice and clean uniform set designed for use by the Civil Protection. Containing a Level-3 Kevlar Vest, Insulated Olive Trousers, a Dual-Steel Utility Belt and Steel-Capped Military Boots."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacementString = "wn7new/metropolice"
|
||||
ITEM.model = "models/wn7new/metropolice/cpuniform.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isCP = true
|
||||
ITEM.maxArmor = 75
|
||||
|
||||
ITEM.channels = {"cmb", "tac-3"}
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Pants"] = 0,
|
||||
["cp_Body"] = 2
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_cpuniform"
|
||||
ITEM.energyConsumptionRate = 0.002 -- fatigue_system
|
||||
@@ -0,0 +1,30 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - ECHO"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui des ECHO (ECHO ONE) est le premier grade dans la hiérarchie de la Force transhumaine."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/jq/hlvr/characters/combine/grunt/combine_grunt_hlvr_ragdoll.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 100
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Gastank"] = 3,
|
||||
["Grenade 1"] = 1
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - ELITE"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui de la division ELITE, chargée d'escorter les personnalités importantes de la Cité ou déployer lors d'opérations spéciales."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ota_elite.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "OTA Elite Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Combine issued OTA Elite uniform."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ota_elite.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 150
|
||||
ITEM.channels = {"ota-tac", "tac-3", "tac-4", "tac-5", "cmb", "cca", "mcp"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme de décontamination"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Uniforme de décontamination conçu par le cartel."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/willardnetworks/combine/antibody.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 100
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,33 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "CP Captain Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Combine issued Civil Protection uniform made for Captains."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacementString = "wn7new/metropolice"
|
||||
ITEM.model = "models/wn7new/metropolice/cpuniform.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isCP = true
|
||||
ITEM.maxArmor = 75
|
||||
|
||||
ITEM.channels = {"cmb", "tac-3", "tac-4", "tac-5"}
|
||||
|
||||
ITEM.bodyGroups = {
|
||||
["Pants"] = 0,
|
||||
["Base"] = 1,
|
||||
["cp_Body"] = 16
|
||||
}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_cpuniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - ORD"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui des ORD (ORDINAL) est le commandant d'escouade."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ordinal.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - OWS"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui des OWS (OverWatch Soldiers), il s'agit d'un soldat déployer lors d'opération spéciales."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ota_soldier.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,26 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - STG"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui de la division STG (Fusil à pompe / Shotgunner), chargée du maniement des fusils à pompes lors des différentes opérations dans la Cité."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ota_skylegion.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 100
|
||||
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - RECON"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA , correspondant à celui des RECON, est une unité de reconnaisance et équipé d'un sniper"
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/nemez/combine_soldiers/combine_soldier_recon_h.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,26 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Summit 24 Elite Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "A specialized version of the Elite Uniform designed for Summit 24"
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/ota_elite_summit.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 150
|
||||
|
||||
ITEM.channels = {"ota-tac", "tac-3", "tac-4", "tac-5", "cmb", "cca", "mcp"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,26 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - Spikewall"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à celui des Spikewall, il s'agit d'un soldat déployer lors d'opération spéciales."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/theparrygod/transition_shotgunner.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.skin = 1
|
||||
ITEM.maxArmor = 200
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "OTA Suppressor Uniform"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Combine issued OTA Suppressor uniform."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/suppressor.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota-tac", "tac-3", "tac-4", "tac-5", "cmb", "cca", "mcp"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,25 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Uniforme OTA - Valkirie"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA, correspondant à l'unité Valkirie."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.replacement = "models/wn/soldier.mdl"
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-1.96, 13.01, 199.57),
|
||||
ang = Angle(84.7, 279.39, 0),
|
||||
fov = 4.8
|
||||
}
|
||||
ITEM.isOTA = true
|
||||
ITEM.maxArmor = 125
|
||||
ITEM.channels = {"ota", "tac-3", "tac-4", "tac-5", "pc", "haa", "ac", "bc"}
|
||||
|
||||
ITEM.replaceOnDeath = "broken_otauniform"
|
||||
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Masque à gaz PMG-5"
|
||||
ITEM.description = "Offre une protection adéquate contre les fumées et les gaz nocifs, ainsi que certaines odeurs nauséabondes. Il lui manque beaucoup de technologies que les masques PC standard possèdent."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.model = "models/wn7new/metropolice/n7_cp_gasmask1.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-6.26, 381.14, 189.04),
|
||||
ang = Angle(26.03, 270.95, 0),
|
||||
fov = 1.91
|
||||
}
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.outfitCategory = "Head"
|
||||
ITEM.bodyGroups = {
|
||||
["cp_Head"] = 1 -- The actual name of the bodypart, then number in that bodypart (model-wise)
|
||||
}
|
||||
|
||||
ITEM.isGasmask = true
|
||||
ITEM.isCombineMask = false
|
||||
ITEM.energyConsumptionRate = 0.001 -- fatigue_system
|
||||
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Masque à gaz PMG-5 (AUG) avancé"
|
||||
ITEM.description = "Tout comme le masque original, mais avec des visuels améliorés, une meilleure connexion à OCIN et un réglage amélioré pour les communications."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.model = "models/wn7new/metropolice/n7_cp_gasmask1.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-6.26, 381.14, 189.04),
|
||||
ang = Angle(26.03, 270.95, 0),
|
||||
fov = 1.91
|
||||
}
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.outfitCategory = "Head"
|
||||
ITEM.bodyGroups = {
|
||||
["cp_Head"] = 3 -- The actual name of the bodypart, then number in that bodypart (model-wise)
|
||||
}
|
||||
|
||||
ITEM.isGasmask = true
|
||||
ITEM.isCombineMask = true
|
||||
ITEM.energyConsumptionRate = 0.001 -- fatigue_system
|
||||
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Masque à gaz PMG-5 (AUG)"
|
||||
ITEM.description = "Offre une protection adéquate contre les vapeurs nocives, les gaz et certains mauvaises odeurs avec une oreillettes intégré pour la communication."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.model = "models/wn7new/metropolice/n7_cp_gasmask1.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-6.26, 381.14, 189.04),
|
||||
ang = Angle(26.03, 270.95, 0),
|
||||
fov = 1.91
|
||||
}
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.outfitCategory = "Head"
|
||||
ITEM.bodyGroups = {
|
||||
["cp_Head"] = 1 -- The actual name of the bodypart, then number in that bodypart (model-wise)
|
||||
}
|
||||
|
||||
ITEM.isGasmask = true
|
||||
ITEM.isCombineMask = true
|
||||
ITEM.energyConsumptionRate = 0.001 -- fatigue_system
|
||||
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Masque - Avancé"
|
||||
ITEM.description = "Un masque avancé du Cartel. Offre une protection accrue contre les fumées, les gaz nocifs et certaines odeurs nauséabondes."
|
||||
ITEM.category = "Combine"
|
||||
ITEM.model = "models/wn7new/metropolice/n7_cp_gasmask1.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.iconCam = {
|
||||
pos = Vector(-6.26, 381.14, 189.04),
|
||||
ang = Angle(26.03, 270.95, 0),
|
||||
fov = 1.91
|
||||
}
|
||||
ITEM.outfitCategory = "Head"
|
||||
ITEM.bodyGroups = {
|
||||
["cp_Head"] = 2 -- The actual name of the bodypart, then number in that bodypart (model-wise)
|
||||
}
|
||||
|
||||
ITEM.isGasmask = true
|
||||
ITEM.isCombineMask = true
|
||||
ITEM.isPPE = true
|
||||
|
||||
ITEM.colorAppendix = {["red"] = "Il est totalement interdit d'avoir ce masque sur vous. Si une unité découvre que vous portez ce masque, attendez-vous à de terribles conséquences."}
|
||||
@@ -0,0 +1,14 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Tenue PC - Déchirée"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme de la Protection Civile en lambeaux, vous ne pouvez pas le porter. Elle pourrait peut être récupéré en pièces détachées ? Elle ne servira certainement plus d'armure, elle est criblé de trous."
|
||||
ITEM.category = "Combine"
|
||||
@@ -0,0 +1,14 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
ITEM.name = "Tenue OTA - Déchirée"
|
||||
ITEM.model = Model("models/wn7new/metropolice/cpuniform.mdl")
|
||||
ITEM.description = "Un uniforme d'OTA en lambeaux, vous ne pouvez pas le porter. Elle pourrait peut être récupéré en pièces détachées ? Elle ne servira certainement plus d'armure, elle est criblé de trous."
|
||||
ITEM.category = "Combine"
|
||||
@@ -0,0 +1,75 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local Color = Color
|
||||
local isstring = isstring
|
||||
local netstream = netstream
|
||||
local player = player
|
||||
|
||||
|
||||
local ix = ix
|
||||
|
||||
ix.combineNotify = ix.combineNotify or {}
|
||||
|
||||
function ix.combineNotify:AddNotification(text, color, location, waypointPos, receivers, ...)
|
||||
if (ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
color = color or color_white
|
||||
|
||||
if (location and !isstring(location)) then
|
||||
location = location:GetLocation()
|
||||
end
|
||||
|
||||
if (waypointPos) then
|
||||
ix.waypoint.AddWaypoint(waypointPos, text, color, 30, nil, ...)
|
||||
end
|
||||
|
||||
netstream.Start(receivers or player.GetAll(), "CombineDisplayMessage", text, color, location, {...})
|
||||
end
|
||||
|
||||
function ix.combineNotify:AddObjectiveNotification(text, color, location, waypointPos, receivers, ...)
|
||||
if (ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
color = color or color_white
|
||||
|
||||
if (location and !isstring(location)) then
|
||||
location = location:GetLocation()
|
||||
end
|
||||
|
||||
if (waypointPos) then
|
||||
ix.waypoint.AddWaypoint(waypointPos, text, color, 30, nil, ...)
|
||||
end
|
||||
|
||||
netstream.Start(receivers or player.GetAll(), "CombineDisplayMessage", text, color, location, {...}, true)
|
||||
end
|
||||
|
||||
local color_red = Color(255, 0, 0, 255)
|
||||
|
||||
function ix.combineNotify:AddImportantNotification(text, color, target, waypointPos, receivers, ...)
|
||||
if (ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
color = color or color_red
|
||||
|
||||
local posActual
|
||||
if (target and target.IsPlayer and target:IsPlayer() and target.GetLocation) then
|
||||
local location = target:GetLocation()
|
||||
if (ix.area.stored[location]) then
|
||||
-- genius way of getting center
|
||||
posActual = LerpVector(0.5,
|
||||
ix.area.stored[location].startPosition, ix.area.stored[location].endPosition)
|
||||
end
|
||||
end
|
||||
|
||||
if (posActual) then
|
||||
ix.waypoint.AddWaypoint(posActual, text, color, 60, nil, ...)
|
||||
end
|
||||
|
||||
netstream.Start(receivers or player.GetAll(), "ImportantCombineDisplayMessage", text, color, location, {...})
|
||||
end
|
||||
27
gamemodes/darkrp/plugins/combinesuits/meta/sh_character.lua
Normal file
27
gamemodes/darkrp/plugins/combinesuits/meta/sh_character.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local characterMeta = ix.meta.character
|
||||
|
||||
function characterMeta:IsCombine()
|
||||
local faction = ix.faction.Get(self:GetFaction())
|
||||
local client = self:GetPlayer()
|
||||
|
||||
if (faction and faction.isCombineFaction) then
|
||||
return true
|
||||
else
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
|
||||
if (suit and (suit:GetData("ownerID") == self:GetID() or !suit:GetData("trackingActive"))) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
129
gamemodes/darkrp/plugins/combinesuits/meta/sh_player.lua
Normal file
129
gamemodes/darkrp/plugins/combinesuits/meta/sh_player.lua
Normal file
@@ -0,0 +1,129 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local FindMetaTable = FindMetaTable
|
||||
local string = string
|
||||
local ipairs = ipairs
|
||||
local ix = ix
|
||||
local PLUGIN = PLUGIN
|
||||
local Schema = Schema
|
||||
local pairs = pairs
|
||||
local playerMeta = FindMetaTable("Player")
|
||||
|
||||
function playerMeta:HasActiveCombineSuit()
|
||||
return self:GetActiveCombineSuit() != false
|
||||
end
|
||||
|
||||
function playerMeta:GetActiveCombineSuit()
|
||||
local character = self:GetCharacter()
|
||||
if (!character) then return false end
|
||||
|
||||
local item = ix.item.instances[character:GetCombineSuit()]
|
||||
if (item) then
|
||||
return item:GetData("suitActive") and item
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function playerMeta:HasActiveCombineMask()
|
||||
if (!self:HasActiveCombineSuit()) then return false end
|
||||
|
||||
local items = self:GetCharacter():GetInventory():GetItemsByBase("base_maskcp", true)
|
||||
for _, v in pairs(items) do
|
||||
if (v.isCombineMask and v:GetData("equip")) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function playerMeta:HasActiveTracker()
|
||||
local character = self:GetCharacter()
|
||||
if (!character) then return false end
|
||||
|
||||
local item = ix.item.instances[character:GetCombineSuit()]
|
||||
if (item) then
|
||||
if (item:GetData("trackingActive")) then return true end
|
||||
end
|
||||
end
|
||||
|
||||
function playerMeta:GetCombineTag()
|
||||
local name = self:IsDispatch() and self:Name()
|
||||
local suit = self:GetActiveCombineSuit()
|
||||
if (suit) then
|
||||
name = suit:GetData("ownerName")
|
||||
end
|
||||
|
||||
if (!name) then return self:Name() end
|
||||
if (string.find(name, "%a+%-%d+$")) then
|
||||
return string.match(name, "%a+%-%d+$")
|
||||
else
|
||||
return name
|
||||
end
|
||||
end
|
||||
|
||||
function playerMeta:GetCombineRank()
|
||||
local name = self:IsDispatch() and self:Name()
|
||||
local suit = self:GetActiveCombineSuit()
|
||||
if (suit) then
|
||||
name = suit:GetData("ownerName")
|
||||
end
|
||||
|
||||
if (!name) then return -1 end
|
||||
for k, v in ipairs(PLUGIN.ranks) do
|
||||
if (v and Schema:IsCombineRank(name, v)) then
|
||||
return k
|
||||
end
|
||||
end
|
||||
|
||||
return 0
|
||||
end
|
||||
|
||||
function playerMeta:IsCombineRankAbove(rank)
|
||||
for k, v in ipairs(PLUGIN.ranks) do
|
||||
if (v == rank) then
|
||||
return self:GetCombineRank() >= k
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function playerMeta:IsCombine()
|
||||
local faction = ix.faction.Get(self:Team())
|
||||
if (faction and faction.isCombineFaction) then
|
||||
return true
|
||||
else
|
||||
local suit = self:GetActiveCombineSuit()
|
||||
if (suit and (suit:GetData("ownerID") == self:GetCharacter():GetID() or !suit:GetData("trackingActive"))) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function playerMeta:IsCP()
|
||||
local faction = self:Team()
|
||||
return faction == FACTION_CP
|
||||
end
|
||||
|
||||
function playerMeta:IsOTA()
|
||||
local faction = self:Team()
|
||||
return faction == FACTION_OTA
|
||||
end
|
||||
|
||||
function playerMeta:IsDispatch()
|
||||
return self:Team() == FACTION_OVERWATCH
|
||||
end
|
||||
|
||||
function playerMeta:IsOverwatch()
|
||||
return self:Team() == FACTION_OVERWATCH and !Schema:IsCombineRank(self:Name(), "SCN") and !Schema:IsCombineRank(self:Name(), "SHIELD") and !Schema:IsCombineRank(self:Name(), "Disp:AI")
|
||||
end
|
||||
|
||||
function playerMeta:IsCombineScanner()
|
||||
return self:Team() == FACTION_OVERWATCH and (Schema:IsCombineRank(self:Name(), "SCN") or Schema:IsCombineRank(self:Name(), "SHIELD") or Schema:IsCombineRank(self:Name(), "Disp:AI"))
|
||||
end
|
||||
97
gamemodes/darkrp/plugins/combinesuits/sh_hooks.lua
Normal file
97
gamemodes/darkrp/plugins/combinesuits/sh_hooks.lua
Normal file
@@ -0,0 +1,97 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local ix = ix
|
||||
|
||||
|
||||
function PLUGIN:CanPlayerEquipItem(client, item)
|
||||
if (item.isCombineMask) then
|
||||
local character = client:GetCharacter()
|
||||
if (!character) then return false end
|
||||
|
||||
local suit = ix.item.instances[character:GetCombineSuit()]
|
||||
if (!suit) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CanPlayerUnequipItem(client, item)
|
||||
if (item == client:GetActiveCombineSuit() and client:HasActiveCombineMask()) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CanPlayerDropItem(client, item)
|
||||
if (item == client:GetActiveCombineSuit() and client:HasActiveCombineMask()) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:SetupAreaProperties()
|
||||
ix.area.AddProperty("nexus", ix.type.bool, false)
|
||||
end
|
||||
|
||||
-- A function to get whether a player has a flashlight.
|
||||
function PLUGIN:PlayerSwitchFlashlight(client, enabled)
|
||||
local character = client:GetCharacter()
|
||||
if (!character) then return false end
|
||||
|
||||
local item = ix.item.instances[character:GetCombineSuit()]
|
||||
if (item) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CanPlayerAddWaypoint(client)
|
||||
if (client:HasActiveCombineMask() or client:IsDispatch()) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CanPlayerUpdateWaypoints(client)
|
||||
if (client:IsDispatch()) then
|
||||
return true
|
||||
elseif (client:HasActiveCombineMask() and client:IsCombineRankAbove("RL")) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CanPlayerRemoveWaypoints(client)
|
||||
if (client:IsDispatch()) then
|
||||
return true
|
||||
elseif (client:HasActiveCombineMask() and client:IsCombineRankAbove("RL")) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CanPlayerSeeWaypoints(client)
|
||||
if (client:HasActiveCombineMask() or client:IsDispatch()) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:CheckCanTransferToEquipSlots(itemTable, oldInv, inventory)
|
||||
local client = itemTable.player or (oldInv and oldInv.GetOwner and oldInv:GetOwner()) or itemTable.GetOwner and itemTable:GetOwner()
|
||||
if client and IsValid(client) then
|
||||
if client:HasActiveCombineMask() and itemTable:GetData("suitActive") then
|
||||
return false, "Vous devez d'abord enlever votre masque !"
|
||||
end
|
||||
|
||||
if oldInv and oldInv.vars and oldInv.vars.equipSlots then
|
||||
local headApparel = oldInv:GetItemAt(1, 1)
|
||||
if headApparel and headApparel.base and headApparel.base == "base_maskcp" then
|
||||
if itemTable.base == "base_combinesuit" then
|
||||
return false, "Vous devez d'abord enlever votre masque !"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
313
gamemodes/darkrp/plugins/combinesuits/sh_plugin.lua
Normal file
313
gamemodes/darkrp/plugins/combinesuits/sh_plugin.lua
Normal file
@@ -0,0 +1,313 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
local ix = ix
|
||||
local CAMI = CAMI
|
||||
local player_manager = player_manager
|
||||
local LocalPlayer = LocalPlayer
|
||||
local bit = bit
|
||||
local string = string
|
||||
local SetNetVar = SetNetVar
|
||||
local net = net
|
||||
local pairs = pairs
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
PLUGIN.name = "Combine Suits"
|
||||
PLUGIN.author = "Gr4Ss"
|
||||
PLUGIN.description = "Adds combine suits and visual stuff."
|
||||
|
||||
ix.util.Include("meta/sh_player.lua")
|
||||
ix.util.Include("meta/sh_character.lua")
|
||||
ix.util.Include("cl_hooks.lua")
|
||||
ix.util.Include("cl_plugin.lua")
|
||||
ix.util.Include("sh_hooks.lua")
|
||||
ix.util.Include("sv_hooks.lua")
|
||||
ix.util.Include("sv_plugin.lua")
|
||||
|
||||
ix.char.RegisterVar("passiveSCProgress", {
|
||||
field = "passiveSCProgress",
|
||||
fieldType = ix.type.number,
|
||||
default = 0,
|
||||
bNoDisplay = true
|
||||
})
|
||||
|
||||
ix.config.Add("passiveStcTimer", 60, "How often, in minutes, CPs should receive STC. Set to 0 to disable.", nil, {
|
||||
data = {min = 0, max = 300}
|
||||
})
|
||||
|
||||
ix.config.Add("suitsNoConnection", false, "Disable some features on Combine suits that require connection to OCIN.", function(oldVal, newVal)
|
||||
if (!SERVER) then return end
|
||||
if (newVal) then
|
||||
SetNetVar("visorStatus", "OFFLINE")
|
||||
SetNetVar("visorColor", "red")
|
||||
SetNetVar("visorText", PLUGIN.visorStatus.offline[1])
|
||||
else
|
||||
SetNetVar("visorStatus", "blue")
|
||||
SetNetVar("visorColor", "blue")
|
||||
SetNetVar("visorText", PLUGIN.visorStatus.blue[1])
|
||||
end
|
||||
end, {
|
||||
category = "Miscellaneous"
|
||||
})
|
||||
|
||||
CAMI.RegisterPrivilege({
|
||||
Name = "Helix - Combine Suit Admin Control",
|
||||
MinAccess = "superadmin"
|
||||
})
|
||||
|
||||
ix.lang.AddTable("english", {
|
||||
optNewCPOverlayEnabled = "Activer overlay PC",
|
||||
optdNewCPOverlayEnabled = "Vous permet de choisir entre l'ancien overlay et le nouvel overlay PC",
|
||||
optCPGUIEnabled = "Activer l'interface graphique PC",
|
||||
optdCPGUIEnabled = "Vous permet d'activer ou de désactiver l'interface graphique PC (GUI)",
|
||||
optCPGUIAlpha = "CP GUI Alpha",
|
||||
optdCPGUIAlpha = "Définit l'alpha (transparence) du PC GUI",
|
||||
optChatterEnabled = "Activer le chat",
|
||||
optChatterInterval = "Intervalle de conversation",
|
||||
optdChatterEnabled = "Activer et désactiver l'émission de messages radio par votre personnage PC à un intervalle donné",
|
||||
optdChatterInterval = "Combien de fois votre personnage doit émettre des messages radio",
|
||||
optOTAESP = "OTA ESP Actif",
|
||||
optdOTAESP = "Activer ou désactiver le ESP OTA mettant en évidence les unités amies",
|
||||
unitOnDuty = "Unité %s en service",
|
||||
unitOffDuty = "Unité %s hors service",
|
||||
unitPromotedPTLead = "Unité %s promue à la tête de l'escouade E-%d",
|
||||
ptEnteredArea = "E-%d relocalisée dans le secteur '%s'",
|
||||
unitEnteredArea = "L'Unité %s entre dans le secteur '%s'",
|
||||
unitCompromised = "ATTENTION ! ANONYMAT DE L'UNITÉ %s COMPROMIS",
|
||||
nexus = "Nexus",
|
||||
suitBiosignalMistmach = "%s : biosignal de la tenue incorrect.",
|
||||
suitDeactivated = "%s : tenue désactivée",
|
||||
suitNoValidFound = "Aucune tenue trouvée à désactiver",
|
||||
suitDeactivateNotif = "TENUE DE L'UNITÉ %s DÉSACTIVÉE",
|
||||
suitDisableTracker = "Le traceur de cette tenue est toujours actif ! S'il n'est pas désactivé, les PC seront alertés chaque fois que cette tenue sera équipée",
|
||||
visorInvalidColor = "Cette couleur de visière n'est pas valide !",
|
||||
visorInvalidCode = "Ce n'est pas un code de visière valide !",
|
||||
optCombineHud = "Activer l'HUD Combine",
|
||||
optdCombineHud = "Activation ou non de l'HUD Combine"
|
||||
})
|
||||
|
||||
ix.lang.AddTable("spanish", {
|
||||
optNewCPOverlayEnabled = "Habilitar la nueva interfaz de PC",
|
||||
unitPromotedPTLead = "Unidad %s ascendida a líder de escuadron-%d",
|
||||
unitOnDuty = "Unidad %s de servicio",
|
||||
nexus = "Nexo",
|
||||
suitDeactivateNotif = "TRAJE DESACTIVADO PARA %s",
|
||||
suitDeactivated = "%s su traje está ahora desactivado.",
|
||||
suitNoValidFound = "No se ha encontrado ningún traje para desactivar.",
|
||||
optdNewCPOverlayEnabled = "Le permite elegir entre la interfaz de CPC clásica o la nueva interfaz de CPC de Willard Networks.",
|
||||
unitOffDuty = "Unidad %s fuera de servicio",
|
||||
unitCompromised = "¡ADVERTENCIA! UNIDAD %s ANONIMIDAD COMPROMETIDA",
|
||||
suitDisableTracker = "El rastreador de este traje sigue activo. Si no se desactiva, la CPC recibirá una alerta cada vez que se equipe este traje.",
|
||||
optCPGUIEnabled = "Habilitar la GUI de CPC",
|
||||
optdCPGUIEnabled = "Permite activar o desactivar la UI del CPC",
|
||||
optdChatterInterval = "Frecuencia con la que tu personaje emite sonidos de radio",
|
||||
suitBiosignalMistmach = "DISCORDANCIA EN LA BIOSEÑAL %s",
|
||||
optdChatterEnabled = "Activa o desactiva que tu Unidad de Protección Civil emita transmisiones de radio en un intervalo establecido",
|
||||
optVoiceToggle = "Alternar voz del juego",
|
||||
optdVoiceToggle = "Cambiar entre voces HL2 o HLA",
|
||||
optCPGUIAlpha = "Canal Alpha del IU de PC",
|
||||
optdOTAESP = "Activa o desactiva el ESP de la OTA destacando a las unidades aliadas",
|
||||
optOTAESP = "Activar ESP de la OTA",
|
||||
optdCPGUIAlpha = "Establece el canal Alfa (Transparencia) de la IU de PC.",
|
||||
ptEnteredArea = "EP-%d relocalizado al vector '%s'",
|
||||
optChatterInterval = "Intervalos de Charla",
|
||||
optChatterEnabled = "Activar Charla",
|
||||
unitEnteredArea = "Unidad %s entrando en el vector '%s'"
|
||||
})
|
||||
|
||||
-- Hand fixes by M!NT
|
||||
for i = 1, 9 do
|
||||
player_manager.AddValidModel("CPModel", "models/wn7new/metropolice/male_0"..i..".mdl")
|
||||
end
|
||||
for i = 1, 7 do
|
||||
player_manager.AddValidModel("CPModel", "models/wn7new/metropolice/female_0"..i..".mdl")
|
||||
end
|
||||
player_manager.AddValidModel("CPModel", "models/willardnetworks/combine/ordinal.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/willardnetworks/combine/soldier.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/willardnetworks/combine/suppressor.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/willardnetworks/combine/charger.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ota_commander.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ota_elite.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ota_elite_summit.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ota_shotgunner.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ota_soldier.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/combine_super_soldier.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ota_skylegion.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/wn/ordinal.mdl")
|
||||
player_manager.AddValidModel("CPModel", "models/willardnetworks/combine/antibody.mdl")
|
||||
|
||||
player_manager.AddValidHands("CPModel", "models/weapons/c_arms_combine.mdl", 0, "00000000")
|
||||
|
||||
PLUGIN.ranks = {
|
||||
[1] = "RCT",
|
||||
[2] = "i5",
|
||||
[3] = "i4",
|
||||
[4] = "i3",
|
||||
[5] = "i2",
|
||||
[6] = "i1",
|
||||
[7] = "RL",
|
||||
[8] = "CmD",
|
||||
[9] = "CmD",
|
||||
[10] = false,
|
||||
[11] = "OWS",
|
||||
[12] = "ORD",
|
||||
[13] = "EOW",
|
||||
[14] = false,
|
||||
[15] = "SCN",
|
||||
[16] = "Disp:AI",
|
||||
[17] = "OCIN:AI"
|
||||
}
|
||||
|
||||
PLUGIN.visorStatus = {
|
||||
blue = {"SOCIO-STABILITÉ INTACTE", "blue"},
|
||||
yellow = {"SOCIO-STABILITÉ MARGINALE", "yellow"},
|
||||
orange = {"SOCIO-STABILITÉ CRITIQUE", "orange"},
|
||||
unrest = {"SOCIO-STABILITÉ CRITIQUE. CODE SINISTRE EN VIGUEUR", "orange"},
|
||||
red = {"SOCIO-STABILITÉ CRITIQUE FRACTURÉE.", "red"},
|
||||
jw = {"SOCIO-STABILITÉ CRITIQUE FRACTURÉE. ABANDON DU JUGEMENT EN VIGUEUR", "red"},
|
||||
black = {"SOCIO-STABILITÉ PERDUE. CODE SACRIFIÉ EN VIGUEUR. REPRENEZ LE CONTRÔLE IMMÉDIATEMENT", "white"},
|
||||
ajw = {"SOCIO-STABILITÉ PERDUE. ABANDON DU JUGEMENT AUTONOME EN VIGUEUR", "white"},
|
||||
totalr = {"RESTITUTION TOTALE. EVACUER.", "white"},
|
||||
offline = {"ÉCHEC DE L'ÉTABLISSEMENT D'UNE CONNEXION SÉCURISÉE OCIN", "red"}
|
||||
}
|
||||
|
||||
ix.option.Add("CPGUIAlpha", ix.type.number, 60, {
|
||||
category = "Protection Civile",
|
||||
hidden = function()
|
||||
return !ix.faction.Get(LocalPlayer():Team()).isCombineFaction and !LocalPlayer():HasActiveCombineSuit()
|
||||
end,
|
||||
min = 0,
|
||||
max = 100
|
||||
})
|
||||
|
||||
ix.option.Add("OTAESP", ix.type.bool, true, {
|
||||
bNetworked = true,
|
||||
hidden = function()
|
||||
return !ix.faction.Get(LocalPlayer():Team()).isCombineFaction and !LocalPlayer():HasActiveCombineSuit()
|
||||
end,
|
||||
category = "Protection Civile"
|
||||
})
|
||||
|
||||
ix.option.Add("CombineHud", ix.type.bool, true, {
|
||||
bNetworked = true,
|
||||
hidden = function()
|
||||
return !ix.faction.Get(LocalPlayer():Team()).isCombineFaction and !LocalPlayer():HasActiveCombineSuit()
|
||||
end,
|
||||
category = "Protection Civile"
|
||||
})
|
||||
|
||||
ix.option.Add("ChatterEnabled", ix.type.bool, true, {
|
||||
bNetworked = true,
|
||||
hidden = function()
|
||||
return !ix.faction.Get(LocalPlayer():Team()).isCombineFaction and !LocalPlayer():HasActiveCombineSuit()
|
||||
end,
|
||||
category = "Protection Civile"
|
||||
})
|
||||
ix.option.Add("ChatterInterval", ix.type.number, 120, {
|
||||
bNetworked = true,
|
||||
hidden = function()
|
||||
return !ix.faction.Get(LocalPlayer():Team()).isCombineFaction and !LocalPlayer():HasActiveCombineSuit()
|
||||
end,
|
||||
category = "Protection Civile",
|
||||
min = 120,
|
||||
max = 600
|
||||
})
|
||||
ix.option.Add("VoiceToggle", ix.type.bool, true, {
|
||||
bNetworked = true,
|
||||
hidden = function()
|
||||
return !ix.faction.Get(LocalPlayer():Team()).isCombineFaction and !LocalPlayer():HasActiveCombineSuit()
|
||||
end,
|
||||
category = "civilprot"
|
||||
})
|
||||
|
||||
ix.char.RegisterVar("combineSuit", {
|
||||
default = 0,
|
||||
bNoDisplay = true,
|
||||
})
|
||||
|
||||
ix.command.Add("VisorStatus", {
|
||||
description = "Notify all combine factions\nPreset: <string Code (blue, yellow, orange, unrest, red, jw, black, totalr)>\nCustom: <string Color (blue, yellow, orange, red, black)> <string CustomText>.",
|
||||
arguments = {
|
||||
ix.type.string,
|
||||
bit.bor(ix.type.text, ix.type.optional)
|
||||
},
|
||||
OnCheckAccess = function(self, client)
|
||||
if (ix.config.Get("suitsNoConnection")) then return false end
|
||||
|
||||
return (client:HasActiveCombineSuit() and client:IsCombineRankAbove("i1") and client:GetActiveCombineSuit().isCP) or client:IsDispatch()
|
||||
end,
|
||||
OnRun = function(self, client, color, text)
|
||||
color = string.utf8lower(color)
|
||||
|
||||
if (text and text != "") then
|
||||
if (!Schema.colors[color]) then
|
||||
client:NotifyLocalized("visorInvalidColor", color)
|
||||
return
|
||||
end
|
||||
|
||||
ix.combineNotify:AddImportantNotification("WRN:// Socio-Statut mis à jour sur " .. string.utf8upper(text) .. " par " .. client:GetCombineTag(), Schema.colors[color])
|
||||
|
||||
SetNetVar("visorStatus", color)
|
||||
SetNetVar("visorColor", color)
|
||||
SetNetVar("visorText", string.utf8upper(text))
|
||||
else
|
||||
if (!PLUGIN.visorStatus[color]) then
|
||||
client:NotifyLocalized("visorInvalidCode", color)
|
||||
return
|
||||
end
|
||||
|
||||
ix.combineNotify:AddImportantNotification("WRN:// Socio-Statut mis à jour sur " .. string.utf8upper(color) .. " par " .. client:GetCombineTag(), Schema.colors[PLUGIN.visorStatus[color][2]])
|
||||
|
||||
SetNetVar("visorColor", PLUGIN.visorStatus[color][2])
|
||||
SetNetVar("visorText", PLUGIN.visorStatus[color][1])
|
||||
if color == "totalr" then
|
||||
color = "total rendition"
|
||||
elseif color == "jw" then
|
||||
color = "judgement waiver"
|
||||
end
|
||||
SetNetVar("visorStatus", color)
|
||||
end
|
||||
|
||||
if (color == "blue") then
|
||||
net.Start("ixVisorNotify")
|
||||
net.Broadcast()
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
ix.command.Add("SuitDeactivate", {
|
||||
description = "Remotely deactivates someone's Combine Suit.",
|
||||
arguments = {
|
||||
ix.type.character,
|
||||
},
|
||||
OnCheckAccess = function(self, client)
|
||||
return (client:HasActiveCombineSuit() and client:IsCombineRankAbove("RL") and client:GetActiveCombineSuit().isCP) or client:IsDispatch()
|
||||
end,
|
||||
OnRun = function(self, client, character)
|
||||
local items = character:GetInventory():GetItems()
|
||||
local found = false
|
||||
|
||||
for _, v in pairs(items) do
|
||||
if ((v.isCP or v.isOTA) and v:GetData("suitActive") and v:GetData("ownerID") == character:GetID()) then
|
||||
v:SetData("suitActive", false)
|
||||
found = v
|
||||
end
|
||||
end
|
||||
|
||||
if (found) then
|
||||
client:NotifyLocalized("suitDeactivated", found:GetData("ownerName"))
|
||||
ix.combineNotify:AddImportantNotification("WRN:// Tenue désactivée pour " .. found:GetData("ownerName", "INCONNU"), nil, found:GetData("trackingActive") and client, found:GetData("trackingActive") and client:GetPos(), nil)
|
||||
else
|
||||
client:NotifyLocalized("suitNoValidFound")
|
||||
end
|
||||
end
|
||||
})
|
||||
218
gamemodes/darkrp/plugins/combinesuits/sv_hooks.lua
Normal file
218
gamemodes/darkrp/plugins/combinesuits/sv_hooks.lua
Normal file
@@ -0,0 +1,218 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local GetNetVar = GetNetVar
|
||||
local SetNetVar = SetNetVar
|
||||
local CurTime = CurTime
|
||||
local Color = Color
|
||||
local table = table
|
||||
local ix = ix
|
||||
local net = net
|
||||
local math = math
|
||||
local ipairs = ipairs
|
||||
local player = player
|
||||
local timer = timer
|
||||
local IsValid = IsValid
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
local Schema = Schema
|
||||
|
||||
function PLUGIN:CharacterVarChanged(character, key, oldValue, value)
|
||||
if (key == "name") then
|
||||
local client = character:GetPlayer()
|
||||
if (!client) then return end
|
||||
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
if (suit and suit:GetData("ownerID") == character:GetID()) then
|
||||
suit:SetData("ownerName", value)
|
||||
if (client:GetNetVar("combineSuitName") == oldValue) then
|
||||
client:SetNetVar("combineSuitName", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:InitializedConfig()
|
||||
if (ix.config.Get("suitsNoConnection")) then
|
||||
SetNetVar("visorStatus", "OFFLINE")
|
||||
SetNetVar("visorColor", "red")
|
||||
SetNetVar("visorText", self.visorStatus.offline[1])
|
||||
else
|
||||
if (!GetNetVar("visorColor")) then
|
||||
SetNetVar("visorStatus", "blue")
|
||||
SetNetVar("visorColor", "blue")
|
||||
SetNetVar("visorText", self.visorStatus.blue[1])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:PlayerLoadout(client)
|
||||
client:SetNetVar("combineSuitActive", nil)
|
||||
client:SetNetVar("combineSuitName", nil)
|
||||
client:SetNetVar("combineMaskEquipped", nil)
|
||||
client:SetNetVar("combineSuitTracked", nil)
|
||||
client:SetNetVar("combineSuitType", 0)
|
||||
client:SetCanZoom(false)
|
||||
end
|
||||
|
||||
function PLUGIN:OnPlayerCombineSuitChange(client, bEquipped, bActive, suit, bLoadout)
|
||||
client:SetNetVar("combineSuitActive", bEquipped and bActive)
|
||||
local area = client:GetArea()
|
||||
|
||||
if (bEquipped) then
|
||||
client:SetNetVar("combineSuitName", suit:GetData("ownerName"))
|
||||
client:SetNetVar("combineSuitType", (suit.isOTA and FACTION_OTA) or (suit.isCP and FACTION_CP) or 0)
|
||||
client:SetNetVar("combineSuitTracked", suit:GetData("trackingActive", true))
|
||||
|
||||
if (!bActive) then return end
|
||||
|
||||
if (!bLoadout or (client.ixCharLoadedCPSuit and client.ixCharLoadedCPSuit + 5 < CurTime())) then
|
||||
client.ixCharLoadedCPSuit = nil
|
||||
ix.combineNotify:AddNotification("NTC:// Unité " .. client:GetCombineTag() .. " en ligne", Color(255, 100, 255, 255), suit:GetData("trackingActive") and client, nil, nil)
|
||||
end
|
||||
else
|
||||
client:SetNetVar("combineSuitType", 0)
|
||||
client:SetNetVar("combineSuitName", nil)
|
||||
client:SetNetVar("combineSuitTracked", nil)
|
||||
|
||||
if (!suit:GetData("suitActive")) then return end
|
||||
|
||||
if (suit:GetData("trackingActive") and (!client:IsInArea() or !ix.area.stored[area].properties.nexus)) then
|
||||
ix.combineNotify:AddImportantNotification("WRN:// Unité " .. suit:GetData("ownerName") .. " - anonymat compromis", nil, suit:GetData("trackingActive") and client, client:GetPos(), nil)
|
||||
else
|
||||
ix.combineNotify:AddNotification("NTC:// Unité " .. suit:GetData("ownerName") .. " hors-ligne", Color(255, 100, 255, 255), suit:GetData("trackingActive") and client, nil, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:OnPlayerCombineMaskChange(client, bEquipped, bActive)
|
||||
client:SetNetVar("combineMaskEquipped", bEquipped)
|
||||
client:SetCanZoom(bEquipped or ix.faction.Get(client:Team()).allowSuitZoom)
|
||||
|
||||
if (bEquipped and bActive and GetNetVar("visorColor", "blue") == "blue") then
|
||||
net.Start("ixVisorNotify")
|
||||
net.Send(client)
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:OnPlayerAreaChanged(client, newArea, id)
|
||||
if (!client:HasActiveTracker()) then return end
|
||||
if (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle()) then return end
|
||||
|
||||
if (client.ixAreaChangeCD and client.ixAreaChangeCD > CurTime()) then
|
||||
return
|
||||
end
|
||||
|
||||
local areaInfo = ix.area.stored[id]
|
||||
if (areaInfo.type != "area" or !areaInfo.properties.display) then
|
||||
return
|
||||
end
|
||||
|
||||
local cooldown = 20
|
||||
|
||||
if (client:GetNetVar("ProtectionTeamOwner")) then
|
||||
ix.combineNotify:AddNotification("LOG:// Escouade " .. client:GetNetVar("ProtectionTeam") .. " relocalisé à " .. id)
|
||||
elseif (!client:GetNetVar("ProtectionTeam")) then
|
||||
ix.combineNotify:AddNotification("LOG:// Unité " .. client:GetCombineTag() .. " relocalisé à " .. id)
|
||||
cooldown = 30
|
||||
end
|
||||
|
||||
client.ixAreaChangeCD = CurTime() + cooldown
|
||||
end
|
||||
|
||||
local cpRunSounds = {[0] = "NPC_MetroPolice.RunFootstepLeft", [1] = "NPC_MetroPolice.RunFootstepRight"}
|
||||
local otaRunSounds = {[0] = "NPC_CombineS.RunFootstepLeft", [1] = "NPC_CombineS.RunFootstepRight"}
|
||||
function PLUGIN:PlayerFootstep(client, position, foot, soundName, volume)
|
||||
if (!client:IsRunning()) then return end
|
||||
|
||||
local character = client:GetCharacter()
|
||||
if (!character) then return end
|
||||
|
||||
local item = ix.item.instances[character:GetCombineSuit()]
|
||||
if (item) then
|
||||
if (item.isCP) then
|
||||
client:EmitSound(cpRunSounds[foot])
|
||||
return true
|
||||
elseif (item.isOTA) then
|
||||
client:EmitSound(otaRunSounds[foot])
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:GetPlayerDeathSound(client)
|
||||
if (ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
local sound
|
||||
if (client:HasActiveCombineMask()) then
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
if (suit.isCP) then
|
||||
sound = "npc/metropolice/die"..math.random(1, 4)..".wav"
|
||||
elseif (suit.isOTA) then
|
||||
sound = "npc/combine_soldier/die"..math.random(1, 3)..".wav"
|
||||
end
|
||||
elseif (client:IsDispatch()) then
|
||||
if (Schema:IsCombineRank(client:Name(), "SCN")) then
|
||||
sound = "NPC_CScanner.Die"
|
||||
elseif (Schema:IsCombineRank(client:Name(), "SHIELD")) then
|
||||
sound = "NPC_SScanner.Die"
|
||||
end
|
||||
end
|
||||
|
||||
if (!sound) then return end
|
||||
|
||||
for _, v in ipairs( player.GetAll() ) do
|
||||
if (v == client) then continue end
|
||||
|
||||
if (v:HasActiveCombineMask() or v:IsCombineScanner()) then
|
||||
v:EmitSound(sound)
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function PLUGIN:GetPlayerPainSound(client)
|
||||
if (client:HasActiveCombineMask()) then
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
if (suit.isCP) then
|
||||
return "npc/metropolice/pain"..math.random(1, 4)..".wav"
|
||||
elseif (suit.isOTA) then
|
||||
return "npc/combine_soldier/pain"..math.random(1, 3)..".wav"
|
||||
end
|
||||
elseif (client:IsDispatch()) then
|
||||
if (Schema:IsCombineRank(client:Name(), "SCN")) then
|
||||
return "NPC_CScanner.Pain"
|
||||
elseif (Schema:IsCombineRank(client:Name(), "SHIELD") or Schema:IsCombineRank(client:Name(), "Disp:AI")) then
|
||||
return "NPC_SScanner.Pain"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PLUGIN:PlayerLoadedCharacter(client, character)
|
||||
client.ixCharLoadedCPSuit = CurTime()
|
||||
|
||||
local uniqueID = "ixChatter" .. client:SteamID64()
|
||||
client.ixSentenceReply = nil
|
||||
client.ixSentenceReplyInterval = nil
|
||||
|
||||
timer.Create(uniqueID, math.random(30, 60), 0, function()
|
||||
if (ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
if (!IsValid(client)) then
|
||||
timer.Remove(uniqueID)
|
||||
return
|
||||
end
|
||||
|
||||
PLUGIN:ClientChatter(client, uniqueID)
|
||||
end)
|
||||
|
||||
self:ResetSCTimer(client, character)
|
||||
end
|
||||
208
gamemodes/darkrp/plugins/combinesuits/sv_plugin.lua
Normal file
208
gamemodes/darkrp/plugins/combinesuits/sv_plugin.lua
Normal file
@@ -0,0 +1,208 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local util = util
|
||||
local ix = ix
|
||||
local string = string
|
||||
local timer = timer
|
||||
local GetNetVar = GetNetVar
|
||||
local unpack = unpack
|
||||
local math = math
|
||||
local EmitSentence = EmitSentence
|
||||
local SentenceDuration = SentenceDuration
|
||||
local net = net
|
||||
|
||||
|
||||
local PLUGIN = PLUGIN
|
||||
|
||||
util.AddNetworkString("ixTypingBeep")
|
||||
util.AddNetworkString("ixVisorNotify")
|
||||
|
||||
ix.log.AddType("combineSuitsAdminActivate", function(client, item, bDeactivate)
|
||||
return string.format("%s has admin-activated a '%s' (#%d)", client:GetName(), bDeactivate and "de" or "", item:GetName(), item:GetID())
|
||||
end)
|
||||
ix.log.AddType("combineSuitsAdminTracking", function(client, item, bDeactivate)
|
||||
return string.format("%s has admin-désactivated the tracker on a '%s' (#%d)", client:GetName(), bDeactivate and "de" or "", item:GetName(), item:GetID())
|
||||
end)
|
||||
ix.log.AddType("combineSuitsAdminOwner", function(client, item)
|
||||
return string.format("%s has admin-disabled the owner on a '%s' (#%d)", client:GetName(), item:GetName(), item:GetID())
|
||||
end)
|
||||
ix.log.AddType("combineSuitsAdminOwnerClear", function(client, item)
|
||||
return string.format("%s has admin-cleared the owner on a '%s' (#%d)", client:GetName(), item:GetName(), item:GetID())
|
||||
end)
|
||||
ix.log.AddType("combineSuitsAdminName", function(client, item)
|
||||
return string.format("%s has admin-changed the name a '%s' (#%d) to %s.", client:GetName(), item:GetName(), item:GetID(), item:GetData("ownerName"))
|
||||
end)
|
||||
|
||||
PLUGIN.voiceLines = {
|
||||
["METROPOLICE_IDLE"] = 7,
|
||||
["METROPOLICE_IDLE_CHECK"] = 3,
|
||||
["METROPOLICE_IDLE_CLEAR"] = 18,
|
||||
["METROPOLICE_IDLE_QUEST"] = 7,
|
||||
["METROPOLICE_IDLE_ANSWER"] = 6,
|
||||
["METROPOLICE_HEARD_SOMETHING"] = 3,
|
||||
["METROPOLICE_IDLE_CR"] = 18,
|
||||
["METROPOLICE_IDLE_CHECK_CR"] = 7,
|
||||
["METROPOLICE_IDLE_CLEAR_CR"] = 4,
|
||||
["METROPOLICE_IDLE_QUEST_CR"] = 6,
|
||||
["METROPOLICE_IDLE_ANSWER_CR"] = 6,
|
||||
["COMBINE_IDLE"] = 4,
|
||||
["COMBINE_CHECK"] = 2,
|
||||
["COMBINE_CLEAR"] = 6,
|
||||
["COMBINE_QUEST"] = 5,
|
||||
["COMBINE_ANSWER"] = 4,
|
||||
["COMBINE_ALERT"] = 9,
|
||||
}
|
||||
|
||||
PLUGIN.cpLines = {
|
||||
{"METROPOLICE_IDLE"},
|
||||
{"METROPOLICE_IDLE_CHECK", "METROPOLICE_IDLE_CLEAR"},
|
||||
{"METROPOLICE_IDLE_QUEST", "METROPOLICE_IDLE_ANSWER"},
|
||||
{"METROPOLICE_HEARD_SOMETHING", "METROPOLICE_IDLE_CLEAR", 2}
|
||||
}
|
||||
PLUGIN.cpLinesCR = {
|
||||
{"METROPOLICE_IDLE_CR"},
|
||||
{"METROPOLICE_IDLE_CHECK_CR", "METROPOLICE_IDLE_CLEAR_CR"},
|
||||
{"METROPOLICE_IDLE_QUEST_CR", "METROPOLICE_IDLE_ANSWER_CR"},
|
||||
{"METROPOLICE_HEARD_SOMETHING", "METROPOLICE_IDLE_CLEAR_CR", 2}
|
||||
}
|
||||
PLUGIN.otaLines = {
|
||||
{"COMBINE_IDLE"},
|
||||
{"COMBINE_CHECK", "COMBINE_CLEAR"},
|
||||
{"COMBINE_QUEST", "COMBINE_ANSWER"},
|
||||
{"COMBINE_ALERT"}
|
||||
}
|
||||
PLUGIN.otaLinesBlue = {
|
||||
{"COMBINE_CHECK", "COMBINE_CLEAR", false, 600},
|
||||
}
|
||||
|
||||
function PLUGIN:ClientChatter(client, uniqueID)
|
||||
local character = client:GetCharacter()
|
||||
if (!character) then return end
|
||||
|
||||
if (client:IsAFK() or
|
||||
(client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle()) or
|
||||
!client:Alive() or
|
||||
!ix.option.Get(client, "ChatterEnabled", true) or
|
||||
!client:HasActiveCombineMask()) then
|
||||
-- Reset a reply if one is still pending
|
||||
if (client.ixSentenceReply) then
|
||||
timer.Adjust(uniqueID, ix.option.Get(client, "ChatterInterval", 120))
|
||||
client.ixSentenceReply = nil
|
||||
client.ixSentenceReplyInterval = nil
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
if (client.ixSentenceReply) then
|
||||
self:EmitSentence(client, client.ixSentenceReply, nil, nil, client.ixSentenceReplyInterval)
|
||||
client.ixSentenceReply = nil
|
||||
return
|
||||
end
|
||||
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
local soundTable
|
||||
if (suit.isCP) then
|
||||
if (GetNetVar("visorColor", "blue") != "blue") then
|
||||
soundTable = self.cpLinesCR
|
||||
else
|
||||
soundTable = self.cpLines
|
||||
end
|
||||
elseif (suit.isOTA) then
|
||||
if (GetNetVar("visorColor", "blue") != "blue") then
|
||||
soundTable = self.otaLines
|
||||
else
|
||||
soundTable = self.otaLinesBlue
|
||||
end
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
self:EmitSentence(client, unpack(soundTable[math.random(#soundTable)]))
|
||||
end
|
||||
|
||||
function PLUGIN:EmitSentence(client, sentence, answer, delay, interval)
|
||||
if (self.voiceLines[sentence]) then
|
||||
sentence = sentence..math.random(0, self.voiceLines[sentence])
|
||||
end
|
||||
EmitSentence(sentence, client:GetPos(), client:EntIndex(), CHAN_AUTO, 1, 75, 0, 100)
|
||||
|
||||
if (answer) then
|
||||
client.ixSentenceReply = answer..math.random(0, self.voiceLines[answer])
|
||||
client.ixSentenceReplyInterval = interval or 30
|
||||
--luacheck: read globals SentenceDuration
|
||||
timer.Adjust("ixChatter"..client:SteamID64(), (delay or 0) + math.random(3, 5) + SentenceDuration(sentence))
|
||||
else
|
||||
interval = interval or ix.option.Get(client, "ChatterInterval", 120)
|
||||
timer.Adjust("ixChatter"..client:SteamID64(), math.random(interval, interval * 2))
|
||||
end
|
||||
end
|
||||
|
||||
net.Receive("ixTypingBeep", function(len, client)
|
||||
if (net.ReadBool() == false and client.bTypingBeep) then
|
||||
client.bTypingBeep = nil
|
||||
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
if (!suit or !client:HasActiveCombineMask() or (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle())) then return end
|
||||
|
||||
if (suit.isCP) then
|
||||
client:EmitSound("NPC_MetroPolice.Radio.Off")
|
||||
elseif (suit.isOTA) then
|
||||
client:EmitSound("voices/transhuman/radio/off"..math.random(1, 3)..".wav")
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (!client.bTypingBeep) then
|
||||
local suit = client:GetActiveCombineSuit()
|
||||
if (!suit or !client:HasActiveCombineMask() or (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle())) then return end
|
||||
|
||||
if (suit.isCP) then
|
||||
client:EmitSound("NPC_MetroPolice.Radio.On")
|
||||
client.bTypingBeep = true
|
||||
elseif (suit.isOTA) then
|
||||
client:EmitSound("voices/transhuman/radio/on"..math.random(1, 2)..".wav")
|
||||
client.bTypingBeep = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function PLUGIN:ResetSCTimer(client, character)
|
||||
local delay = ix.config.Get("passiveStcTimer", 60)
|
||||
|
||||
if (delay <= 0) then return end
|
||||
|
||||
local uniqueID = "ixPassiveSC" .. client:SteamID64()
|
||||
|
||||
timer.Create(uniqueID, 300, 0, function()
|
||||
if (ix.config.Get("suitsNoConnection")) then return end
|
||||
|
||||
if (!IsValid(client) or !client:GetCharacter()) then
|
||||
timer.Remove(uniqueID)
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if (!client:GetActiveCombineSuit() or !client:HasActiveCombineMask() or client:IsAFK()) then return end
|
||||
|
||||
local progress = character:GetPassiveSCProgress()
|
||||
|
||||
if (progress < delay - 5) then
|
||||
character:SetPassiveSCProgress(progress + 5)
|
||||
else
|
||||
character.vars.genericdata.socialCredits = character.vars.genericdata.socialCredits + 1
|
||||
character:Save()
|
||||
|
||||
character:SetPassiveSCProgress(0)
|
||||
self:ResetSCTimer(client, character)
|
||||
end
|
||||
end)
|
||||
end
|
||||
Reference in New Issue
Block a user