Jump to content

[Help] gui with command ?


Perfect

Recommended Posts

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
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
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
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
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 ) :P

anyway, i used helpPage command to open and close

Thnx!

Link to comment

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...