Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local window;
- local gridlist;
- local button = {};
- function createWindow()
- window = guiCreateWindow(0.33, 0.17, 0.41, 0.60, "Przebieralnia SFPD", true)
- guiWindowSetMovable(window, false)
- guiWindowSetSizable(window, false)
- gridlist = guiCreateGridList(0.02, 0.05, 0.53, 0.93, true, window)
- guiGridListAddColumn(gridlist, "ID Skina", 0.25)
- guiGridListAddColumn(gridlist, "Ranga", 0.35)
- button[1] = guiCreateButton(0.60, 0.07, 0.35, 0.11, "Wybierz skina", true, window)
- button[2] = guiCreateButton(0.60, 0.21, 0.35, 0.11, "Zamknij", true, window)
- end;
- function openWindow()
- showCursor(true)
- triggerServerEvent('getAvaibleSkins', resourceRoot, localPlayer)
- createWindow()
- end;
- function closeWindow()
- showCursor(false)
- if window and isElement(window) then
- destroyElement(window)
- end
- end;
- function onClick()
- if source == button[1] then
- local row = guiGridListGetSelectedItem(gridlist)
- local id = guiGridListGetItemText(gridlist, row, 1)
- local nazwa = guiGridListGetItemText(gridlist, row, 2)
- triggerServerEvent('setPlayerSkin', resourceRoot, localPlayer, id, nazwa)
- elseif source == button[2] then
- closeWindow()
- end
- end;
- function addSkinToGridList(id,nazwa)
- if id and nazwa then
- local row = guiGridListAddRow(gridlist)
- guiGridListSetItemText(gridlist, row, 1, id, false, false)
- guiGridListSetItemText(gridlist, row, 2, nazwa, false, false)
- end
- end;
- addEvent('openGUI', true);
- addEvent('addSkinToGridList', true);
- addEventHandler('openGUI', resourceRoot, function(...) openWindow(...) end);
- addEventHandler('addSkinToGridList', resourceRoot, function(...) addSkinToGridList(...) end);
- addEventHandler('onClientGUIClick', resourceRoot, function(...) onClick(...) end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement