Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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])
- GUIEditor.button[10] = guiCreateButton(10, 572, 212, 18, "Получить стартовый набор", false, GUIEditor.window[1])
- guiSetVisible ( GUIEditor.window[1], false )
- end
- )
- function refreshInventory (localPlayer)
- local weight = 0
- outputChatBox ( "Инвентарь: вывод имени", localPlayer )
- guiSetText ( GUIEditor.window[1], "Инвентарь: " .. getPlayerName(localPlayer))
- outputChatBox ( "Инвентарь: загрузка праймари", localPlayer )
- if getElementData(localPlayer, "dayz.primary_weapon_slot") then
- guiSetText ( GUIEditor.button[5], items[getElementData(localPlayer, "dayz.primary_weapon_slot")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.primary_weapon_slot")][2]
- else
- guiSetText ( GUIEditor.button[5], "пусто" )
- end
- outputChatBox ( "Инвентарь: загрузка секонд", localPlayer )
- if getElementData(localPlayer, "dayz.second_weapon_slot") then
- guiSetText ( GUIEditor.button[3], items[getElementData(localPlayer, "dayz.second_weapon_slot")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.second_weapon_slot")][2]
- else
- guiSetText ( GUIEditor.button[3], "пусто" )
- end
- if getElementData(localPlayer, "dayz.special_weapon_slot") then
- guiSetText ( GUIEditor.button[6], items[getElementData(localPlayer, "dayz.special_weapon_slot")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.special_weapon_slot")][2]
- else
- guiSetText ( GUIEditor.button[6], "пусто" )
- end
- if getElementData(localPlayer, "dayz.fast_slot1") then
- guiSetText ( GUIEditor.button[7], items[getElementData(localPlayer, "dayz.fast_slot1")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.fast_slot1")][2]
- else
- guiSetText ( GUIEditor.button[7], "пусто" )
- end
- if getElementData(localPlayer, "dayz.fast_slot2") then
- guiSetText ( GUIEditor.button[8], items[getElementData(localPlayer, "dayz.fast_slot2")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.fast_slot2")][2]
- else
- guiSetText ( GUIEditor.button[8], "пусто" )
- end
- if getElementData(localPlayer, "dayz.fast_slot3") then
- guiSetText ( GUIEditor.button[9], items[getElementData(localPlayer, "dayz.fast_slot3")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.fast_slot3")][2]
- else
- guiSetText ( GUIEditor.button[9], "пусто" )
- end
- if getElementData(localPlayer, "dayz.mask_slot") then
- guiSetText ( GUIEditor.button[4], items[getElementData(localPlayer, "dayz.mask_slot")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.mask_slot")][2]
- else
- guiSetText ( GUIEditor.button[4], "пусто" )
- end
- if getElementData(localPlayer, "dayz.armor_slot") then
- guiSetText ( GUIEditor.button[2], items[getElementData(localPlayer, "dayz.armor_slot")][1] )
- weight = weight + items[getElementData(localPlayer, "dayz.armor_slot")][2]
- else
- guiSetText ( GUIEditor.button[2], "пусто" )
- end
- guiSetText ( GUIEditor.label[1], "Вес: " .. weight .."/ 228кг." )
- end
- function showInventory (localPlayer)
- outputChatBox ( "Открытие инвентаря")
- 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(localPlayer)
- end
- end
- bindKey ( "i", "down", showInventory, localPlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement