Wormen Posted December 14, 2017 Share Posted December 14, 2017 شباب سويت لوحة و فيها جريد لست و فيها Row سويت أذا مختار رو محدد ,و ضغط ع زر Buy يساوي تريقر GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 359) / 2, (screenH - 314) / 2, 359, 314, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.gridlist[1] = guiCreateGridList(9, 25, 208, 279, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.9) for i = 1, 3 do guiGridListAddRow(GUIEditor.gridlist[1]) end local ls = guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Travel ticket", false, false) local lv = guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Travel ticket", false, false) local sf = guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "Travel ticket", false, false) GUIEditor.button[1] = guiCreateButton(221, 39, 126, 23, "Buy", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF30FE00") GUIEditor.button[2] = guiCreateButton(221, 72, 126, 23, "Close .", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFD0000") end ) addEventHandler("onClientGUIClick",getRootElement(), function () if ( source == GUIEditor.button[2] ) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif ( source == GUIEditor.button[1] ) then local r = guiGridListGetSelectedItem(ls) if (r) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent(send",getRootElement()) end end end) Link to comment
Doffy Posted December 14, 2017 Share Posted December 14, 2017 (edited) GUIEditor = { gridlist = {}, window = {}, button = {} } addEventHandler("onClientResourceStart", resourceRoot, function() local screenW, screenH = guiGetScreenSize() GUIEditor.window[1] = guiCreateWindow((screenW - 359) / 2, (screenH - 314) / 2, 359, 314, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.gridlist[1] = guiCreateGridList(9, 25, 208, 279, false, GUIEditor.window[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Name", 0.9) for i = 1, 3 do guiGridListAddRow(GUIEditor.gridlist[1]) end local ls = guiGridListSetItemText(GUIEditor.gridlist[1], 0, 1, "Travel ticket", false, false) local lv = guiGridListSetItemText(GUIEditor.gridlist[1], 1, 1, "Travel ticket", false, false) local sf = guiGridListSetItemText(GUIEditor.gridlist[1], 2, 1, "Travel ticket", false, false) GUIEditor.button[1] = guiCreateButton(221, 39, 126, 23, "Buy", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF30FE00") GUIEditor.button[2] = guiCreateButton(221, 72, 126, 23, "Close .", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFD0000") end ) addEventHandler("onClientGUIClick",root, function () if ( source == GUIEditor.button[2] ) then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif ( source == GUIEditor.button[1] ) then local r = guiGridListGetSelectedItem(GUIEditor.gridlist[1]) if ( r == 0 ) then -- اذا الرو الاول guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("ticket1", localPlayer) elseif ( r == 1 ) then -- اذا الرو الثاني guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("ticket2", localPlayer) elseif ( r == 2 ) then -- اذا الرو الثالث guiSetVisible(GUIEditor.window[1],false) showCursor(false) triggerServerEvent("ticket3", localPlayer) end end end) Edited December 14, 2017 by #Himoo Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now