add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
ITEM.name = "Writing Base"
ITEM.model = Model("models/props_c17/paper01.mdl")
ITEM.description = "Something that can be written on."

View File

@@ -0,0 +1,51 @@
local PLUGIN = PLUGIN
ITEM.name = "Бумага"
ITEM.description = "Кусочек бумаги, %s."
ITEM.price = 2
ITEM.model = Model("models/props_c17/paper01.mdl")
ITEM.width = 1
ITEM.height = 1
ITEM.classes = {CLASS_EOW}
ITEM.business = true
ITEM.bAllowMultiCharacterInteraction = true
function ITEM:GetDescription()
return self:GetData("owner", 0) == 0
and string.format(self.description, "он потрепанный и грязный.")
or string.format(self.description, "на нем написано.")
end
function ITEM:SetText(text, character)
text = tostring(text):sub(1, PLUGIN.maxLength)
self:SetData("text", text, false, false, true)
self:SetData("owner", character and character:GetID() or 0)
end
ITEM.functions.View = {
OnRun = function(item)
netstream.Start(item.player, "ixViewPaper", item:GetID(), item:GetData("text", ""), 0)
return false
end,
OnCanRun = function(item)
local owner = item:GetData("owner", 0)
return owner != 0
end
}
ITEM.functions.Edit = {
OnRun = function(item)
netstream.Start(item.player, "ixViewPaper", item:GetID(), item:GetData("text", ""), 1)
return false
end,
OnCanRun = function(item)
local owner = item:GetData("owner", 0)
return owner == 0 or owner == item.player:GetCharacter():GetID() and item:GetData("text", "") == ""
end
}