Guest User

Untitled

a guest
Dec 12th, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.98 KB | None | 0 0
  1. GUIEditor = {
  2.     gridlist = {},
  3.     button = {},
  4.     window = {},
  5. }
  6. addEventHandler("onClientResourceStart", resourceRoot,
  7.     function()
  8.         GUIEditor.window[1] = guiCreateWindow(14, 171, 389, 427, "Inventar", false)
  9.         guiWindowSetSizable(GUIEditor.window[1], false)
  10.         guiSetAlpha(GUIEditor.window[1], 0.84)
  11.         guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF102489")
  12.  
  13.         GUIEditor.gridlist[1] = guiCreateGridList(9, 26, 266, 388, false, GUIEditor.window[1])
  14.         local col1 = guiGridListAddColumn(GUIEditor.gridlist[1], "Item", 0.4)
  15.         local col2 = guiGridListAddColumn(GUIEditor.gridlist[1], "Anzahl", 0.4)
  16.         guiSetAlpha(GUIEditor.gridlist[1], 0.74)
  17.         GUIEditor.button[2] = guiCreateButton(280, 36, 90, 25, "Benutzen", false, GUIEditor.window[1])
  18.         GUIEditor.button[3] = guiCreateButton(280, 71, 90, 25, "Zurücklegen", false, GUIEditor.window[1])
  19.         GUIEditor.button[4] = guiCreateButton(280, 392, 89, 25, "Wegwerfen", false, GUIEditor.window[1])
  20.         GUIEditor.button[5] = guiCreateButton(280, 124, 90, 25, "Ausrüsten", false, GUIEditor.window[1])
  21.         guiSetVisible(GUIEditor.window[1], false)
  22.     end
  23. )
  24.  
  25. function invSetting()
  26. updateInventory()
  27.     if guiGetVisible(GUIEditor.window[1]) == true then
  28.         guiSetVisible(GUIEditor.window[1], false)
  29.     else
  30.         guiSetVisible(GUIEditor.window[1], true)
  31.     end
  32. end
  33.  
  34. function join()
  35. bindKey("i", "down", invSetting)
  36. end
  37. addEventHandler("onClientResourceStart", getRootElement(), join)
  38. addCommandHandler("rebind", join)
  39.  
  40. function updateInventory()
  41. local data = getAllElementData ( localPlayer )
  42.         for k, v in pairs ( data ) do
  43.             local rowName = guiGridListAddRow ( GUIEditor.gridlist[1] )
  44.             guiGridListSetItemText ( GUIEditor.gridlist[1], rowName, gridColoumn[1], tostring(k), false, false )
  45.             local rowCount = guiGridListAddRow ( GUIEditor.gridlist[1] )
  46.             guiGridListSetItemText ( GUIEditor.gridlist[1], rowCount, gridColoumn[2], tostring(v), false, false )
  47.         end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment