Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- The queue for the rendered icons.
- ICON_RENDER_QUEUE = ICON_RENDER_QUEUE or {}
- -- To make making inventory variant, This must be followed up.
- local function RenderNewIcon(panel, itemTable)
- local model = itemTable:GetModel()
- -- re-render icons
- if ((itemTable.iconCam and !ICON_RENDER_QUEUE[string.lower(model)]) or itemTable.forceRender) then
- local iconCam = itemTable.iconCam
- iconCam = {
- cam_pos = iconCam.pos,
- cam_ang = iconCam.ang,
- cam_fov = iconCam.fov,
- }
- ICON_RENDER_QUEUE[string.lower(model)] = true
- panel.Icon:RebuildSpawnIconEx(
- iconCam
- )
- end
- end
- local function InventoryAction(action, itemID, invID, data)
- net.Start("ixInventoryAction")
- net.WriteString(action)
- net.WriteUInt(itemID, 32)
- net.WriteUInt(invID, 32)
- net.WriteTable(data or {})
- net.SendToServer()
- end
- /*timer.Simple(0, function()
- netstream.Hook("dc_updateinventory", function(data)
- LocalPlayer().
- end)
- end)*/
- local PANEL = {}
- local bgMat = Material("dc_inventory/inventoryBG3.png")
- local lockArtMat = Material("dc_inventory/lockartefact.png")
- local hClr3 = Color(200,0,0)
- local hClr2 = Color(122, 78, 2)
- local hClr1 = Color(0, 200, 0)
- local function createSlot(frame, item, hp, showbar)
- local pnl = vgui.Create("ixSpawnIcon", frame)
- pnl.OnMousePressed = function(s)
- local derma = DermaMenu(false, s)
- derma:AddOption(L("unequip"), function()
- netstream.Start("dc_unequipitem", item.Type)
- end)
- derma:Open()
- end
- if (showbar == nil) or (showbar == true) then
- local health = vgui.Create("DPanel", pnl)
- health:Dock(BOTTOM)
- --health:DockMargin(21, 0, 16.5, 0)
- --health:SetPos(pnl:GetWide()/2, pnl:GetTall()-5)
- health:SetTall(4)
- health:TDLib():ClearPaint()
- --:Background(Color(10,10,10,250), 5)
- local maxHp = item:GetMaxHealth()
- local val = (hp/maxHp)
- health:On("Paint", function(s,w,h)
- val = (hp/maxHp)
- surface.SetDrawColor(((val > .6) and hClr1) or ((val >= .4) and hClr2) or hClr3)
- local x = w/2-w*.25
- //local off = 2 / (hp/maxHp)
- for i=1, math.Clamp(30*(hp/maxHp), 0, maxHp) do
- surface.DrawRect(x, -10, 1, h+20)
- x = x + 3
- end
- x= nil
- end)
- end
- return pnl
- end
- local stats = {
- "Radiation",
- "Chemical",
- "Electrical",
- "Burn",
- "nil",
- "Rupture",
- "Bulletproof",
- "Stamina"
- }
- local camData = {
- pos = Vector(23.560106, 0.150427, 62.174870),
- ang = Angle(-2.404, -179.307, 0.000),
- fov = 50
- }
- local lPress = -1
- DC_FastSlots = DC_FastSlots or {}
- local rColor = Color(200,0,0)
- function PANEL:Init()
- self:SetDraggable(false)
- self:SetSizable(false)
- self:MakePopup()
- self:SetTitle("")
- self:ShowCloseButton(false)
- surface.PlaySound("dc_inventory/inv_open.ogg")
- self.InitTime = CurTime() + .5
- end
- function PANEL:Load()
- gui.EnableScreenClicker(true)
- local char = LocalPlayer():GetCharacter()
- local facName = ix.faction.Get(LocalPlayer():Team()).name
- local icon = ikon:GetIcon(string.Replace(LocalPlayer():GetModel(), "/", "_"))
- self:TDLib():ClearPaint()
- :Material(bgMat)
- :On("Paint", function(s,w,h)
- local w2, h2 = draw.SimpleText(char:GetName(), "ixMenuButtonFont", w*.45, h*.015, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
- draw.SimpleText(char:GetMoney().." RUB", "ixMonoMediumFont", w*.66, h*.092, color_white, TEXT_ALIGN_RIGHT, TEXT_ALIGN_TOP)
- draw.SimpleText(facName, "ixMenuButtonFontSmall", w*.45, h*.015 + h2 + 1, color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_TOP)
- w2,h2 = nil, nil
- --w22, h22 = nil, nil
- --s:SetCursor("arrow")
- if not icon or icon:IsError() then
- icon = ikon:GetIcon(string.Replace(LocalPlayer():GetModel(), "/", "_"))
- end
- if (icon) then
- surface.SetMaterial(icon)
- surface.SetDrawColor(color_white)
- surface.DrawTexturedRect(w-w*.3, 15, 100,80)
- else
- ikon:renderIcon(
- string.Replace(LocalPlayer():GetModel(), "/", "_"),
- 2,
- 2,
- LocalPlayer():GetModel(),
- camData
- )
- end
- local carry = char:GetData("carry", 0)
- local max = ix.weight.BaseWeight(char)
- draw.SimpleText(carry, "ixMonoMediumFont", w-(w*.33), h-(h*.017), carry >= max-10 and rColor or color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM)
- draw.SimpleText(max, "ixMonoMediumFont", w-(w*.242), h-(h*.017), color_white, TEXT_ALIGN_LEFT, TEXT_ALIGN_BOTTOM)
- carry, max = nil, nil
- end)
- local bglPanel = vgui.Create("DPanel", self)
- --bglPanel:TDLib():ClearPaint()
- bglPanel:SetPos(0,0)
- bglPanel:SetTall(self:GetTall()*.498)
- bglPanel:SetWide(self:GetWide()*.42)
- bglPanel:TDLib():ClearPaint()
- local statsData = char:GetData("dc_stats", nil)
- statsData = statsData ~= nil and util.JSONToTable(statsData) or {}
- local weapon1, weapon2, body, head, knife, ll, rr
- local function updateSlots()
- if IsValid(ll) then ll:Remove() end
- if IsValid(rr) then rr:Remove() end
- --local char = LocalPlayer():GetCharacter()
- local data = char:GetData("dc_inventory", nil)
- data = data ~= nil and util.JSONToTable(data) or nil
- statsData = char:GetData("dc_stats", nil)
- statsData = statsData ~= nil and util.JSONToTable(statsData) or {}
- // Weapon 1
- if not data or not data.weapon1 or (data.weapon1.id == "") then
- weapon1 = vgui.Create("DPanel", bglPanel)
- weapon1:Dock(LEFT)
- weapon1:SetWide(bglPanel:GetWide()*.35)
- weapon1:DockPadding(bglPanel:GetWide()*.035,0,bglPanel:GetWide()*.035,0)
- weapon1.Paint = function() end
- else
- local i = ix.item.Get(data.weapon1.id)
- weapon1 = createSlot(bglPanel, i, data.weapon1.health)
- weapon1:SetModel(ix.item.Get(data.weapon1.id).model)
- weapon1:Dock(LEFT)
- weapon1:SetWide(bglPanel:GetWide()*.3)
- weapon1:DockPadding(bglPanel:GetWide()*.035,0,bglPanel:GetWide()*.035,0)
- if i.iconCam then
- weapon1:SetCamPos(i.iconCam.pos)
- weapon1:SetFOV(i.iconCam.fov)
- weapon1:SetLookAng(i.iconCam.ang)
- end
- end
- // Weapon 2
- if not data or not data.weapon2 or (data.weapon2.id == "") then
- weapon2 = vgui.Create("DPanel", bglPanel)
- weapon2:Dock(RIGHT)
- weapon2:SetWide(bglPanel:GetWide()*.32)
- weapon2:DockPadding(0, 0, bglPanel:GetWide()*.07, 0)
- weapon2.Paint = function() end
- else
- local i = ix.item.Get(data.weapon2.id)
- weapon2 = createSlot(bglPanel, i, data.weapon2.health)
- weapon2:SetModel(i.model)
- weapon2:Dock(RIGHT)
- weapon2:SetWide(bglPanel:GetWide()*.32)
- weapon2:DockPadding(0, 0, bglPanel:GetWide()*.07, 0)
- if i.iconCam then
- weapon2:SetCamPos(i.iconCam.pos)
- weapon2:SetFOV(i.iconCam.fov)
- weapon2:SetLookAng(i.iconCam.ang)
- end
- end
- // Knife
- if not data or not data.knife or (data.knife.id == "") then
- knife = vgui.Create("DPanel", bglPanel)
- knife:Dock(BOTTOM)
- knife:SetTall(bglPanel:GetTall()*.17)
- knife.Paint = function() end
- else
- local i = ix.item.Get(data.knife.id)
- knife = createSlot(bglPanel, i, data.knife.health, false)
- knife:SetModel(i.model)
- knife:Dock(BOTTOM)
- knife:SetTall(bglPanel:GetTall()*.17)
- --knife:DockPadding(12, 10, 9, 30)
- if i.iconCam then
- knife:SetCamPos(i.iconCam.pos)
- knife:SetFOV(i.iconCam.fov)
- knife:SetLookAng(i.iconCam.ang)
- end
- end
- // Head
- if not data or not data.head or (data.head.id == "") then
- head = vgui.Create("DPanel", bglPanel)
- head:Dock(TOP)
- head:SetTall(bglPanel:GetWide()*.34)
- head.Paint = function() end
- else
- local i = ix.item.Get(data.head.id)
- head = createSlot(bglPanel, i, data.head.health)
- head:SetModel(i.model)
- head:Dock(TOP)
- head:SetTall(bglPanel:GetWide()*.34)
- --head:DockPadding(12, 10, 9, 10)
- if i.iconCam then
- head:SetCamPos(i.iconCam.pos)
- head:SetFOV(i.iconCam.fov)
- head:SetLookAng(i.iconCam.ang)
- end
- head:DockMargin(10, 10, 10, 10)
- end
- // Body
- if not data or not data.body or (data.body.id == "") then
- body = vgui.Create("DPanel", bglPanel)
- body:Dock(FILL)
- body.Paint = function() end
- --body:DockMargin(39, 0, 30, 7)
- else
- body = createSlot(bglPanel, ix.item.Get(data.body.id), data.body.health)
- ll = vgui.Create("DPanel", bglPanel)
- ll:Dock(LEFT)
- ll:SetWide(bglPanel:GetWide()*.05)
- ll.Paint = function() end
- rr = vgui.Create("DPanel", bglPanel)
- rr:Dock(RIGHT)
- rr:SetWide(bglPanel:GetWide()*.05)
- rr.Paint = function() end
- local i = ix.item.Get(data.body.id)
- body:SetModel(i.model)
- if i.iconCam then
- body:SetCamPos(i.iconCam.pos)
- body:SetFOV(i.iconCam.fov)
- body:SetLookAng(i.iconCam.ang)
- end
- body:Dock(FILL)
- --body:SetTall(bglPanel:GetTall()*.1)
- body:DockMargin(0, 0, bglPanel:GetWide()*.03, bglPanel:GetTall()*.016)
- end
- end
- -- Быстрые слоты
- local fastSlotsBG = vgui.Create("DPanel", self)
- fastSlotsBG:SetPos(15,bglPanel:GetTall()+2)
- fastSlotsBG:SetTall(self:GetTall()*.1)
- fastSlotsBG:SetWide(self:GetWide()*.4)
- fastSlotsBG:TDLib():ClearPaint()
- -- Артефакты
- local artBG = vgui.Create("DPanel", self)
- artBG:SetPos(bglPanel:GetWide()*.03,bglPanel:GetTall()+2 + fastSlotsBG:GetTall() + (self:GetTall() * 0.01))
- artBG:SetTall(self:GetTall()*.085)
- artBG:SetWide(self:GetWide()*.4)
- artBG:TDLib():ClearPaint()
- local slots = {}
- local function UpdateFastSlots()
- for k, v in ipairs(slots) do
- if IsValid(v) then v:Remove() end
- end
- local charid = char:GetID()
- if not DC_FastSlots[charid] and file.Exists("dc_fastslots.json", "DATA") then
- DC_FastSlots = util.JSONToTable(file.Read("dc_fastslots.json", "DATA"))
- end
- if not DC_FastSlots[charid] then
- DC_FastSlots[charid] = {
- [1] = {model = "", itemid = ""},
- [2] = {model = "", itemid = ""},
- [3] = {model = "", itemid = ""},
- [4] = {model = "", itemid = ""},
- }
- end
- -- Быстрые слоты
- for i,v in ipairs(DC_FastSlots[charid]) do
- slots[i] = v.model ~= "" and vgui.Create("ixSpawnIcon", fastSlotsBG) or vgui.Create("DPanel", fastSlotsBG)
- slots[i]:Dock(LEFT)
- slots[i]:DockMargin(i ~= 1 and 4 or 0, 0, 0, 0)
- slots[i]:SetWide(fastSlotsBG:GetWide()*.24)
- if v.model ~= "" then
- slots[i]:SetModel(v.model)
- slots[i].OnMousePressed = function(s)
- local derma = DermaMenu(false, s)
- derma:AddOption(L("unequip"), function()
- DC_FastSlots[charid][i] = {model = "", itemid = ""}
- file.Write("dc_fastslots.json", util.TableToJSON(DC_FastSlots))
- UpdateFastSlots()
- end)
- derma:Open()
- end
- else
- slots[i].Paint = function() end
- end
- slots[i]:Receiver("ixInventoryItem", function(s, panels, bDropped, menuIndex, x, y)
- local panel = panels[1]
- if (!IsValid(panel)) then
- return
- end
- if (bDropped) then
- local data = panel.itemTable
- if not data.canFastSlot then return end
- DC_FastSlots[charid][i] = {model = data.model, itemid = data.uniqueID}
- file.Write("dc_fastslots.json", util.TableToJSON(DC_FastSlots))
- UpdateFastSlots()
- end
- end)
- end
- end
- -- Артефакты функция
- local artSlots = {}
- local function UpdateArtSlots()
- if not IsValid(self) then return end
- local data = char:GetData("dc_inventory", nil)
- data = data ~= nil and util.JSONToTable(data) or nil
- local slotCount = data.body.id ~= "" and ix.item.Get(data.body.id).info.Arts or 0
- local artData = char:GetData("dc_arts", {})
- --local filtredArt = {}
- statsData = char:GetData("dc_stats", nil)
- statsData = statsData ~= nil and util.JSONToTable(statsData) or {}
- /*for k, v in pairs(artData) do
- if (v == nil) or (v == "") then continue end
- local item = ix.item.Get(v)
- if not item then continue end
- table.insert(filtredArt, {model = item.model})
- end*/
- local artKeys = {}
- local i2 = 1
- for k, v in pairs(artData) do
- artKeys[i2] = v == nil and {} or {id = k, class = v}
- i2 = i2 + 1
- end
- for i=1, 5 do
- if IsValid(artSlots[i]) then artSlots[i]:Remove() end
- local notEmpty = artKeys[i] ~= nil and artKeys[i].class ~= nil
- artSlots[i] = slotCount >= i and notEmpty and vgui.Create("ixSpawnIcon", artBG) or vgui.Create("DPanel", artBG)
- artSlots[i]:Dock(LEFT)
- artSlots[i]:DockMargin(i ~= 1 and 4 or 1, 3, 1, 1)
- artSlots[i]:SetWide(artBG:GetWide()*.19)
- artSlots[i].OnMousePressed = function(s)
- if not artKeys[i].class then return end
- local derma = DermaMenu(false, s)
- derma:AddOption(L("unequip"), function()
- netstream.Start("dc_unequipart", artKeys[i].id)
- end)
- derma:Open()
- end
- if slotCount >= i then
- if notEmpty then
- local art = ix.item.Get(artKeys[i].class)
- if art then
- artSlots[i]:SetModel(art.model)
- --artSlots[i].itemid = artKeys[i].id
- end
- else
- artSlots[i]:TDLib():ClearPaint()
- end
- else
- artSlots[i]:TDLib():ClearPaint()
- :Material(lockArtMat)
- end
- end
- end
- UpdateFastSlots()
- updateSlots()
- UpdateArtSlots()
- -- Здоровье
- local healthBG = vgui.Create("DPanel", self)
- healthBG:SetPos(bglPanel:GetWide()*.038,bglPanel:GetTall()+2 + fastSlotsBG:GetTall() + 2 + artBG:GetTall() )
- healthBG:SetTall(self:GetTall()*.085)
- healthBG:SetWide(self:GetWide()*.39)
- healthBG:TDLib():ClearPaint()
- -- Полоса здоровья
- local health = vgui.Create("DPanel", healthBG)
- health:SetPos(0, healthBG:GetTall() - (healthBG:GetTall()*.38))
- health:SetSize(healthBG:GetWide()*.68, healthBG:GetTall()*.3)
- local lp = LocalPlayer()
- local off = 2 /// (lp:Health()/lp:GetMaxHealth())
- health.Paint = function(s,w,h)
- surface.SetDrawColor(hClr3)
- local x = 1
- local hp = lp:Health()
- for i=1, hp do
- surface.DrawRect(x, 4, off, h-4)
- x = x + off + 2
- end
- x, hp = nil, nil
- end
- -- Радиация
- local radiation = vgui.Create("DPanel", healthBG)
- radiation:Dock(RIGHT)
- radiation:DockMargin(20, 20, -10, 10)
- radiation:SetWide(healthBG:GetWide()*.14)
- radiation:TDLib():ClearPaint()
- -- кровотечение
- local blooding = vgui.Create("DPanel", healthBG)
- blooding:Dock(RIGHT)
- blooding:DockMargin(20, 20, -10, 10)
- blooding:SetWide(healthBG:GetWide()*.145)
- blooding:TDLib():ClearPaint()
- -- Статистика
- local statsBG = vgui.Create("DPanel", self)
- statsBG:SetPos(bglPanel:GetWide()*.105,bglPanel:GetTall() + fastSlotsBG:GetTall() + artBG:GetTall() + healthBG:GetTall() + (healthBG:GetTall()*.31))
- statsBG:SetTall(self:GetTall()*.143)
- statsBG:SetWide(self:GetWide()*.42)
- --statsBG:TDLib():ClearPaint()
- local wide = statsBG:GetWide()*.36
- local tall = statsBG:GetTall() * .15
- local statLen = #stats
- --statsBG:SetTooltip( "" )
- --local str = ""
- --statsBG:SetTooltip( str )
- statsBG:SetHelixTooltip(function(tooltip)
- local name2 = tooltip:AddRow(L"statistic")
- name2:SetImportant()
- name2:SetText(L"statistic")
- name2:SizeToContents()
- local name = tooltip:AddRow(2)
- --name:SetImportant()
- local str = ""
- for i=1, statLen do
- if L(stats[i]) == "nil" then continue end
- str = str..L(stats[i])..": "..(statsData[stats[i]] ~= nil and statsData[stats[i]]*100 or "0").."%"..(i ~= statLen and "\n" or "")
- --name:SetText(L(stats[i])..": "..(statsData[stats[i]] ~= nil and statsData[stats[i]]*100 or "0").."%")
- --name:SetBackgroundColor(color_white)
- -- name:SizeToContents()
- end
- name:SetText(str)
- name:SizeToContents()
- tooltip:SizeToContents()
- end)
- statsBG.Paint = function(s,w,h)
- if s:IsHovered() then s:SetCursor('hand') end
- surface.SetDrawColor(color_white)
- local x, y = 5, 6
- for i=1, statLen do
- if (statsData[stats[i]] ~= nil) and statsData[stats[i]] ~= 0 then
- if statsData[stats[i]] < 0 then
- surface.SetDrawColor(hClr3)
- end
- local len = statsData[stats[i]]*100
- local absLen = math.abs(len)
- local off = 2//.02 / (absLen/1200)
- local x2 = x
- for i=1, math.Clamp(absLen, 0, 100) do
- surface.DrawRect(x2, y, off, tall)
- x2 = x2 + off + 1
- end
- end
- y = y + tall + tall * .71
- if i == 4 then
- y = 6
- x = x + wide + wide*.3
- end
- end
- end
- netstream.Hook("dc_artefactupdate", function()
- UpdateArtSlots()
- end)
- netstream.Hook("DC_OnItemEquipped", function()
- if not IsValid(weapon1) then return end
- weapon1:Remove()
- weapon2:Remove()
- body:Remove()
- head:Remove()
- knife:Remove()
- updateSlots()
- UpdateArtSlots()
- end)
- local bgPanel = vgui.Create("DPanel", self)
- bgPanel:TDLib():ClearPaint()
- timer.Simple(0.01, function()
- if not IsValid(self) then return end
- bgPanel:SetPos(self:GetWide()*.448, self:GetTall()*.15)
- bgPanel:SetSize(self:GetWide()*.45,self:GetTall()*.77)
- local canvas = bgPanel:Add("DScrollPanel")
- local canvasLayout = canvas.PerformLayout
- canvas.PerformLayout = nil -- we'll layout after we add the panels instead of each time one is added
- canvas:Dock(FILL)
- canvas:MoveToFront()
- ix.gui.menuInventoryContainer = canvas
- local panel = canvas:Add("ixInventory")
- panel:SetPos(0, 0)
- panel:MoveToFront()
- panel:SetDraggable(false)
- panel:SetSizable(false)
- panel:SetTitle(nil)
- panel.bNoBackgroundBlur = true
- panel.childPanels = {}
- panel:TDLib():ClearPaint()
- panel.iconSize = ScrW()*.0347
- local inventory = LocalPlayer():GetCharacter():GetInventory()
- if (inventory) then
- panel:SetInventory(inventory)
- end
- ix.gui.inv1 = panel
- if (ix.option.Get("openBags", true)) then
- for _, v in pairs(inventory:GetItems()) do
- if (!v.isBag) then
- continue
- end
- v.functions.View.OnClick(v)
- end
- end
- canvas.PerformLayout = canvasLayout
- end)
- end
- function PANEL:Think()
- if self.InitTime >= CurTime() then return end
- if input.IsKeyDown(KEY_I) or input.IsKeyDown(KEY_ESCAPE) then
- surface.PlaySound("dc_inventory/inv_close.ogg")
- self:Remove()
- lPress = CurTime() + .5
- end
- end
- function PANEL:OnRemove()
- gui.EnableScreenClicker(false)
- end
- vgui.Register("dc_inventory", PANEL, "DFrame")
- local inv
- local function openInv()
- if IsValid(inv) then lPress = CurTime() + 1 return end
- if LocalPlayer():GetCharacter() == nil then return end
- inv = vgui.Create("dc_inventory")
- inv:SetPos(ScrW()-ScrW()*.62, 0)
- inv:SetSize(ScrW()*.62, ScrH())
- inv:Load()
- lPress = CurTime() + 1
- end
- local function InventoryAction(action, itemID, invID, data)
- net.Start("ixInventoryAction")
- net.WriteString(action)
- net.WriteUInt(itemID, 32)
- net.WriteUInt(invID, 32)
- net.WriteTable(data or {})
- net.SendToServer()
- end
- function PLUGIN:PlayerButtonDown( ply, btn )
- if ply ~= LocalPlayer() then return end
- if btn == KEY_I and (lPress < CurTime()) then
- --lPress = CurTime() + .35
- openInv()
- end
- if (btn == KEY_F1) then
- local char = ply:GetCharacter()
- local charID = char:GetID()
- if DC_FastSlots[charID] and DC_FastSlots[charID][1] and DC_FastSlots[charID][1].model ~= "" then
- local item = char:GetInventory():HasItem(DC_FastSlots[charID][1].itemid)
- if item then
- InventoryAction("use", item.id, char:GetInventory():GetID())
- end
- end
- end
- if (btn == KEY_F2) then
- local char = ply:GetCharacter()
- local charID = char:GetID()
- if DC_FastSlots[charID] and DC_FastSlots[charID][2] and DC_FastSlots[charID][2].model ~= "" then
- local item = char:GetInventory():HasItem(DC_FastSlots[charID][2].itemid)
- if item then
- InventoryAction("use", item.id, char:GetInventory():GetID())
- end
- end
- end
- if (btn == KEY_F3) then
- local char = ply:GetCharacter()
- local charID = char:GetID()
- if DC_FastSlots[charID] and DC_FastSlots[charID][3] and DC_FastSlots[charID][3].model ~= "" then
- local item = char:GetInventory():HasItem(DC_FastSlots[charID][1].itemid)
- if item then
- InventoryAction("use", item.id, char:GetInventory():GetID())
- end
- end
- end
- if (btn == KEY_F4) then
- local char = ply:GetCharacter()
- local charID = char:GetID()
- if DC_FastSlots[charID] and DC_FastSlots[charID][4] and DC_FastSlots[charID][4].model ~= "" then
- local item = char:GetInventory():HasItem(DC_FastSlots[charID][4].itemid)
- if item then
- InventoryAction("use", item.id, char:GetInventory():GetID())
- end
- end
- end
- end
- do
- local COMMAND = {
- description = "Открыть инвентарь.",
- superAdminOnly = false
- }
- function COMMAND:OnRun(client)
- openInv()
- end
- ix.command.Add("openinventory", COMMAND)
- end
Add Comment
Please, Sign In to add comment