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,23 @@
--[[
| 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:PopulateCharacterInfo(client, character, tooltip)
local visibileItems = client:GetNetVar("visibleItems", {})
for itemName, _ in pairs(visibileItems) do
itemName = L(itemName)
local row = tooltip:AddRow("visibileItem_" .. itemName)
row:SetBackgroundColor(color_white)
row:SetText("They are carrying " .. (itemName[#itemName]:lower() == "s" and "" or itemName:match("^[aeiouAEIOU]") and "an " or "a ") .. itemName .. ".")
row:SizeToContents()
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/
--]]
PLUGIN.name = "Description Items"
PLUGIN.author = "Aspect™"
PLUGIN.description = "Adds a description to a player if they are carrying a large item."
ix.util.Include("cl_hooks.lua")
ix.util.Include("sv_hooks.lua")

View File

@@ -0,0 +1,73 @@
--[[
| 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:InventoryItemAdded(oldInv, inventory, item)
-- New Inventory
if (inventory) then
local client = inventory.owner and ix.char.loaded[inventory.owner] and ix.char.loaded[inventory.owner]:GetPlayer()
if (client) then
if (item.width >= 3 and item.height >= 4) then
local currentItems = client:GetNetVar("visibleItems", {})
currentItems[item.name] = true
client:SetNetVar("visibleItems", currentItems)
end
end
end
-- Old Inventory
if (oldInv) then
local client = oldInv.owner and ix.char.loaded[oldInv.owner] and ix.char.loaded[oldInv.owner]:GetPlayer()
if (client and item.width >= 3 and item.height >= 4) then
local currentItems = client:GetNetVar("visibleItems", {})
if (currentItems[item.name]) then
currentItems[item.name] = nil
end
client:SetNetVar("visibleItems", currentItems)
end
end
end
function PLUGIN:PlayerInteractItem(client, action, item)
if (action == "drop") then
if (item.width >= 3 and item.height >= 4) then
local currentItems = client:GetNetVar("visibleItems", {})
if (currentItems[item.name]) then
currentItems[item.name] = nil
end
client:SetNetVar("visibleItems", currentItems)
end
end
end
function PLUGIN:PlayerSpawn(client)
local character = client:GetCharacter()
if (!character) then return end
timer.Simple(1, function()
local currentItems = {}
for _, item in pairs(character:GetInventory():GetItems()) do
if (item.width < 3 or item.height < 4) then continue end
currentItems[item.name] = true
end
client:SetNetVar("visibleItems", currentItems)
end)
end