Turbesz Posted August 21, 2016 Posted August 21, 2016 (edited) local GUIEditor = { button = {}, window = {}, memo = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(471, 309, 511, 161, "FullFunPlay ~ Egyedi szavazás indító panel ~ by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(13, 27, 77, 18, "Kérdés:", false, GUIEditor.window[1]) local kerdes = guiCreateMemo(66, 22, 435, 33, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(64, 67, 95, 17, "Válasz 1:", false, GUIEditor.window[1]) local valasz1 = guiCreateMemo(122, 61, 152, 33, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(284, 67, 79, 20, "Válasz 2:", false, GUIEditor.window[1]) local valasz2 = guiCreateMemo(336, 59, 165, 35, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(10, 116, 239, 35, "Szavazás indítása!", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(468, 123, 33, 28, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() outputChatBox("#FF0000Szavazás! #00FF00Kérdés:#aeaeae "..guiGetText(kerdes).."#00ff00Lehetséges válaszok: #00baff\n1="..guiGetText(valasz1).."2="..guiGetText(valasz2),root,r,g,b,true) end) function showGUI() guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addEvent( "showguii", true ) addEventHandler( "showguii", localPlayer, showGUI ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) Edited August 21, 2016 by Guest
Wumbaloo Posted August 21, 2016 Posted August 21, 2016 In client side, outputChatBox don't need a visibleTo argument, so just remove 'root', check out the wiki of outputChatBox
Turbesz Posted August 21, 2016 Author Posted August 21, 2016 In client side, outputChatBox don't need a visibleTo argument, so just remove 'root', check out the wiki of outputChatBox Yes, but only me see the word. /sorry for my bad english/
Wumbaloo Posted August 21, 2016 Posted August 21, 2016 You need to triggerServerEvent with the message and then make a for loop with your message, do you understand what I mean ?
Turbesz Posted August 21, 2016 Author Posted August 21, 2016 You need to triggerServerEvent with the message and then make a for loop with your message, do you understand what I mean ? I tried, but guiGetText not working.
Turbesz Posted August 21, 2016 Author Posted August 21, 2016 remove local before kerdes and retry ERROR: xy.lua:13: attempt to call global 'guiGetText' (a nil value)
Ahmed Ly Posted August 21, 2016 Posted August 21, 2016 Client local GUIEditor = { button = {}, window = {}, memo = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(471, 309, 511, 161, "FullFunPlay ~ Egyedi szavazás indító panel ~ by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(13, 27, 77, 18, "Kérdés:", false, GUIEditor.window[1]) local kerdes = guiCreateMemo(66, 22, 435, 33, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(64, 67, 95, 17, "Válasz 1:", false, GUIEditor.window[1]) local valasz1 = guiCreateMemo(122, 61, 152, 33, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(284, 67, 79, 20, "Válasz 2:", false, GUIEditor.window[1]) local valasz2 = guiCreateMemo(336, 59, 165, 35, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(10, 116, 239, 35, "Szavazás indítása!", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(468, 123, 33, 28, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() text1 =guiGetText(kerdes) text2 = guiGetText(valasz1) if text1 ~= "" and text2 ~= "" then triggerServerEvent("server",localPlayer,text1,text2) end end ) function showGUI() guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addEvent( "showguii", true ) addEventHandler( "showguii", localPlayer, showGUI ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) server addEvent("server",true) addEventHandler("server",root, function (text1,text2) outputChatBox("#FF0000Szavazás! #00FF00Kérdés:#aeaeae "..text1.."#00ff00Lehetséges válaszok: #00baff\n1="..text2.."2=",root,0,255,0,true) end )
Turbesz Posted August 21, 2016 Author Posted August 21, 2016 Client local GUIEditor = { button = {}, window = {}, memo = {}, label = {} } GUIEditor.window[1] = guiCreateWindow(471, 309, 511, 161, "FullFunPlay ~ Egyedi szavazás indító panel ~ by turbesz", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.label[1] = guiCreateLabel(13, 27, 77, 18, "Kérdés:", false, GUIEditor.window[1]) local kerdes = guiCreateMemo(66, 22, 435, 33, "", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(64, 67, 95, 17, "Válasz 1:", false, GUIEditor.window[1]) local valasz1 = guiCreateMemo(122, 61, 152, 33, "", false, GUIEditor.window[1]) GUIEditor.label[3] = guiCreateLabel(284, 67, 79, 20, "Válasz 2:", false, GUIEditor.window[1]) local valasz2 = guiCreateMemo(336, 59, 165, 35, "", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(10, 116, 239, 35, "Szavazás indítása!", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") GUIEditor.button[2] = guiCreateButton(468, 123, 33, 28, "X", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") guiSetVisible(GUIEditor.window[1], false) addEventHandler("onClientGUIClick", GUIEditor.button[1], function() text1 =guiGetText(kerdes) text2 = guiGetText(valasz1) if text1 ~= "" and text2 ~= "" then triggerServerEvent("server",localPlayer,text1,text2) end end ) function showGUI() guiSetVisible( GUIEditor.window[1], true ) showCursor( true ) end addEvent( "showguii", true ) addEventHandler( "showguii", localPlayer, showGUI ) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.button[2] then guiSetVisible(GUIEditor.window[1],false) showCursor(false) end end ) server addEvent("server",true) addEventHandler("server",root, function (text1,text2) outputChatBox("#FF0000Szavazás! #00FF00Kérdés:#aeaeae "..text1.."#00ff00Lehetséges válaszok: #00baff\n1="..text2.."2=",root,0,255,0,true) end ) Thanks!
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