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,29 @@
--[[
| 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:PopulateEntityInfo(entity, container)
if (entity:GetClass() != "prop_physics") then return end
local propDescription = entity:GetNetVar("description")
if (!propDescription or !istable(propDescription) or #propDescription != 2) then return end
local titleLabel = container:AddRow("title")
titleLabel:SetText(propDescription[1])
titleLabel:SetImportant()
titleLabel:SetBackgroundColor(Color(255, 255, 255, 255))
titleLabel:SizeToContents()
local descriptionLabel = container:AddRow("description")
descriptionLabel:SetText(propDescription[2])
descriptionLabel:SetBackgroundColor(Color(255, 255, 255, 255))
descriptionLabel:SizeToContents()
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/
--]]
LANGUAGE = {
invalidProp = "That is not a valid prop!",
propNotYours = "That prop does not belong to you!",
propDescriptionAdded = "Prop Description added.",
propDescriptionRemoved = "Prop Description removed."
}

View File

@@ -0,0 +1,124 @@
--[[
| 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/
--]]
do
local COMMAND = {}
COMMAND.description = "Add a text describing a specific prop."
COMMAND.arguments = {ix.type.string, ix.type.text}
COMMAND.alias = {"PropDescAdd"}
function COMMAND:OnRun(client, title, description)
local curTime = CurTime()
if (client.nextStaticText and client.nextStaticText >= curTime) then
client:NotifyLocalized("notNow")
return
end
if (title == "" or description == "") then
return
end
local entity = client:GetEyeTraceNoCursor().Entity
if (!IsValid(entity) or entity:GetClass() != "prop_physics") then
client:NotifyLocalized("invalidProp")
return
end
if (client:SteamID() != entity.ownerSteamID and !client:IsAdmin()) then
client:NotifyLocalized("propNotYours")
return
end
client.nextStaticText = curTime + 5
client:NotifyLocalized("propDescriptionAdded")
entity:SetNetVar("description", {title, description})
ix.log.Add(client, "propDescriptionAdded", title, description)
end
ix.command.Add("PropDescriptionAdd", COMMAND)
end
do
local COMMAND = {}
COMMAND.description = "Add a permanent text describing a specific prop."
COMMAND.arguments = {ix.type.string, ix.type.text}
COMMAND.adminOnly = true
COMMAND.alias = {"PermPropDescAdd"}
function COMMAND:OnRun(client, title, description)
local curTime = CurTime()
if (client.nextStaticText and client.nextStaticText >= curTime) then
client:NotifyLocalized("notNow")
return
end
if (title == "" or description == "") then
return
end
local entity = client:GetEyeTraceNoCursor().Entity
if (!IsValid(entity) or entity:GetClass() != "prop_physics") then
client:NotifyLocalized("invalidProp")
return
end
client.nextStaticText = curTime + 5
client:NotifyLocalized("propDescriptionAdded")
entity:SetNetVar("description", {title, description})
entity.saveDescription = true
ix.log.Add(client, "propDescriptionAdded", title, description)
end
ix.command.Add("PermanentPropDescriptionAdd", COMMAND)
end
do
local COMMAND = {}
COMMAND.description = "Removes a prop's description text."
COMMAND.alias = {"PropDescRemove"}
function COMMAND:OnRun(client)
local entity = client:GetEyeTraceNoCursor().Entity
if (!IsValid(entity) or entity:GetClass() != "prop_physics") then
client:NotifyLocalized("invalidProp")
return
end
if (client:SteamID() != entity.ownerSteamID and !client:IsAdmin()) then
client:NotifyLocalized("propNotYours")
return
end
client:NotifyLocalized("propDescriptionRemoved")
entity:SetNetVar("description", nil)
ix.log.Add(client, "propDescriptionRemoved")
end
ix.command.Add("PropDescriptionRemove", COMMAND)
end

View File

@@ -0,0 +1,18 @@
--[[
| 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 = "Prop Descriptions"
PLUGIN.author = "Aspect™"
PLUGIN.descriptions = "Allows players to set descriptions to props."
ix.util.Include("cl_hooks.lua")
ix.util.Include("sh_commands.lua")
ix.util.Include("sv_plugin.lua")

View File

@@ -0,0 +1,18 @@
--[[
| 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/
--]]
ix.log.AddType("propDescriptionAdded", function(client, title, description)
return string.format("%s has set a prop description: '%s' - '%s'.", client:GetName(), title, description)
end)
ix.log.AddType("propDescriptionRemoved", function(client)
return string.format("%s has removed a prop description.", client:GetName())
end)