Fox261098 Posted May 14, 2016 Share Posted May 14, 2016 (edited) Hello i made an gui with some buttons but i dont know how to add functions to that buttons.Pls can somone put it in this code GUIEditor = { button = {}, window = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(0, 4, 544, 413, "Mini admin panel.By LuckyDude", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetProperty(GUIEditor.window[1], "CaptionColour", "FF7F7F7F") GUIEditor.edit[1] = guiCreateEdit(9, 266, 510, 126, "This is a new mini adminpanel.Made by LuckyDude", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(15, 29, 242, 82, "Flip Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "sa-header") GUIEditor.button[2] = guiCreateButton(15, 183, 242, 73, "Fix Vehicle", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "sa-header") GUIEditor.button[3] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[3], "sa-header") GUIEditor.button[4] = guiCreateButton(282, 29, 242, 73, "50k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[4], "sa-header") GUIEditor.button[5] = guiCreateButton(287, 183, 242, 73, "10k Money", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[5], "sa-header") end addCommandHandler ("mini",gui) ) addEventHandler("onClientRender", root, function() dxDrawText("Race Admin Panel", 60, 431, 501, 574, tocolor(0, 0, 0, 255), 2.00, "pricedown", "left", "top", false, false, false, false, false) dxDrawLine(60, 495, 435, 495, tocolor(60, 251, 16, 255), 4, false) end ) Edited May 15, 2016 by Guest Link to comment
BEN. Posted May 14, 2016 Share Posted May 14, 2016 https://wiki.multitheftauto.com/wiki/OnClientGUIClick Link to comment
BEN. Posted May 14, 2016 Share Posted May 14, 2016 https://wiki.multitheftauto.com/wiki/OnClientGUIClick local button1 = guiCreateButton(0.1,0.1,0.5,0.5,"Press",true) function example() --your code end addEventHandler("onClientGUIClick", button1, example, false) Link to comment
Fox261098 Posted May 15, 2016 Author Share Posted May 15, 2016 https://wiki.multitheftauto.com/wiki/OnClientGUIClick local button1 = guiCreateButton(0.1,0.1,0.5,0.5,"Press",true) function example() --your code end addEventHandler("onClientGUIClick", button1, example, false) Than you my friend. 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