Perfect Posted September 23, 2012 Share Posted September 23, 2012 Hi All, i made a gui but i can't make it open with command, can you guys please help me. Here it is -- client file GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(119,64,799,590,"Server Help Page",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(10,24,780,557,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Server Commands",GUIEditor_TabPanel[1]) GUIEditor_Memo[1] = guiCreateMemo(6,7,768,520,"1) Commands \n \n",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Stuff",GUIEditor_TabPanel[1]) GUIEditor_Memo[2] = guiCreateMemo(6,7,767,518,"1) Admins:-\n1. Perfect \n",false,GUIEditor_Tab[2]) function serverShow () getVisible = guiGetVisible (GUIEditor_Window[1]) if (getVisible == true) then guiSetVisible (GUIEditor_Window[1], false) showCursor (false) guiSetInputEnabled(false) end if (getVisible == false) then showCursor (true) end end addEvent("serverShow",true) addEventHandler("serverShow",root,serverShow) -- server file addCommandHandler ( "helpPage", function ( player, cmd ) if hasObjectPermissionTo ( player, "function.banPlayer" ) then triggerClientEvent(player,"serverShow",player) else outputChatBox(" Access Denied ",player,255,0,0) end end ) Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(119,64,799,590,"Server Help Page",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(10,24,780,557,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Server Commands",GUIEditor_TabPanel[1]) GUIEditor_Memo[1] = guiCreateMemo(6,7,768,520,"1) Commands\n\n",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Stuff",GUIEditor_TabPanel[1]) GUIEditor_Memo[2] = guiCreateMemo(6,7,767,518,"1) Admins:-\n1. Perfect\n",false,GUIEditor_Tab[2]) function serverShow ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) guiSetInputEnabled ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent("serverShow",true) addEventHandler("serverShow",root,serverShow) Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Window[1] = guiCreateWindow(119,64,799,590,"Server Help Page",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(10,24,780,557,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Server Commands",GUIEditor_TabPanel[1]) GUIEditor_Memo[1] = guiCreateMemo(6,7,768,520,"1) Commands\n\n",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Stuff",GUIEditor_TabPanel[1]) GUIEditor_Memo[2] = guiCreateMemo(6,7,767,518,"1) Admins:-\n1. Perfect\n",false,GUIEditor_Tab[2]) function serverShow ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) guiSetInputEnabled ( guiGetVisible ( GUIEditor_Window[1] ) ) end addEvent("serverShow",true) addEventHandler("serverShow",root,serverShow) Error ERROR: Server triggered clientside event serverShow, but event is not added clientside Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 Well, here it works fine. Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 Well, here it works fine. hm, my server file is fine ? Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 Yes, are you sure you don't have any other error? is the window visible at all? because since is not hidden after creation, it should be visible on start. Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 Yes, are you sure you don't have any other error? is the window visible at all? because since is not hidden after creation, it should be visible on start. window is not visible. Edit: another i notice. i got warning too WARNING: Loading script failed: Server\helppage_gui.lua:9: unfinished string near "'1) Commands' Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 That error was on your script, but in mine isn't. Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 That error was on your script, but in mine isn't. hm, can you put your script here please ? (meta,server and client file. whole script) Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 There is no need for that, just copy the script I posted and your server side. Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 There is no need for that, just copy the script I posted and your server side. ok i copied and its worked but its open when i start resource so please can you make its not open when resource start and add close button and set read only ? Please Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 Just add: guiSetVisible ( GUIEditor_Window[1], false ) After: guiCreateWindow. Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 Just add: guiSetVisible ( GUIEditor_Window[1], false ) After: guiCreateWindow. can you tell me about close button and read only ? Please Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 Read only: guiMemoSetReadOnly Close button: onClientGUIClick Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 Read only: guiMemoSetReadOnly Close button: onClientGUIClick thnx and can you please do code for close button ? (last thing) Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 How about... no? click on the link I gave you and read about it. Link to comment
Perfect Posted September 23, 2012 Author Share Posted September 23, 2012 How about... no? click on the link I gave you and read about it. you telling to me read about gui's ? I am always suck at gui's that's why i ask here (i always confused at gui's. they go from my head or they come in my ear and go out from another ) anyway, i used helpPage command to open and close Thnx! Link to comment
Castillo Posted September 23, 2012 Share Posted September 23, 2012 No, I tell you to read about this: https://wiki.multitheftauto.com/wiki/OnClientGUIClick Link to comment
Perfect Posted September 24, 2012 Author Share Posted September 24, 2012 No, I tell you to read about this:https://wiki.multitheftauto.com/wiki/OnClientGUIClick i did'nt understand. where i put this and which commands ? addEventHandler ( "onClientGUIClick", GUIEditor_Window[1], close, false ) but where is close button (just confused) Link to comment
manve1 Posted September 24, 2012 Share Posted September 24, 2012 to close a window with a button is really easy just have to read wiki ... function close_it() if (source == button) then --- change the button to whatever button u made to close window guiSetVisible( window, false ) -- change the window, to whatever ur gui is showCursor(false) end end addEventHandler("onClientGUIClick", button, close_it ) -- leave the "close_it" part and change the button ... this should help you. if you still haven't solved how to make this script. Link to comment
Perfect Posted September 24, 2012 Author Share Posted September 24, 2012 thnx and i try to set read only but gui did'nt set read only. GUIEditor_Window = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} GUIEditor_Memo = {} GUIEditor_Button = {} GUIEditor_Window[1]= guiCreateWindow(119,64,799,590,"Server Help Page",false) GUIEditor_TabPanel[1] = guiCreateTabPanel(10,24,780,557,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Server Commands",GUIEditor_TabPanel[1]) GUIEditor_Memo[1] = guiCreateMemo(6,7,768,520,"1. Commands",false,GUIEditor_Tab[1]) GUIEditor_Tab[2] = guiCreateTab("Stuff",GUIEditor_TabPanel[1]) GUIEditor_Memo[2] = guiCreateMemo(6,7,767,518,"1 Admins:-\n1. Perfect",false,GUIEditor_Tab[2]) GUIEditor_Button[1] = guiCreateButton(863,89,44,22,"Close",GUIEditor_TabPanel[1], false) function serverShow ( ) guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) guiSetInputEnabled ( guiGetVisible ( GUIEditor_Window[1] ) ) guiMemoSetReadOnly( GUIEditor_Memo[1], true) guiMemoSetReadOnly( GUIEditor_Memo[2], true) end addEvent("serverShow",true) addEventHandler("serverShow",root,serverShow) function close_it() if (source == GUIEditor_Button[1]) then --- change the button to whatever button u made to close window guiSetVisible( GUIEditor_Window[1], false ) -- change the window, to whatever ur gui is showCursor(false) end end addEventHandler("onClientGUIClick", GUIEditor_Button[1], close_it ) -- leave the "close_it" part and change the button ... Link to comment
manve1 Posted September 25, 2012 Share Posted September 25, 2012 you can't set whole GUI as set read only only a memo. --ect: memo = guiCreateMemo( 0.7, 0.6, 0.9, 0.9, "", true ) guiMemoSetReadOnly(memo, true) 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