This commit is contained in:
lifestorm
2024-08-04 23:54:45 +03:00
parent 0e770b2b49
commit df294d03aa
7526 changed files with 4011945 additions and 15 deletions

View File

@@ -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/
--]]
local playerMeta = FindMetaTable("Player")
function playerMeta:HasPPE()
local character = self:GetCharacter()
if (!character) then return false end
local inventory = character:GetInventory()
if (!inventory) then return false end
local clothingItems = inventory:GetItems(true)
for _, v in pairs(clothingItems) do
if (v.isPPE and v:GetData("equip")) then
return true
end
end
end

View File

@@ -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/
--]]
function PLUGIN:SetupAreaProperties()
ix.area.AddType("lethal gas")
ix.area.AddProperty("Severity", ix.type.number, 1)
end

View File

@@ -0,0 +1,49 @@
--[[
| 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.name = "Better Lethal Gas"
PLUGIN.author = "Asimo but mainly Gr4ss"
PLUGIN.description = "Essentially a broken down copy of the Better Gas plugin. Major thanks to Gr4ss for essentially coming up with 90% of this."
ix.util.Include("meta/sh_player.lua")
ix.util.Include("sh_hooks.lua")
ix.util.Include("sv_hooks.lua")
if (SERVER) then
PLUGIN.timerLethalGasChangeCallback = function(_, newVal)
for k, v in ipairs(player.GetAll()) do
local uniqueID = "ixLethalGas"..v:SteamID64()
if (timer.Exists(uniqueID)) then
timer.Adjust(uniqueID, newVal)
end
end
end
end
ix.config.Add("LethalGasDamageTimer", 5, "How often, in seconds, the damage timer for being in lethal gas should run.", PLUGIN.timerLethalGasChangeCallback, {
data = {min = 1, max = 10, decimals = 0},
category = "LethalGas"
})
ix.config.Add("LethalGasDamage", 5, "How much should the default damage of gas be?", nil, {
data = {min = 1, max = 100, decimals = 1},
category = "LethalGas"
})
ix.config.Add("GasVorts", true, "Should lethal gas damage those factions that are immune to gas?", nil, {
category = "LethalGas"
})
ix.config.Add("GasBleedout", true, "Should lethal gas damage players in bleedout?", nil, {
category = "LethalGas"
})
ix.lang.AddTable("english", {
lethalGasEntered = "Havadaki bir şey vücuduna yük bindiriyor. Yeterli bir güvenlik teçhizatı olmadan burada gezmemen gerektiğini hissediyorsun."
})

View File

@@ -0,0 +1,47 @@
--[[
| 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 IsValid = IsValid
local ix = ix
function PLUGIN:PlayerLoadedCharacter(client, character)
local uniqueID = "ixLethalGas" .. client:SteamID64()
timer.Create(uniqueID, ix.config.Get("LethalGasDamageTimer"), 0, function()
if (IsValid(client)) then
if (!client.ixInArea) then return end
if (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle()) then return end
if (!ix.config.Get("GasVorts")) then
if (ix.faction.Get(client:Team()).noGas) then return end
end
if (!ix.config.Get("GasBleedout")) then
if (character:GetBleedout() > 0) then return end
end
if (client.ixArea and ix.area.stored[client.ixArea] and ix.area.stored[client.ixArea].type == "lethal gas" and !client:HasPPE()) then
client:TakeDamage(ix.area.stored[client.ixArea].properties.Severity * ix.config.Get("LethalGasDamage"), null, null)
end
else
timer.Remove(uniqueID)
end
end)
end
function PLUGIN:OnPlayerAreaChanged(client, oldID, newID)
if (ix.area.stored[newID].type == "lethal gas") then
if (client:GetMoveType() == MOVETYPE_NOCLIP and !client:InVehicle()) then return end
if (oldID and ix.area.stored[oldID] and ix.area.stored[oldID].type != "lethal gas" and ix.option.Get(client, "gasNotificationWarnings")) then
client:ChatNotifyLocalized("lethalGasEntered")
end
end
end