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,83 @@
ITEM.name = "Украденный военный билет"
ITEM.description = "Военный билет, снятый с убитого противника. Содержит его данные."
ITEM.model = "models/props_c17/paper01.mdl"
ITEM.width = 1
ITEM.height = 1
ITEM.category = "Маскировка"
ITEM.noDrop = false
-- Функция предъявления документа
ITEM.functions.Show = {
name = "Предъявить",
tip = "Показать военный билет ближайшему игроку",
icon = "icon16/eye.png",
OnRun = function(item)
local client = item.player
if CLIENT then
-- Создаем меню выбора игрока
local menu = DermaMenu()
for _, ply in ipairs(player.GetAll()) do
if ply ~= client and ply:GetPos():Distance(client:GetPos()) <= 200 then
menu:AddOption(ply:Name(), function()
net.Start("ixDisguise_ShowStolenID")
net.WriteUInt(ply:UserID(), 16)
net.WriteUInt(item:GetID(), 32)
net.SendToServer()
end)
end
end
if menu:ChildCount() == 0 then
menu:AddOption("Нет игроков поблизости", function() end):SetDisabled(true)
end
menu:Open()
end
return false
end,
OnCanRun = function(item)
return !IsValid(item.entity)
end
}
-- Функция просмотра своего документа
ITEM.functions.View = {
name = "Просмотреть",
tip = "Посмотреть содержимое военного билета",
icon = "icon16/page_white_text.png",
OnRun = function(item)
local client = item.player
if SERVER then
local data = {
name = item:GetData("name", "Неизвестно"),
faction = item:GetData("faction", "Неизвестно"),
subdivision = item:GetData("subdivision", "Неизвестно"),
specialization = item:GetData("specialization", "Неизвестно"),
rank = item:GetData("rank", "Неизвестно")
}
net.Start("ixDisguise_ViewStolenID")
net.WriteTable(data)
net.Send(client)
end
return false
end,
OnCanRun = function(item)
return !IsValid(item.entity)
end
}
-- Кастомное отображение в инвентаре
if CLIENT then
function ITEM:PaintOver(item, w, h)
local victimName = self:GetData("name")
if victimName then
draw.SimpleText(victimName, "DermaDefault", w/2, h - 5, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
end
end
end

View File

@@ -0,0 +1,101 @@
ITEM.name = "Украденная форма"
ITEM.description = "Военная форма, снятая с убитого противника. Позволяет замаскироваться под врага."
ITEM.model = "models/props_c17/suitcase001a.mdl"
ITEM.width = 2
ITEM.height = 2
ITEM.category = "Маскировка"
ITEM.noDrop = false
-- Функция надевания формы
ITEM.functions.Wear = {
name = "Надеть",
tip = "Надеть украденную форму для маскировки",
icon = "icon16/user_suit.png",
OnRun = function(item)
local client = item.player
local character = client:GetCharacter()
if SERVER then
-- Проверяем кулдаун
local plugin = ix.plugin.Get("disguise")
local canUse, msg = plugin:CanUseDisguise(client)
if not canUse then
client:Notify(msg)
return false
end
-- Проверяем, не в маскировке ли уже
if character:GetData("disguised") then
client:Notify("Вы уже в маскировке!")
return false
end
-- Получаем украденную модель
local stolenModel = item:GetData("stolenModel")
if not stolenModel then
client:Notify("Форма повреждена!")
return false
end
-- Сохраняем оригинальную модель и надеваем украденную
local originalModel = client:GetModel()
character:SetData("originalModel", originalModel)
character:SetData("disguiseModel", stolenModel)
character:SetData("disguised", true)
client:SetModel(stolenModel)
local victimName = item:GetData("victimName", "неизвестного")
client:Notify("Вы надели форму " .. victimName .. ". Будьте осторожны!")
-- Удаляем предмет после использования
item:Remove()
end
return false
end,
OnCanRun = function(item)
return !IsValid(item.entity)
end
}
-- Функция снятия формы
ITEM.functions.Remove = {
name = "Снять",
tip = "Снять маскировку",
icon = "icon16/user_delete.png",
OnRun = function(item)
local client = item.player
local character = client:GetCharacter()
if SERVER then
if not character:GetData("disguised") then
client:Notify("Вы не в маскировке!")
return false
end
local plugin = ix.plugin.Get("disguise")
if plugin then
plugin:RemoveDisguise(client)
end
end
return false
end,
OnCanRun = function(item)
local client = item.player
local character = client and client:GetCharacter()
return !IsValid(item.entity) and character and character:GetData("disguised")
end
}
-- Кастомное отображение в инвентаре
if CLIENT then
function ITEM:PaintOver(item, w, h)
local victimName = self:GetData("victimName")
if victimName then
draw.SimpleText("Форма: " .. victimName, "DermaDefault", w/2, h - 5, color_white, TEXT_ALIGN_CENTER, TEXT_ALIGN_BOTTOM)
end
end
end