d43dr4 Posted February 24, 2013 Share Posted February 24, 2013 (edited) Hello everyone, I have a question and i hope to find its answer _ How to save a work on guieditor _ Is it possible to create a window with buttons etc , to do same job of " Execute command handler " but out of admin panel and just opens for a specified player ( with serial ) I have to find a script that execute commands urgernt please Thx guys Edited February 27, 2013 by Guest Link to comment
tosfera Posted February 24, 2013 Share Posted February 24, 2013 The thing you can do for the admin panel is, create a gridview containing all the players, then select one and press the butten. After the button is pressed, use a triggerClientEvent to pop it up at the selected player. Link to comment
d43dr4 Posted February 24, 2013 Author Share Posted February 24, 2013 Thats not what i mean , You see the Resources TAB on admin panel, there is a client / server button , and something to write there i delete it from admin panel cause they can crash server from it and for some other reasons but i want it to open just for me as a lonely window i have create the window but i cant save it with guieditor so please tell me how Link to comment
tosfera Posted February 24, 2013 Share Posted February 24, 2013 Thats not what i mean ,You see the Resources TAB on admin panel, there is a client / server button , and something to write there i delete it from admin panel cause they can crash server from it and for some other reasons but i want it to open just for me as a lonely window i have create the window but i cant save it with guieditor so please tell me how Just go into the admin resource en copy it out, make a new resource with that code and the functions. No need to remaKe all the functions. Link to comment
d43dr4 Posted February 24, 2013 Author Share Posted February 24, 2013 Okey will try But how to save a gui that created on guieditor ? i have create a window but can save it Link to comment
tosfera Posted February 24, 2013 Share Posted February 24, 2013 Okey will tryBut how to save a gui that created on guieditor ? i have create a window but can save it If I can remember it good, it has an option to view the code. Just copy the code and save it in a file. Link to comment
d43dr4 Posted February 24, 2013 Author Share Posted February 24, 2013 Okey thx done BRB Sleep Tomorrow will complete Link to comment
PaiN^ Posted February 25, 2013 Share Posted February 25, 2013 it has an option to view the code.. Print Code Link to comment
d43dr4 Posted February 25, 2013 Author Share Posted February 25, 2013 Here's the windows code : GUIEditor = { edit = {}, button = {}, label = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(417, 315, 482, 107, "Execute command handler", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[2] = guiCreateButton(407, 47, 60, 22, "Client", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(407, 75, 60, 22, "Server", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(10, 26, 329, 18, "Type your command here :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.label[2] = guiCreateLabel(3, 22, 259, 25, "", false, GUIEditor.label[1]) GUIEditor.label[3] = guiCreateLabel(190, 26, 299, 19, "For advanced users only.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) GUIEditor.edit[1] = guiCreateEdit(37, 54, 360, 31, "", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(8, 60, 37, 25, "CMD:", false, GUIEditor.window[1]) Link to comment
PaiN^ Posted February 25, 2013 Share Posted February 25, 2013 Just go into the admin resource en copy it out, make a new resource with that code and the functions. No need to remaKe all the functions. And don't forget to use getPlayerSerial ( if you want the GUI to open only for you ! ) Link to comment
d43dr4 Posted February 25, 2013 Author Share Posted February 25, 2013 can u just edit the window for me please guys, just beginner on lua please .. Link to comment
d43dr4 Posted February 25, 2013 Author Share Posted February 25, 2013 Is there any helps ? Link to comment
d43dr4 Posted February 25, 2013 Author Share Posted February 25, 2013 Look guys, Got that window GUIEditor = { edit = {}, button = {}, label = {}, window = {}, } GUIEditor.window[1] = guiCreateWindow(417, 315, 482, 107, "Execute command handler", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.button[2] = guiCreateButton(407, 47, 60, 22, "Client", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(407, 75, 60, 22, "Server", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(10, 26, 329, 18, "Type your command here :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.label[2] = guiCreateLabel(3, 22, 259, 25, "", false, GUIEditor.label[1]) GUIEditor.label[3] = guiCreateLabel(190, 26, 299, 19, "For advanced users only.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) GUIEditor.edit[1] = guiCreateEdit(37, 54, 360, 31, "", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(8, 60, 37, 25, "CMD:", false, GUIEditor.window[1]) if getPlayerSerial() == "MY SERIAl" then bindKey("F2", "down", function() guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1])) showCursor(guiGetVisible(GUIEditor.window[1])) end) end How to link it with admin panel functions on admin_main.lua & admin_server.lua Link to comment
PaiN^ Posted February 25, 2013 Share Posted February 25, 2013 Just go into the admin resource en copy it out, make a new resource with that code and the functions. No need to remaKe all the functions. Link to comment
d43dr4 Posted February 26, 2013 Author Share Posted February 26, 2013 I try many times , no thing helps OMG , is there someone can help ? Link to comment
PaiN^ Posted February 26, 2013 Share Posted February 26, 2013 I try many times ... Then, Post your last or best attempt, And any one how can will fix it for you ..! Link to comment
csiguusz Posted February 26, 2013 Share Posted February 26, 2013 Try this. Client: GUIEditor = { edit = {}, button = {}, label = {}, window = {}, } function window () if not GUIEditor.window[1] then GUIEditor.window[1] = guiCreateWindow(417, 315, 482, 107, "Execute command handler", false) guiSetInputEnabled ( true ) showCursor ( true ) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.button[2] = guiCreateButton(407, 47, 60, 22, "Client", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(407, 75, 60, 22, "Server", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(10, 26, 329, 18, "Type your command here :", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[1], "clear-normal") GUIEditor.label[2] = guiCreateLabel(3, 22, 259, 25, "", false, GUIEditor.label[1]) GUIEditor.label[3] = guiCreateLabel(190, 26, 299, 19, "For advanced users only.", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[3], 255, 0, 0) GUIEditor.edit[1] = guiCreateEdit(37, 54, 360, 31, "", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(8, 60, 37, 25, "CMD:", false, GUIEditor.window[1]) addEventHandler ( "onClientGUIClick", GUIEditor.window[1], function () local text = guiGetText ( GUIEditor.edit[1] ) if source == GUIEditor.button[2] and text ~= "" then local func = loadstring ( "return " .. text )() if isElement ( func ) then return_ = " Element [" .. getElementType ( func) .. "]" outputChatBox ( "Command executed! Result: " .. return_ , 10, 60, 255) else outputChatBox ( "Command executed! Result: " .. tostring ( func ) , 10, 60, 255) end elseif source == GUIEditor.button[3] and text ~= "" then triggerServerEvent ( "runCommand", localPlayer , text ) end end ) return elseif guiGetVisible(GUIEditor.window[1]) then guiSetVisible(GUIEditor.window[1], false) showCursor ( false ) guiSetInputEnabled ( false ) return end guiSetInputEnabled ( true ) showCursor ( true ) guiSetVisible(GUIEditor.window[1], true) end if getPlayerSerial() == "MY SERIAl" then bindKey("F2", "down", function() window () end) end Server: addEvent ( "runCommand", true ) addEventHandler ( "runCommand", root, function ( cmd ) local func = loadstring ( "return " .. cmd ) () if isElement ( func ) then return_ = " Element [" .. getElementType ( func ) .. "]" outputChatBox ( "Command executed! Result: " .. return_ , source, 10, 60, 255) else outputChatBox ( "Command executed! Result: " .. tostring ( func ) , source, 10, 60, 255) end end ) Link to comment
d43dr4 Posted February 27, 2013 Author Share Posted February 27, 2013 Thank you a lot .. Just woked successful You are the best Link to comment
tosfera Posted February 27, 2013 Share Posted February 27, 2013 I try many times , no thing helpsOMG , is there someone can help ? Okee I've been knocked-out for a few days, whats not working? Link to comment
PaiN^ Posted February 27, 2013 Share Posted February 27, 2013 I try many times , no thing helpsOMG , is there someone can help ? Okee I've been knocked-out for a few days, whats not working? Thank you a lot ..Just woked successful You are the best Link to comment
tosfera Posted February 27, 2013 Share Posted February 27, 2013 I try many times , no thing helpsOMG , is there someone can help ? Okee I've been knocked-out for a few days, whats not working? Thank you a lot ..Just woked successful You are the best my comment was posted WAY tolate cause the internet was being a bitch at my intership Link to comment
PaiN^ Posted February 27, 2013 Share Posted February 27, 2013 my comment was posted WAY tolate cause the internet was being a bitch at my intership No Problem ..! Link to comment
Anderl Posted February 27, 2013 Share Posted February 27, 2013 Just go into the admin resource en copy it out, make a new resource with that code and the functions. No need to remaKe all the functions. And don't forget to use getPlayerSerial ( if you want the GUI to open only for you ! ) You don't need any function to do that. Link to comment
PaiN^ Posted February 27, 2013 Share Posted February 27, 2013 You don't need any function to do that. Then how it's done ? Link to comment
Anderl Posted February 27, 2013 Share Posted February 27, 2013 That depends on what you use to show the window, etc. But serials aren't used for such things, it just makes no sense to use them. 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