This commit is contained in:
lifestorm
2024-08-04 23:12:27 +03:00
parent 0e770b2b49
commit ba1fc01b16
7084 changed files with 2173495 additions and 14 deletions

View File

@@ -0,0 +1,176 @@
--[[
| 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 DATAFILEPLUGIN = ix.plugin.Get("combineutilities")
local PANEL = {}
local materialMainframe = ix.util.GetMaterial("willardnetworks/datafile/mainframe.png")
local materialGadgetlight = ix.util.GetMaterial("willardnetworks/datafile/gadgetlight.png")
function PANEL:Init()
self:SetSize(ScrW(), ScrH())
self:MakePopup()
Schema:AllowMessage(self)
local mainFrame = self:Add("EditablePanel")
mainFrame:SetSize(SScaleMin(645 / 3), SScaleMin(850 / 3))
mainFrame:Center()
mainFrame.Paint = function(this, with, height)
surface.SetDrawColor(color_white:Unpack())
surface.SetMaterial(materialMainframe)
surface.DrawTexturedRect(0, 0, with, height)
end
local close = self:Add("DButton")
close:SetSize(SScaleMin(107 / 3), SScaleMin(105 / 3))
close:SetPos(self:GetWide() * 0.5 + mainFrame:GetWide() * 0.5 - close:GetWide() * 0.6, self:GetTall() * 0.5 - mainFrame:GetTall() * 0.5 - close:GetTall() * 0.4)
close:SetText("")
close.Paint = function(this, with, height)
if (this:IsHovered()) then
surface.SetDrawColor(ColorAlpha(color_white, 50))
surface.SetMaterial(materialGadgetlight)
surface.DrawTexturedRect(0, 0, with, height)
end
end
close.DoClick = function()
surface.PlaySound("willardnetworks/datapad/close.wav")
self:Remove()
end
self.subFrame = self:Add("EditablePanel")
self.subFrame:SetSize(mainFrame:GetWide() * 0.8, mainFrame:GetTall() * 0.75)
self.subFrame:Center()
self.subFrame:SetTall(mainFrame:GetTall() * 0.8)
self.searchPanel = self.subFrame:Add("ixDatapadSearchProfiles")
self.searchPanel:Dock(TOP)
self.searchPanel:DockMargin(0, 0, 0, 0)
self.searchPanel:SetTall(150)
self.searchPanel.back:Remove()
self.searchPanel.topDivider:Remove()
self.searchPanel.name.OnEnter = function()
if (ix.config.Get("datafileNoConnection")) then
LocalPlayer():NotifyLocalized("Error: no connection!")
surface.PlaySound("hl1/fvox/buzz.wav")
self.searchPanel.noConnection2:SetVisible(true)
self.searchPanel:SetTall(250)
return
end
self.searchPanel:SetTall(150)
surface.PlaySound("willardnetworks/datapad/navigate.wav")
net.Start("ixDataFilePDA_CMU_RequestData")
net.WriteString(self.searchPanel.name:GetText())
net.SendToServer()
end
self.searchPanel.search.DoClick = function()
if (ix.config.Get("datafileNoConnection")) then
LocalPlayer():NotifyLocalized("Error: no connection!")
surface.PlaySound("hl1/fvox/buzz.wav")
self.searchPanel.noConnection2:SetVisible(true)
return
end
surface.PlaySound("willardnetworks/datapad/navigate.wav")
net.Start("ixDataFilePDA_CMU_RequestData")
net.WriteString(self.searchPanel.name:GetText())
net.SendToServer()
end
self.output = self.subFrame:Add("DPanel")
self.output:Dock(FILL)
self.output.Populate = function(this, data)
this:Clear()
if (!data or !istable(data) or table.IsEmpty(data)) then return end
local name = this:Add("EditablePanel")
if (!data.genericData.cohesionPoints) then
DATAFILEPLUGIN:CreateRow(name, "name", data.genericData.name, nil, true, false)
else
DATAFILEPLUGIN:CreateRow(name, "collar id", data.genericData.collarID, nil, true, false)
end
local cid = this:Add("EditablePanel")
DATAFILEPLUGIN:CreateRow(cid, "cid", data.genericData.cid, nil, false, false)
local socialCredits = this:Add("EditablePanel")
if (!data.genericData.cohesionPoints) then
DATAFILEPLUGIN:CreateRow(socialCredits, data.genericData.socialCredits and "społeczne kredyty", math.Clamp(tonumber(data.genericData.socialCredits), 0, 200), (isnumber(data.genericData.socialCreditsDate) and os.date("%d/%m/%Y", data.genericData.socialCreditsDate) or data.genericData.socialCredits), true, true)
else
DATAFILEPLUGIN:CreateRow(socialCredits, data.genericData.cohesionPoints and "punkty kohezji", math.Clamp(tonumber(data.genericData.cohesionPoints), 0, 200), (isnumber(data.genericData.cohesionPointsDate) and os.date("%d/%m/%Y", data.genericData.cohesionPointsDate) or data.genericData.cohesionPointsDate), true, true)
end
local geneticDescription = this:Add("EditablePanel")
DATAFILEPLUGIN:CreateRow(geneticDescription, "opis genetyczny", data.genericData.geneticDesc, nil, false, false)
local occupation = this:Add("EditablePanel")
DATAFILEPLUGIN:CreateRow(occupation, "occupation", string.Left(data.genericData.occupation, 38), data.genericData.occupationDate, true, true)
local designatedStatus = this:Add("EditablePanel")
DATAFILEPLUGIN:CreateRow(designatedStatus, "wyznaczony status", string.Left(data.genericData.designatedStatus, 38), data.genericData.designatedStatusDate, false, true)
designatedStatus:DockMargin(0, 0, 0, 15)
local records = this:Add("ixDatafileMedicalRecords")
records:Dock(TOP)
records:DockMargin(0, 0, 0, 0)
records:SetTall(this:GetTall() - name:GetTall() - cid:GetTall() - socialCredits:GetTall() - geneticDescription:GetTall() - occupation:GetTall() - designatedStatus:GetTall() - 15) -- I'm sorry, FILL didn't work. I don't know why.
records.back:Remove()
records.topDivider:Remove()
records.contentSubframe = this
records.medicalRecords = data.medicalRecords
records.genericData = data.genericData
records.cmuPDA = true
records.recordsFrame:SetTall(this:GetTall() - name:GetTall() - cid:GetTall() - socialCredits:GetTall() - geneticDescription:GetTall() - occupation:GetTall() - designatedStatus:GetTall() - 15 - SScaleMin(2 / 3) - SScaleMin(11 / 3) - 20)
records.OnSaveRecord = function()
timer.Simple(0.1, function()
net.Start("ixDataFilePDA_CMU_RequestData")
net.WriteString(self.searchPanel.name:GetText())
net.WriteBool(true)
net.SendToServer()
end)
end
records:Populate(data.medicalRecords)
end
self.output.Paint = nil
net.Receive("ixDataFilePDA_CMU_CheckData", function(_, client)
local length = net.ReadUInt(32)
local data = net.ReadData(length)
local uncompressed = util.Decompress(data)
if (!uncompressed) then return end
local output = util.JSONToTable(uncompressed)
self.output:Populate(output)
end)
end
vgui.Register("ixDatafilePDA_CMU", PANEL, "EditablePanel")
net.Receive("ixDataFilePDA_CMU_Open", function(length, client)
local character = LocalPlayer():GetCharacter()
if (LocalPlayer():Team() == FACTION_MEDICAL or character:IsVortigaunt() and character:GetBioticPDA() == "CMU" ) then
if IsValid(ix.gui.menu) then
ix.gui.menu:Remove()
end
surface.PlaySound("willardnetworks/datapad/open.wav")
vgui.Create("ixDatafilePDA_CMU")
end
end)

View File

@@ -0,0 +1,344 @@
--[[
| 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 = {}
local materialMainframe = ix.util.GetMaterial("willardnetworks/datafile/mainframe.png")
local materialGadgetlight = ix.util.GetMaterial("willardnetworks/datafile/gadgetlight.png")
local materialDataBackground = ix.util.GetMaterial("willardnetworks/datafile/buttonnoarrow.png")
local color_blueDark = Color(40, 88, 115, 75)
local color_blueLight = Color(41, 243, 229, 255)
local color_gray = Color(154, 169, 175, 255)
local font = "MenuFontNoClamp"
local dateFormat = "%d/%m/%Y"
local animationSpeed = {
[true] = 1,
[false] = 0.5
}
function PANEL:Init()
self:SetSize(ScrW(), ScrH())
self:MakePopup()
Schema:AllowMessage(self)
self.outputHeight = 0
self.dividerWide = 0
local mainFrame = self:Add("EditablePanel")
mainFrame:SetSize(SScaleMin(645 / 3), SScaleMin(850 / 3))
mainFrame:Center()
mainFrame.Paint = function(this, with, height)
surface.SetDrawColor(color_white:Unpack())
surface.SetMaterial(materialMainframe)
surface.DrawTexturedRect(0, 0, with, height)
end
local close = self:Add("DButton")
close:SetSize(SScaleMin(107 / 3), SScaleMin(105 / 3))
close:SetPos(self:GetWide() * 0.5 + mainFrame:GetWide() * 0.5 - close:GetWide() * 0.6, self:GetTall() * 0.5 - mainFrame:GetTall() * 0.5 - close:GetTall() * 0.4)
close:SetText("")
close.Paint = function(this, with, height)
if this:IsHovered() then
surface.SetDrawColor(ColorAlpha(color_white, 50))
surface.SetMaterial(materialGadgetlight)
surface.DrawTexturedRect(0, 0, with, height)
end
end
close.DoClick = function()
surface.PlaySound("willardnetworks/datapad/close.wav")
self:Remove()
end
local subFrame = self:Add("EditablePanel")
subFrame:SetSize(mainFrame:GetWide() * 0.8, mainFrame:GetTall() * 0.5)
subFrame:Center()
subFrame:SetPos(subFrame.x, subFrame.y - SScaleMin(105 / 3))
self.dataSearch = subFrame:Add("ixDatapadSearchProfiles")
self.dataSearch.sendData = function(this, text)
self:UpdateStatus(L"pdaDatafile_search", "Warning")
net.Start("ixDataFilePDA_CWU_RequestData")
net.WriteString(text)
net.SendToServer()
end
self.dataSearch:GetChildren()[1]:GetChildren()[3]:Clear()
self.dataSearch:GetChildren()[3]:GetChildren()[2].OnEnter = function(this)
if (ix.config.Get("datafileNoConnection")) then
LocalPlayer():NotifyLocalized("Error: no connection!")
surface.PlaySound("hl1/fvox/buzz.wav")
self.dataSearch.noConnection2:SetVisible(true)
return
end
if self.outputFrame.inProgress then return end
surface.PlaySound("willardnetworks/datapad/navigate.wav")
if self.outputFrame.isOpen then
self:UpdateStatus(L"pdaDatafile_search", "Warning")
return self:SetOutputDataHeight(0, false, function(isOpen)
self.dataSearch:sendData(this:GetValue())
end)
end
self.dataSearch:sendData(this:GetValue())
end
self.dividerLine = self.dataSearch:Add("DShape")
self.dividerLine:SetType( "Rect" )
self.dividerLine:SetSize(self.dividerWide, SScaleMin(1 / 3))
self.dividerLine:SetPos(0, self.dataSearch:GetTall() - self.dividerLine:GetTall())
self.dividerLine:SetColor(color_blueLight)
self.status = self.dataSearch:GetChildren()[1]:GetChildren()[3]:Add("DLabel")
self:UpdateStatus(L"pdaDatafile_waiting", "Info")
self:InvalidateLayout(true)
self.outputFrame = self:Add("EditablePanel")
self.outputFrame:SetSize(subFrame:GetWide(), self.outputHeight)
self.outputFrame:SetPos(subFrame.x, self.dataSearch:GetTall() + subFrame.y)
self.outputFrame.isOpen = false
self.outputFrame.inProgress = false
self.outputFrame.Paint = function(this, width, height)
surface.SetDrawColor(color_blueDark)
surface.DrawRect(0, 0, width, height)
end
self.outputScroll = self.outputFrame:Add("DScrollPanel")
self.outputScroll:Dock(FILL)
self.outputScroll:DockMargin(SScaleMin(2 / 3), SScaleMin(2 / 3), SScaleMin(2 / 3), SScaleMin(2 / 3))
self.outputScroll.alphaOffset = 0.125
net.Receive("ixDataFilePDA_CWU_CheckData", function(_, client)
local length = net.ReadUInt(32)
local data = net.ReadData(length)
local uncompressed = util.Decompress(data)
if (!uncompressed) then
return self:UpdateStatus("Unable to decompress data", "Error")
end
local output = util.JSONToTable(uncompressed)
self:UpdateStatus(output.status[1], output.status[2])
if output.id then
output.status = nil
self:SetOutputDataHeight(SScaleMin(48 / 3) * 8 + SScaleMin(20 / 3), true)
self.outputScroll:Clear()
self:OnGetData(output)
end
end)
end
local function AddAdditionalInfo(basePanel, title, subtitle)
local top = basePanel:Add("DLabel")
top:SetTextColor(color_gray)
top:SetFont(font)
top:SetText(title:utf8upper()..":")
top:SizeToContents()
top:SetPos(basePanel:GetWide() - top:GetWide() - SScaleMin(32 / 3), basePanel:GetTall() * 0.2 - top:GetTall() * 0.2)
local bottom = basePanel:Add("DLabel")
bottom:SetTextColor(color_blueLight)
bottom:SetFont(font)
bottom:SetText(subtitle:utf8upper())
bottom:SizeToContents()
bottom:SetPos(basePanel:GetWide() - bottom:GetWide() - SScaleMin(32 / 3), basePanel:GetTall() - bottom:GetTall() - SScaleMin(4 / 3))
end
local function addInfo(basePanel, title, subtitle, additionalTitle, additionalSubtitle)
subtitle, additionalSubtitle = tostring(subtitle), tostring(additionalSubtitle)
local plugin = ix.plugin.Get("combineutilities")
local panel = basePanel:Add("EditablePanel")
panel:SetSize(basePanel:GetWide(), SScaleMin(48 / 3))
panel:Dock(TOP)
panel:DockMargin(0, 1, 0, 1)
panel:SetAlpha(0)
panel:AlphaTo(255, 1, basePanel.alphaOffset)
plugin:CreateRow(panel, title, subtitle)
panel.Paint = function(this, width, height)
surface.SetDrawColor(ColorAlpha(color_white, 50))
surface.SetMaterial(materialDataBackground)
surface.DrawTexturedRect(0, 0, width, height)
end
if additionalTitle then
AddAdditionalInfo(panel, additionalTitle, additionalSubtitle)
end
basePanel.alphaOffset = basePanel.alphaOffset + 0.125
return panel
end
function PANEL:OnGetData(data)
self.outputScroll.alphaOffset = 0.125
local anticitizen = addInfo(self.outputScroll, L("pdaDatafile_data_anticitizen"), data.anticitizen, L("pdaDatafile_data_bol"), data.bol)
if data.anticitizen or data.bol then
local color = data.anticitizen and derma.GetColor("Error", anticitizen) or derma.GetColor("Warning", anticitizen)
local oldPaint = anticitizen.Paint
anticitizen.Paint = function(this, width, height)
surface.SetDrawColor(ColorAlpha(color, 69))
surface.DrawRect(0, 0, width, height)
oldPaint(this, width, height)
end
end
local permits = addInfo(self.outputScroll, L("pdaDatafile_data_permits"), "")
permits.oldHeight = permits:GetTall()
permits.newHeight = 0
local permitsButton = permits:Add("DButton")
permitsButton:SetTextColor(color_blueLight)
permitsButton:SetFont(font)
permitsButton:SetText(L("pdaDatafile_data_permits_buttonShow"):utf8upper())
permitsButton:SizeToContentsY()
permitsButton:SetWide(permits:GetWide() - SScaleMin(24 / 3))
permitsButton:SetPos(SScaleMin(4 / 3), permits:GetTall() - permitsButton:GetTall() - SScaleMin(4 / 3))
permitsButton.isOpen = false
permitsButton.inProgress = false
permitsButton._SetHeight = function(this, height)
this.inProgress = true
permits:CreateAnimation(animationSpeed[this.isOpen], {
index = 0,
target = { newHeight = height },
easing = "outQuint",
Think = function(animation, panel)
panel:SetTall(panel.newHeight)
end,
OnComplete = function(animation, panel)
permitsButton.inProgress = false
end
})
end
local permitsPanel = permits:Add("EditablePanel")
permitsPanel:SetWide(permits:GetWide())
permitsPanel:SetTall(0)
permitsPanel:SetPos(0, permitsButton.y + permitsButton:GetTall())
local y = SScaleMin(8 / 3)
for k, _ in pairs(ix.permits.list) do
if data.permits[k] then
local left = permitsPanel:Add("DLabel")
left:SetTextColor(color_gray)
left:SetFont(font)
left:SetText(k:utf8upper())
left:SizeToContents()
left:SetPos(SScaleMin(20 / 3), y)
local right = permitsPanel:Add("DLabel")
right:SetTextColor(color_blueLight)
right:SetFont(font)
right:SetText(isbool(data.permits[k]) and L("pdaDatafile_data_permitsUnlimited"):utf8upper() or os.date(dateFormat, data.permits[k]))
right:SizeToContents()
right:SetPos(permitsPanel:GetWide() - right:GetWide() - SScaleMin(32 / 3), y)
y = y + left:GetTall() + SScaleMin(8 / 3)
end
end
permitsPanel:SetTall(y)
permitsButton.permitsTall = permits.oldHeight + y
permitsButton.DoClick = function(this, width, height)
if this.inProgress then return end
surface.PlaySound("willardnetworks/datapad/navigate2.wav")
this.isOpen = !this.isOpen
local translate = this.isOpen and "pdaDatafile_data_permits_buttonHide" or "pdaDatafile_data_permits_buttonShow"
this:SetText(L(translate):utf8upper())
this:_SetHeight(this.isOpen and this.permitsTall or permits.oldHeight)
end
permitsButton.Paint = function(this, width, height)
local alpha = this:IsHovered() and 125 or 69
surface.SetDrawColor(ColorAlpha(color_white, alpha))
surface.SetMaterial(materialDataBackground)
surface.DrawTexturedRect(0, 0, width, height)
end
end
function PANEL:UpdateStatus(text, color)
if color == "Error" then
surface.PlaySound("willardnetworks/datapad/deny.wav")
end
self.status:SetFont(font)
self.status:SetTextColor(derma.GetColor(color, self.status))
self.status:SetText(text:utf8upper())
self.status:SizeToContents()
self.status:Dock(RIGHT)
self.status:DockMargin(0, 0, SScaleMin(4 / 4), SScaleMin(6 / 3))
end
function PANEL:SetOutputDataHeight(height, boolean, callback)
local dataSearchWide = self.dataSearch:GetWide()
self.outputFrame.inProgress = true
self:CreateAnimation(animationSpeed[boolean], {
index = -1,
target = { outputHeight = height, dividerWide = boolean and dataSearchWide or 0 },
easing = "outQuint",
Think = function(animation, panel)
panel.outputFrame:SetTall(panel.outputHeight)
panel.dividerLine:SetWide(panel.dividerWide)
end,
OnComplete = function(animation, panel)
panel.outputFrame.isOpen = boolean
panel.outputFrame.inProgress = false
if callback then
callback(boolean)
end
end
})
end
vgui.Register("ixDatafilePDA_CWU", PANEL, "EditablePanel")
net.Receive("ixDataFilePDA_CWU_Open", function(length, client)
local character = LocalPlayer():GetCharacter()
if LocalPlayer():Team() == FACTION_WORKERS or character:IsVortigaunt() and character:GetBioticPDA() == "CWU" then
if IsValid(ix.gui.menu) then
ix.gui.menu:Remove()
end
surface.PlaySound("willardnetworks/datapad/open.wav")
vgui.Create("ixDatafilePDA_CWU")
end
end)

View File

@@ -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/
--]]
AddCSLuaFile()
--[[-------------------------------------------------------------------------
TODO: PLAY ANIMATION WHEN DEPLOYING SUPPORT
---------------------------------------------------------------------------]]
ENT.Base = "base_entity"
ENT.Type = "anim"
ENT.PrintName = "Broke (Electricity)"
ENT.Category = "Helix"
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_BOTH
if SERVER then
function ENT:Initialize()
self:SetModel("models/hunter/blocks/cube025x025x025.mdl")
self:SetSolid(SOLID_VPHYSICS)
self:SetNoDraw(true)
self:SetUseType(SIMPLE_USE)
self.health = 200
self:SetNetVar("destroyed", true)
end
function ENT:Think()
local curTime = CurTime()
if self:GetNetVar("destroyed", false) == true then
if !self.nextSpark or self.nextSpark <= curTime then
if (!IsValid(self.spark)) then
self.spark = ents.Create("env_spark")
end
self.spark:SetPos(self:GetPos() + Vector(0, 10, 0))
self.spark:Fire("SparkOnce")
self.nextSpark = curTime + 4
end
end
end
function ENT:Use(user)
local item = user:GetCharacter():GetInventory():HasItem("tool_toolkit")
if self:GetNetVar("destroyed", false) == true and !item then
user:Notify("Do naprawienia szkody potrzebny jest zestaw narzędzi") -- message when dont work and you dont have item
return false
else
if item and self:GetNetVar("destroyed", false) == true then
user:Freeze(true)
user:SetAction("Naprawianie...", 12, function() -- line with text when you repair it
item = user:GetCharacter():GetInventory():HasItem("tool_toolkit")
if (item) then
if (item.isTool) then
item:DamageDurability(1)
end
self:SetNetVar("destroyed", false)
user:Freeze(false)
self.health = 200
self:EmitSound("physics/cardboard/cardboard_box_impact_hard7.wav", 100, 75)
self:Remove()
user:Notify("Pomyślnie naprawiono uszkodzenie elektryczne") -- message when you finish the job
end
end)
end
end
end
end

View File

@@ -0,0 +1,115 @@
--[[
| 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/
--]]
AddCSLuaFile()
--[[-------------------------------------------------------------------------
TODO: PLAY ANIMATION WHEN DEPLOYING SUPPORT
---------------------------------------------------------------------------]]
ENT.Base = "base_entity"
ENT.Type = "anim"
ENT.PrintName = "Broken (Gas)"
ENT.Category = "Helix"
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_BOTH
sound.Add( {
name = "SteamLoop1.Play",
channel = CHAN_STATIC,
volume = 0.6,
level = 70,
pitch = { 100, 100 },
sound = "ambient/gas/steam2.wav"
} )
sound.Add( {
name = "SteamLoop2.Play",
channel = CHAN_STATIC,
volume = 0.6,
level = 70,
pitch = { 100, 100 },
sound = "ambient/gas/steam_loop1.wav"
} )
if SERVER then
function ENT:Initialize()
self:SetModel("models/hunter/blocks/cube025x025x025.mdl")
self:SetNoDraw(true)
self:DrawShadow(false)
self:PhysicsInit( SOLID_VPHYSICS )
self:SetMoveType( MOVETYPE_VPHYSICS )
self:SetSolid( SOLID_VPHYSICS )
self:SetUseType(SIMPLE_USE)
self.health = 200
self:SetNetVar("destroyed", true)
local self_name = "steam_base" .. self:EntIndex()
self:SetName( self_name )
local phys1 = self:GetPhysicsObject()
if ( IsValid( phys1 ) ) then
phys1:Sleep()
phys1:SetMass(100)
end
self:EmitSound("SteamLoop2.Play")
self.steam = ents.Create("env_steam")
self.steam:SetPos( self:GetPos())
self.steam:SetAngles( self:GetAngles() )
self.steam:SetKeyValue( "InitialState", "1" )
self.steam:SetKeyValue( "SpreadSpeed", 15)
self.steam:SetKeyValue( "Speed", 120 )
self.steam:SetKeyValue( "StartSize", 10 )
self.steam:SetKeyValue( "EndSize", 35 )
self.steam:SetKeyValue( "Rate", 26 )
self.steam:SetKeyValue( "JetLength", 20 )
self.steam:SetKeyValue( "renderamt", 255 )
self.steam:SetKeyValue( "type", 0 )
self.steam:SetKeyValue("spawnflags", "16" + "32")
self.steam:SetOwner( self.Owner )
self.steam:SetParent(self)
self.steam:Spawn()
self.steam:Activate()
local steam_name = "steam" .. self.steam:EntIndex()
self.steam:SetName( steam_name )
end
function ENT:OnRemove()
self:StopSound("SteamLoop1.Play")
self:StopSound("SteamLoop2.Play")
end
function ENT:Use(user)
local item = user:GetCharacter():GetInventory():HasItem("tool_toolkit")
if self:GetNetVar("destroyed", false) == true and !item then
user:Notify("Rura jest uszkodzona! Do jej naprawy potrzebny jest zestaw narzędzi.") -- message when dont work and you dont have item
return false
else
if item and self:GetNetVar("destroyed", false) == true then
user:Freeze(true)
user:SetAction("Naprawianie...", 12, function() -- line with text when you repair it
item = user:GetCharacter():GetInventory():HasItem("tool_toolkit")
if (item) then
if (item.isTool) then
item:DamageDurability(1)
end
self:SetNetVar("destroyed", false)
user:Freeze(false)
self.health = 200
self:EmitSound("physics/cardboard/cardboard_box_impact_hard7.wav", 100, 75)
self:Remove()
user:Notify("Naprawiłeś rurę.") -- message when you finish the job
end
end)
end
end
end
end

View File

@@ -0,0 +1,76 @@
--[[
| 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/
--]]
AddCSLuaFile()
--[[-------------------------------------------------------------------------
TODO: PLAY ANIMATION WHEN DEPLOYING SUPPORT
---------------------------------------------------------------------------]]
ENT.Base = "base_entity"
ENT.Type = "anim"
ENT.PrintName = "Broken (Water)"
ENT.Category = "Helix"
ENT.Spawnable = true
ENT.RenderGroup = RENDERGROUP_BOTH
if SERVER then
function ENT:Initialize()
self:SetModel("models/hunter/blocks/cube025x025x025.mdl")
self:SetSolid(SOLID_VPHYSICS)
self:SetNoDraw(true)
self:SetUseType(SIMPLE_USE)
self.health = 200
self:SetNetVar("destroyed", true)
end
function ENT:Think()
local curTime = CurTime()
if self:GetNetVar("destroyed", false) == true then
if !self.nextSpark or self.nextSpark <= curTime then
if (!IsValid(self.spark)) then
self.spark = ents.Create("env_splash")
end
self.spark:SetPos(self:GetPos() + Vector(0, 10, 0))
self.spark:SetKeyValue( "scale", 3 )
self.spark:Fire("Splash")
self.nextSpark = curTime + 4
end
end
end
function ENT:Use(user)
local item = user:GetCharacter():GetInventory():HasItem("tool_toolkit")
if self:GetNetVar("destroyed", false) == true and !item then
user:Notify("Doszło do wycieku wody! Do naprawy potrzebny jest zestaw narzędzi.") -- message when dont work and you dont have item
return false
else
if item and self:GetNetVar("destroyed", false) == true then
user:Freeze(true)
user:SetAction("Naprawianie..", 12, function() -- line with text when you repair it
item = user:GetCharacter():GetInventory():HasItem("tool_toolkit")
if (item) then
if (item.isTool) then
item:DamageDurability(1)
end
self:SetNetVar("destroyed", false)
user:Freeze(false)
self.health = 200
self:EmitSound("physics/cardboard/cardboard_box_impact_hard7.wav", 100, 75)
self:Remove()
user:Notify("Rurociąg został naprawiony.") -- message when you finish the job
end
end)
end
end
end
end

View File

@@ -0,0 +1,52 @@
--[[
| 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/
--]]
include("shared.lua")
surface.CreateFont( "ScaffoldFont", {
font = "Open Sans",
extended = true,
size = 30,
weight = 500
} )
function ENT:Initialize()
end
function ENT:Draw()
local TIMER;
if (self:GetNWInt('timer') < CurTime()) then
TIMER = 0
else
TIMER = (self:GetNWInt('timer')-CurTime())
end
self:DrawModel()
local Pos = self:GetPos()
local Ang = self:GetAngles()
Ang:RotateAroundAxis(Ang:Forward(), 90)
Ang:RotateAroundAxis(Ang:Right(), -90)
if LocalPlayer():GetPos():Distance(self:GetPos()) < 400 then
cam.Start3D2D(Pos + Ang:Up() * 50, Ang, 0.3)
draw.WordBox(0, -100, -190, "Rusztowanie", "ScaffoldFont", Color(255, 78, 69, 0), Color(240, 240, 240,255))
draw.WordBox(0, -130, -150, "Materiały budowlane: "..self:GetNWInt("ItemsRequired").."/40", "ScaffoldFont", Color(255, 78, 69, 0), Color(240, 240, 240,255)) -- /40
if self:GetNWInt("ItemsRequired") == 40 then
draw.WordBox(0, -100, -110, "Budynek ukończony", "ScaffoldFont", Color(28, 161, 34, 0), Color(28, 161, 34,255))
end
cam.End3D2D()
end
end
function ENT:Think()
end

View File

@@ -0,0 +1,61 @@
--[[
| 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/
--]]
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:SetModel("models/props/de_inferno/scaffolding.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()
self.items = 0
self:SetNWInt("ItemsRequired", 0)
self:SetUseType( SIMPLE_USE )
self.LastUse = 0
self.Delay = 2
end
function ENT:Use(activator)
-- Timer to pretend abuse
if self.LastUse <= CurTime() then
self.LastUse = CurTime() + self.Delay
activator:Notify("Umieść tutaj materiały budowlane") -- Notify on press E
end
end
local worksound = {
"physics/wood/wood_box_break1.wav",
"physics/wood/wood_box_break2.wav",
"physics/wood/wood_crate_break2.wav",
"physics/wood/wood_plank_break3.wav"
}
function ENT:StartTouch( hitEnt )
if (self:GetNWInt("ItemsRequired") == 40) then return end -- max of items
if (hitEnt:GetClass() == "ix_item") then
if (hitEnt:GetItemID() != "buildingmaterials") then -- Check item id to accept item
return
end
hitEnt:Remove()
self.items = self.items + 1
self:SetNWInt("ItemsRequired", self.items)
self:EmitSound(worksound[math.random(1, #worksound)])
ix.saveEnts:SaveEntity(self)
--if self:GetNWInt("ItemsRequired") != 40 then return end
end
end

View File

@@ -0,0 +1,17 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Scaffold"
ENT.Category = "Other"
ENT.Author = "Legion"
ENT.Spawnable = true
ENT.AdminSpawnable = true

View File

@@ -0,0 +1,57 @@
--[[
| 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/
--]]
include("shared.lua")
surface.CreateFont( "WashingMachine", {
font = "Roboto Light",
extended = false,
size = 25,
weight = 500,
extended = true
} )
function ENT:Initialize()
end
function ENT:Draw()
local TIMER;
if (self:GetNWInt('timer') < CurTime()) then
TIMER = 0
else
TIMER = (self:GetNWInt('timer')-CurTime())
end
self:DrawModel()
local Pos = self:GetPos()
local Ang = self:GetAngles()
Ang:RotateAroundAxis(Ang:Forward(), 90)
Ang:RotateAroundAxis(Ang:Right(), -90)
if LocalPlayer():GetPos():Distance(self:GetPos()) < 200 then
cam.Start3D2D(Pos + Ang:Up() * 14, Ang, 0.11)
if (self:GetNWInt('timer') > CurTime()) then
draw.RoundedBox(6, -47, -75, 165, 40, Color(15,15,15,225))
draw.WordBox(2, -42, -70, "Przebieg: "..string.ToMinutesSeconds(TIMER), "WashingMachine", Color(214, 181, 16, 200), Color(35,35,35,255))
end
draw.RoundedBox(6, -105, -125, 195, 44, Color(15,15,15,225)) -- Name
draw.RoundedBox(6, -105, -75, 50, 40, Color(15,15,15,225)) -- /3
draw.WordBox(2, -100, -117, "Pralka", "WashingMachine", Color(214, 181, 16, 200), Color(35,35,35,255))
draw.WordBox(2, -100, -70, self:GetNWInt("ItemsRequired").."/3", "WashingMachine", Color(214, 163, 16, 200), Color(35,35,35,255))
cam.End3D2D()
end
end
function ENT:Think()
end

View File

@@ -0,0 +1,127 @@
--[[
| 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/
--]]
AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")
include("shared.lua")
function ENT:Initialize()
self:SetModel("models/props_c17/FurnitureWashingmachine001a.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
phys:Wake()
self:SetNWInt("ItemsRequired", 0)
self:SetUseType( SIMPLE_USE )
self.LastUse = 0
self.Delay = 2
end
function ENT:Use(activator)
-- Timer to pretend abuse
if self.LastUse <= CurTime() then
self.LastUse = CurTime() + self.Delay
activator:Notify("Włóż brudne ubrania.") -- Notify on press E
end
end
function ENT:StartTouch( hitEnt )
if hitEnt:GetClass() == "ix_item" then
local TimerSoundC = "plats/hall_elev_door.wav"
local WorkTime = 10 -- work time
if hitEnt:GetModel() != "models/willardnetworks/clothingitems/torso_citizen_refugee.mdl" then -- Check model to accept item
return end
if self:GetNWInt("ItemsRequired") == 3 then return end
hitEnt:Remove()
self:SetNWInt("ItemsRequired", (self:GetNWInt("ItemsRequired") + 1))
self:EmitSound("physics/body/body_medium_impact_soft5.wav")
if self:GetNWInt("ItemsRequired") != 3 then return end
self:EmitSound("items/medshot4.wav")
self:EmitSound("plats/tram_hit1.wav")
self:SetNWInt('timer', CurTime() + WorkTime)
-- Sounds after work start (if you gonna make work more than 10 seconds, add new sounds and keep timer growing
timer.Simple(0.2, function()
self:EmitSound("plats/tram_motor_start.wav")
end)
timer.Simple(0.4, function()
self:EmitSound(TimerSoundC)
self.sound = CreateSound(self, Sound("plats/tram_move.wav"))
self.sound:SetSoundLevel(50)
self.sound:PlayEx(1, 200)
end)
timer.Simple(0.8, function()
self:EmitSound(TimerSoundC)
end)
timer.Simple(1.2, function()
self:EmitSound(TimerSoundC)
end)
timer.Simple(1.4, function()
self:EmitSound(TimerSoundC)
end)
timer.Simple(2, function()
self:EmitSound(TimerSoundC)
end)
timer.Simple(4, function()
self:EmitSound("physics/cardboard/cardboard_box_impact_soft5.wav")
end)
timer.Simple(5, function()
self:EmitSound("physics/cardboard/cardboard_box_impact_hard4.wav")
end)
timer.Simple(6.5, function()
self:EmitSound("physics/flesh/flesh_impact_hard6.wav")
end)
timer.Simple(7, function()
self:EmitSound("physics/flesh/flesh_impact_hard6.wav")
end)
timer.Simple(WorkTime - 2, function()
if self.sound then
self.sound:Stop()
end
self:EmitSound("plats/elevator_large_stop1.wav")
end)
timer.Simple(WorkTime, function()
self:SetNWInt("ItemsRequired", 0)
ix.item.Spawn("clean_clothes", Vector(self:GetPos().x + 0.5, self:GetPos().y - 20, self:GetPos().z + 6)) -- Spawn item (maybe need edit some pos)
ix.item.Spawn("clean_clothes", Vector(self:GetPos().x + 0.5, self:GetPos().y - 28, self:GetPos().z + 12))
ix.item.Spawn("clean_clothes", Vector(self:GetPos().x + 0.5, self:GetPos().y - 36, self:GetPos().z + 20))
end)
end
end

View File

@@ -0,0 +1,17 @@
--[[
| 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/
--]]
ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Washing"
ENT.Category = "Other"
ENT.Author = "Legion"
ENT.Spawnable = true
ENT.AdminSpawnable = true

View File

@@ -0,0 +1,16 @@
--[[
| 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 = "Czyste pranie"
ITEM.model = Model("models/willardnetworks/clothingitems/torso_citizen2.mdl")
ITEM.description = "Czyste ubrania po umyciu."
ITEM.category = "misc"
ITEM.width = 1
ITEM.height = 1

View File

@@ -0,0 +1,16 @@
--[[
| 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 = "Brudne pranie"
ITEM.model = Model("models/willardnetworks/clothingitems/torso_citizen_refugee.mdl")
ITEM.description = "Brudne pranie, trzeba je wyprać."
ITEM.category = "misc"
ITEM.width = 1
ITEM.height = 1

View File

@@ -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 = "PDA CMU"
ITEM.model = Model("models/fruity/tablet/tablet_sfm.mdl")
ITEM.description = "PDA wydawane dla lokalnych grup CMU."
ITEM.category = "Combine"
ITEM.width = 1
ITEM.height = 1
ITEM.KeepOnDeath = true
ITEM.functions.Open = {
OnRun = function(item)
net.Start("ixDataFilePDA_CMU_Open")
net.Send(item.player)
return false
end,
OnCanRun = function(item)
local character = item.player:GetCharacter()
return item.player:Team() == FACTION_MEDICAL or character:IsVortigaunt() and character:GetBioticPDA() == "CMU"
end
}

View File

@@ -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 = "PDA CWU"
ITEM.model = Model("models/fruity/tablet/tablet_sfm.mdl")
ITEM.description = "PDA wydawane dla lokalnych grup CWU."
ITEM.category = "Combine"
ITEM.width = 1
ITEM.height = 1
ITEM.KeepOnDeath = true
ITEM.functions.Open = {
OnRun = function(item)
net.Start("ixDataFilePDA_CWU_Open")
net.Send(item.player)
return false
end,
OnCanRun = function(item)
local character = item.player:GetCharacter()
return item.player:Team() == FACTION_WORKERS or character:IsVortigaunt() and character:GetBioticPDA() == "CWU"
end
}

View File

@@ -0,0 +1,36 @@
--[[
| 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/
--]]
LANGUAGE = {
pdaDatafile_waiting = "oczekiwanie na dane wejściowe",
pdaDatafile_search = "szukanie...",
pdaDatafile_notFound = "brak wyników. spróbuj ponownie",
pdaDatafile_noAccess = "nie masz dostępu do tych danych.",
pdaDatafile_data_socialCredits = "kredyty społeczne",
pdaDatafile_data_socialCreditsDate = "ostatnia aktualizacja",
pdaDatafile_data_permits = "zezwolenia",
pdaDatafile_data_permitsUnlimited = "nieograniczony",
pdaDatafile_data_permits_buttonShow = "pokaż",
pdaDatafile_data_permits_buttonHide = "ukryj",
pdaDatafile_data_shop = "shop",
pdaDatafile_data_housing = "mieszkanie",
pdaDatafile_data_wages = "dopłaty do racji",
pdaDatafile_data_anticitizen = "antyobywatel",
pdaDatafile_data_geneticDesc = "opis genetyczny",
pdaDatafile_data_occupation = "zawód",
pdaDatafile_data_occupationDate = "data rozpoczęcia zatrudnienia",
pdaDatafile_data_loyaltyStatus = "status lojalności",
pdaDatafile_data_cid = "cid",
pdaDatafile_data_designatedStatus = "przydzielony status",
pdaDatafile_data_designatedStatusDate = "ostatnia aktualizacja",
pdaDatafile_data_bol = "bol",
pdaDatafile_data_name = "nazwa"
}

View File

@@ -0,0 +1,36 @@
--[[
| 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/
--]]
LANGUAGE = {
pdaDatafile_waiting = "oczekiwanie na dane wejściowe",
pdaDatafile_search = "szukanie...",
pdaDatafile_notFound = "brak wyników. spróbuj ponownie",
pdaDatafile_noAccess = "nie masz dostępu do tych danych.",
pdaDatafile_data_socialCredits = "kredyty społeczne",
pdaDatafile_data_socialCreditsDate = "ostatnia aktualizacja",
pdaDatafile_data_permits = "zezwolenia",
pdaDatafile_data_permitsUnlimited = "nieograniczony",
pdaDatafile_data_permits_buttonShow = "pokaż",
pdaDatafile_data_permits_buttonHide = "ukryj",
pdaDatafile_data_shop = "shop",
pdaDatafile_data_housing = "mieszkanie",
pdaDatafile_data_wages = "dopłaty do racji",
pdaDatafile_data_anticitizen = "antyobywatel",
pdaDatafile_data_geneticDesc = "opis genetyczny",
pdaDatafile_data_occupation = "zawód",
pdaDatafile_data_occupationDate = "data rozpoczęcia zatrudnienia",
pdaDatafile_data_loyaltyStatus = "status lojalności",
pdaDatafile_data_cid = "cid",
pdaDatafile_data_designatedStatus = "przydzielony status",
pdaDatafile_data_designatedStatusDate = "ostatnia aktualizacja",
pdaDatafile_data_bol = "bol",
pdaDatafile_data_name = "nazwa"
}

View File

@@ -0,0 +1,36 @@
--[[
| 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/
--]]
LANGUAGE = {
pdaDatafile_waiting = "ожидается ввод данных",
pdaDatafile_search = "идет поиск...",
pdaDatafile_notFound = "нет результатов. попробуйте снова.",
pdaDatafile_noAccess = "нет доступа к данным.",
pdaDatafile_data_socialCredits = "социальные кредиты",
pdaDatafile_data_socialCreditsDate = "последнее обновление",
pdaDatafile_data_permits = "разрешения",
pdaDatafile_data_permitsUnlimited = "неограниченно",
pdaDatafile_data_permits_buttonShow = "показать",
pdaDatafile_data_permits_buttonHide = "скрыть",
pdaDatafile_data_shop = "предприятие",
pdaDatafile_data_housing = "место жительства",
pdaDatafile_data_wages = "доплата к рациону",
pdaDatafile_data_anticitizen = "нарушитель",
pdaDatafile_data_geneticDesc = "физическое описание",
pdaDatafile_data_occupation = "род деятельности",
pdaDatafile_data_occupationDate = "дата начала занятости",
pdaDatafile_data_loyaltyStatus = "статус лояльности",
pdaDatafile_data_cid = "cid",
pdaDatafile_data_designatedStatus = "назначенный статус",
pdaDatafile_data_designatedStatusDate = "последнее обновление",
pdaDatafile_data_bol = "в розыске",
pdaDatafile_data_name = "имя"
}

View File

@@ -0,0 +1,35 @@
--[[
| 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/
--]]
LANGUAGE = {
pdaDatafile_data_permits_buttonShow = "mostrar",
pdaDatafile_waiting = "esperando entrada",
pdaDatafile_data_designatedStatusDate = "última actualización",
pdaDatafile_noAccess = "No tienes acceso a estos datos.",
pdaDatafile_data_permits = "permisos",
pdaDatafile_data_permits_buttonHide = "ocultar",
pdaDatafile_search = "buscando...",
pdaDatafile_data_shop = "tienda",
pdaDatafile_data_wages = "Salario extra añadido al próximo racionamiento",
pdaDatafile_data_anticitizen = "anti-ciudadano",
pdaDatafile_data_bol = "en busca",
pdaDatafile_data_socialCreditsDate = "ultima actualización",
pdaDatafile_data_designatedStatus = "estatus designado",
pdaDatafile_data_geneticDesc = "descripción genética",
pdaDatafile_notFound = "Sin resultados. Inténtalo de nuevo.",
pdaDatafile_data_cid = "cid",
pdaDatafile_data_housing = "vivienda",
pdaDatafile_data_occupation = "ocupación",
pdaDatafile_data_name = "nombre",
pdaDatafile_data_occupationDate = "última actualización",
pdaDatafile_data_permitsUnlimited = "ilimitado",
pdaDatafile_data_socialCredits = "créditos sociales",
pdaDatafile_data_loyaltyStatus = "estatus de lealtad"
}

View File

@@ -0,0 +1,78 @@
--[[
| 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/
--]]
PLUGIN.name = "WN7sfuff"
PLUGIN.description = "Some fun staff!!"
PLUGIN.author = "Legion"
ix.util.Include("sv_plugin.lua")
if (CLIENT) then
function PLUGIN:InitializedPlugins()
local function drawWorkESP(client, entity, x, y, factor)
ix.util.DrawText("Uszkodzone (Praca) "..entity:GetClass(), x, y - math.max(10, 32 * factor), Color(185, 179, 38),
TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, nil, math.max(255 * factor, 80))
end
ix.observer:RegisterESPType("ix_workerk_water", drawWorkESP, "work")
ix.observer:RegisterESPType("ix_workerk_gas", drawWorkESP, "work")
ix.observer:RegisterESPType("ix_workerk_electric", drawWorkESP, "work")
end
else
-- Called when loading all the data that has been saved.
function PLUGIN:LoadData()
if (!ix.config.Get("SaveEntsOldLoadingEnabled")) then return end
for _, v in ipairs(ix.data.Get("wn_scaffolds") or {}) do
local entity = ents.Create("wn_scaffold")
entity:SetPos(v.pos)
entity:SetAngles(v.angles)
entity:Spawn()
entity:SetSolid(SOLID_VPHYSICS)
entity:PhysicsInit(SOLID_VPHYSICS)
local physObj = entity:GetPhysicsObject()
if (IsValid(physObj)) then
physObj:EnableMotion(false)
physObj:Sleep()
end
entity.items = v.materials or 0
entity:SetNWInt("ItemsRequired", v.materials or 0)
end
end
-- Called just after data should be saved.
function PLUGIN:SaveData()
self:SaveScaffolds()
end
-- This is a seperate function so we can call it upon deploying a radio.
function PLUGIN:SaveScaffolds()
local scaffolds = {}
-- This is faster than two single ents.FindByClass
local entities = ents.GetAll()
for i = 1, #entities do
local entityClass = entities[i]:GetClass()
if (entityClass == "wn_scaffold") then
scaffolds[#scaffolds + 1] = {
pos = entities[i]:GetPos(),
angles = entities[i]:GetAngles(),
materials = entities[i].items
};
end
end;
ix.data.Set("wn_scaffolds", scaffolds)
end
end

View File

@@ -0,0 +1,210 @@
--[[
| 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
util.AddNetworkString("ixDataFilePDA_CWU_Open")
util.AddNetworkString("ixDataFilePDA_CWU_RequestData")
util.AddNetworkString("ixDataFilePDA_CWU_CheckData")
util.AddNetworkString("ixDataFilePDA_CMU_Open")
util.AddNetworkString("ixDataFilePDA_CMU_RequestData")
util.AddNetworkString("ixDataFilePDA_CMU_CheckData")
function PLUGIN:RegisterSaveEnts()
ix.saveEnts:RegisterEntity("wn_scaffold", true, true, true, {
OnSave = function(entity, data) --OnSave
data.motion = false
data.materials = entity.items
end,
OnRestore = function(entity, data) --OnRestore
entity:SetSolid(SOLID_VPHYSICS)
entity:PhysicsInit(SOLID_VPHYSICS)
entity.items = data.materials or 0
entity:SetNWInt("ItemsRequired", data.materials or 0)
end,
})
end
-- Include new required data to datafiles of old characters
function PLUGIN:UpdateOldVortData(character, genericdata)
if (!character or !istable(genericdata)) then return end
genericdata.collarID = character:GetCollarID() or "N/A"
genericdata.cohesionPoints = genericdata.socialCredits or 0
genericdata.cohesionPointsDate = ix.config.Get("day").."/"..ix.config.Get("month").."/"..ix.config.Get("year")
genericdata.nulled = "NIEAKTYWNY"
genericdata.cid = "N/A"
if (character:HasFlags("N") or character:GetBackground() == "Kolaborator") then
genericdata.nulled = "AKTYWNY"
end
for _, v in pairs(character:GetInventory():GetItems()) do
if (table.HasValue({"Obroża Vortigaunta", "Obroża Vortigaunta (fałszywa)"}, v.name) and v:GetData("equip") == true) then
if (v:GetData("collarID", nil) and v:GetData("sterilizedCredits", nil)) then
genericdata.cohesionPoints = v:GetData("sterilizedCredits", 0)
end
end
end
character:SetGenericdata(genericdata)
character:Save()
character:GetPlayer():Notify("Nowy format został pomyślnie zastosowany do pliku danych.")
end
function PLUGIN:CheckNotifyUpdate(author, character, data)
if (character:IsVortigaunt()) then
if (data.cid == "N/A") then
ix.combineNotify:AddNotification("LOG:// " .. author .. " przeprowadza inspekcję tożsamości na " .. string.upper("zasobie biotycznym o obroży:") .. " #" .. character:GetCollarID())
else
ix.combineNotify:AddNotification("LOG:// " .. author .. " przeprowadza inspekcję tożsamości na " .. string.upper("zasobie biotycznym o identyfikatorze:") .. " #" .. data.cid)
end
else
ix.combineNotify:AddNotification("LOG:// " .. author .. " przeprowadza inspekcję tożsamości na '" .. string.upper(data.name) .. "', #" .. data.cid)
end
end
local function SendDatabaseAnswer(client, data, status, cmu, noNotif)
data = data or {}
if (!cmu) then
data.status = status
end
if ((!status or status[2] != "Error") and !noNotif) then
local author = client:IsDispatch() and "OVERWATCH" or (ix.faction.Get(client:Team()).idInspectionText or "Unit") .. " " .. string.upper(client:GetCombineTag())
for k, v in ipairs(ix.char.loaded) do
if (cmu and data.genericData and v:GetID() == data.genericData.id) then
PLUGIN:CheckNotifyUpdate(author, v, data.genericData)
elseif (!cmu and data.cid and v:GetID() == data.id) then
PLUGIN:CheckNotifyUpdate(author, v, data)
end
end
end
local json = util.TableToJSON(data)
local compressed = util.Compress(json)
local length = compressed:len()
net.Start("ixDataFilePDA_" .. (cmu and "CMU" or "CWU") .. "_CheckData")
net.WriteUInt(length, 32)
net.WriteData(compressed, length)
net.Send(client)
end
net.Receive("ixDataFilePDA_CWU_RequestData", function(length, client)
local text = net.ReadString()
local query = mysql:Select("ix_characters")
query:Select("name")
query:Select("faction")
query:Select("id")
query:Select("cid")
query:Where("schema", Schema and Schema.folder or "helix")
if tonumber(text) then
query:Where("cid", text)
else
query:Where("name", text)
end
query:Callback(function(result)
if (!istable(result) or #result == 0) then
return SendDatabaseAnswer(client, nil, { L("pdaDatafile_notFound", client), "Error" })
end
result = result[1]
if client:GetCharacter():GetGenericdata().cid != result.cid then
if (result.faction == "vortigaunt") then
return SendDatabaseAnswer(client, nil, { L("pdaDatafile_noAccess", client), "Error" })
end
end
local dataSelect = mysql:Select("ix_characters_data")
dataSelect:Where("id", result.id)
dataSelect:WhereIn("key", "genericdata")
dataSelect:Callback(function(dataSelectResult)
if (!istable(dataSelectResult) or #dataSelectResult == 0) then
return SendDatabaseAnswer(client, nil, { L("pdaDatafile_notFound", client), "Error" })
end
dataSelectResult = dataSelectResult[1]
SendDatabaseAnswer(client, util.JSONToTable(dataSelectResult.data), { result.name .." | #"..result.cid, "Sukces" })
end)
dataSelect:Execute()
end)
query:Execute()
end)
net.Receive("ixDataFilePDA_CMU_RequestData", function(length, client)
local text = net.ReadString()
local noNotif = net.ReadBool()
local query = mysql:Select("ix_characters")
query:Select("name")
query:Select("faction")
query:Select("id")
query:Select("cid")
query:Where("schema", Schema and Schema.folder or "helix")
if tonumber(text) then
query:Where("cid", text)
else
query:Where("name", text)
end
query:Callback(function(result)
if (!istable(result) or #result == 0) then
return SendDatabaseAnswer(client, nil, nil, true)
end
result = result[1]
if client:GetCharacter():GetGenericdata().cid != result.cid then
if (result.faction != "citizen") then
return SendDatabaseAnswer(client, nil, nil, true)
end
end
local dataSelect = mysql:Select("ix_characters_data")
dataSelect:Where("id", result.id)
dataSelect:WhereIn("key", "genericdata")
dataSelect:Callback(function(genericDataResult)
if (!istable(genericDataResult) or #genericDataResult == 0) then
return SendDatabaseAnswer(client, nil, nil, true)
end
genericDataResult = genericDataResult[1]
local dataSelect = mysql:Select("ix_characters_data")
dataSelect:Where("id", result.id)
dataSelect:WhereIn("key", "datafilemedicalrecords")
dataSelect:Callback(function(medicalRecordsResult)
if (!istable(medicalRecordsResult) or #medicalRecordsResult == 0) then
return SendDatabaseAnswer(client, nil, nil, true)
end
medicalRecordsResult = medicalRecordsResult[1]
local finalResult = {
genericData = util.JSONToTable(genericDataResult.data),
medicalRecords = util.JSONToTable(medicalRecordsResult.data),
}
SendDatabaseAnswer(client, finalResult, nil, true, noNotif)
end)
dataSelect:Execute()
end)
dataSelect:Execute()
end)
query:Execute()
end)