marty000123 Posted April 14, 2017 Share Posted April 14, 2017 (edited) GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(597, 313, 734, 299, "Desert Clan Warfare - Choose a Team!", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(256, 60, 219, 41, "What team would you like to join?", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(25, 163, 231, 55, "Ghost Mercenaries", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(264, 161, 217, 57, "Special Military Unit", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(489, 163, 227, 55, "People's Protection Power", false, GUIEditor.window[1]) end) function spawn() setTimer( function() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end, 1000, 1) end addEvent("spawnpanel", true) addEventHandler("spawnpanel", localPlayer, spawn) Alright so how do I make it that it doesn't show when the resource starts, but when the ''spawnpanel'' event gets triggered? Edited April 14, 2017 by marty000123 Link to comment
Syntrax# Posted April 14, 2017 Share Posted April 14, 2017 GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(597, 313, 734, 299, "Desert Clan Warfare - Choose a Team!", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(256, 60, 219, 41, "What team would you like to join?", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(25, 163, 231, 55, "Ghost Mercenaries", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(264, 161, 217, 57, "Special Military Unit", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(489, 163, 227, 55, "People's Protection Power", false, GUIEditor.window[1]) guiSetVisible(GUIEditor.window[1], false) end) function spawn() setTimer( function() guiSetVisible(GUIEditor.window[1], true) showCursor(true) end, 1000, 1) end addEvent("spawnpanel", true) addEventHandler("spawnpanel", localPlayer, spawn) Link to comment
AE. Posted April 14, 2017 Share Posted April 14, 2017 (edited) guiSetVisible(GUIEditor.window[1], false) --after creating the window Edited April 14, 2017 by 3laa33 Link to comment
marty000123 Posted April 14, 2017 Author Share Posted April 14, 2017 Thanks alot!!! Got a new problem. addEventHandler("onClientGUIClick", GUIEditor.button[1], function() triggerServerEvent("red", localPlayer) showCursor(false) end, false) It says ''expected element at arg2, got nil" at addEventHandler. Any help? Link to comment
Ahmed Ly Posted April 14, 2017 Share Posted April 14, 2017 addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then triggerServerEvent("red",localPlayer) showCursor(false) end end ) 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