Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local items =
- {
- {"AK47", 4.8},
- {"Магазин AK47",0.3},
- {"Полицейская форма", 1},
- {"Аптечка", 1},
- {"Бинт", 1},
- {"Хлеб",1},
- {"Вода",1}
- }
- local playerDataTable =
- {
- "dayz.save_x",
- "dayz.save_y",
- "dayz.save_z",
- "dayz.primary_weapon_slot",
- "dayz.second_weapon_slot",
- "dayz.fast_slot1",
- "dayz.fast_slot2",
- "dayz.fast_slot3",
- "dayz.mask_slot",
- "dayz.armor_slot"
- }
- GUIEditor = {
- gridlist = {},
- window = {},
- button = {},
- label = {}
- }
- addEventHandler("onClientResourceStart", resourceRoot,
- function()
- local screenW, screenH = guiGetScreenSize()
- GUIEditor.window[1] = guiCreateWindow((screenW - 528) / 2, (screenH - 600) / 2, 528, 600, "Статистика", false)
- guiWindowSetSizable(GUIEditor.window[1], false)
- guiSetAlpha(GUIEditor.window[1], 0.59)
- GUIEditor.gridlist[1] = guiCreateGridList(232, 24, 286, 552, false, GUIEditor.window[1])
- guiGridListAddColumn(GUIEditor.gridlist[1], "название", 0.3)
- guiGridListAddColumn(GUIEditor.gridlist[1], "количество", 0.3)
- guiGridListAddColumn(GUIEditor.gridlist[1], "вес", 0.3)
- guiGridListAddRow(GUIEditor.gridlist[1])
- guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "AK47", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], 0, 2, "1", false, false)
- guiGridListSetItemText(GUIEditor.gridlist[1], 0, 3, "4.8", false, false)
- GUIEditor.button[1] = guiCreateButton(-230, 7, 107, 97, "", false, GUIEditor.gridlist[1])
- GUIEditor.label[1] = guiCreateLabel(232, 576, 286, 14, "Слоты: 1/8шт. Вес 4.8/50 кг", false, GUIEditor.window[1])
- guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false)
- GUIEditor.button[2] = guiCreateButton(84, 98, 64, 138, "armor", false, GUIEditor.window[1])
- GUIEditor.button[3] = guiCreateButton(10, 24, 64, 286, "second weapon", false, GUIEditor.window[1])
- GUIEditor.button[4] = guiCreateButton(84, 24, 64, 64, "mask", false, GUIEditor.window[1])
- GUIEditor.button[5] = guiCreateButton(158, 24, 64, 286, "primary weapon", false, GUIEditor.window[1])
- GUIEditor.button[6] = guiCreateButton(84, 246, 64, 64, "special", false, GUIEditor.window[1])
- GUIEditor.button[7] = guiCreateButton(10, 320, 64, 64, "F1", false, GUIEditor.window[1])
- GUIEditor.button[8] = guiCreateButton(84, 320, 64, 64, "F2", false, GUIEditor.window[1])
- GUIEditor.button[9] = guiCreateButton(158, 320, 64, 64, "F3", false, GUIEditor.window[1])
- guiSetVisible ( GUIEditor.window[1], false )
- end
- )
- function refreshInventory ( source )
- local weight = 0
- guiSetText ( GUIEditor.window[1], "Инвентарь: " .. getPlayerName(getLocalPlayer()))
- if getElementData(getLocalPlayer(), "dayz.primary_weapon_slot") then
- guiSetText ( GUIEditor.button[5], items[getElementData(source, "dayz.primary_weapon_slot")][1] )
- weight = weight + items[getElementData(getLocalPlayer(), "dayz.primary_weapon_slot")][2]
- else
- guiSetText ( GUIEditor.button[5], "пусто" )
- end
- --[[
- if getElementData(source, "dayz.second_weapon_slot") then
- guiSetText ( GUIEditor.button[3], items[getElementData(source, "dayz.second_weapon_slot")][1] )
- weight = weight + items[getElementData(source, "dayz.second_weapon_slot")][2]
- else
- guiSetText ( GUIEditor.button[3], "пусто" )
- end
- if getElementData(source, "dayz.special_weapon_slot") then
- guiSetText ( GUIEditor.button[6], items[getElementData(source, "dayz.special_weapon_slot")][1] )
- weight = weight + items[getElementData(source, "dayz.special_weapon_slot")][2]
- else
- guiSetText ( GUIEditor.button[6], "пусто" )
- end
- if getElementData(source, "dayz.fast_slot1") then
- guiSetText ( GUIEditor.button[7], items[getElementData(source, "dayz.fast_slot1")][1] )
- weight = weight + items[getElementData(source, "dayz.fast_slot1")][2]
- else
- guiSetText ( GUIEditor.button[7], "пусто" )
- end
- if getElementData(source, "dayz.fast_slot2") then
- guiSetText ( GUIEditor.button[8], items[getElementData(source, "dayz.fast_slot2")][1] )
- weight = weight + items[getElementData(source, "dayz.fast_slot2")][2]
- else
- guiSetText ( GUIEditor.button[8], "пусто" )
- end
- if getElementData(source, "dayz.fast_slot3") then
- guiSetText ( GUIEditor.button[9], items[getElementData(source, "dayz.fast_slot3")][1] )
- weight = weight + items[getElementData(source, "dayz.fast_slot3")][2]
- else
- guiSetText ( GUIEditor.button[9], "пусто" )
- end
- if getElementData(source, "dayz.mask_slot") then
- guiSetText ( GUIEditor.button[4], items[getElementData(source, "dayz.mask_slot")][1] )
- weight = weight + items[getElementData(source, "dayz.mask_slot")][2]
- else
- guiSetText ( GUIEditor.button[4], "пусто" )
- end
- if getElementData(source, "dayz.armor_slot") then
- guiSetText ( GUIEditor.button[2], items[getElementData(source, "dayz.armor_slot")][1] )
- weight = weight + items[getElementData(source, "dayz.armor_slot")][2]
- else
- guiSetText ( GUIEditor.button[2], "пусто" )
- end
- ]]--
- guiSetText ( GUIEditor.label[1], "Вес: " .. weight .."/ 228кг." )
- end
- function showInventory ( )
- if ( guiGetVisible ( GUIEditor.window[1] ) == true ) then -- check if the gui element is visible
- guiSetVisible ( GUIEditor.window[1], false ) -- if it is, we hide it
- showCursor(false)
- else
- guiSetVisible ( GUIEditor.window[1], true ) -- if not, we make it visible
- showCursor(true)
- refreshInventory(source)
- end
- end
- bindKey ( "i", "down", showInventory, getLocalPlayer() )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement