Jump to content

Nothing?


Stevenn

Recommended Posts

well, I can't find the problem anywhere.

The gui is there, or only the windows as there is no buttons nor any memo text.

texts = {} 
texts["Overview"] = "texthere" 
texts["Rules"] = "texthere" 
texts["FAQ"] = "texthere" 
  
docWindow = guiCreateWindow(0.3672,0.3306,0.2823,0.2481,"Information Panel",true) 
docOverview = guiCreateButton(13,24,92,38,"Overview",true,docWindow) 
docRules = guiCreateButton(13,85,92,38,"Rules",true,docWindow) 
docFAQ = guiCreateButton(14,145,92,38,"FAQ",true,docWindow) 
docClose = guiCreateButton(17,208,92,38,"Close",true,docWindow) 
docMemo = guiCreateMemo(121,29,410,227,texts["Overview"],true,docWindow) 
guiSetVisible(docWindow,false) 
  
function bindGui() 
    guiSetVisible(docWindow,true) 
    showCursor(true) 
  end 
    bindKey("F1","down", 
function() 
    guiSetVisible(docWindow,not guiGetVisible(docWindow)) 
    showCursor(guiGetVisible(docWindow)) 
end) 
     
function setText() 
    local source = guiGetText(source) 
    if soruce == "docClose" then guiSetVisible(docWindow,false) showCursor(false) return end 
    guiSetText(docMemo,texts[source]) 
  end 
addEventHandler("onClientGUIClick",docOverview,setText,false) 
addEventHandler("onClientGUIClick",docRules,setText,false) 
addEventHandler("onClientGUIClick",docFAQ,setText,false) 
addEventHandler("onClientGUIClick",docClose,setText,false) 
     

Link to comment
texts = {} 
texts["Overview"] = "texthere" 
texts["Rules"] = "texthere" 
texts["FAQ"] = "texthere" 
  
-- Your GUI buttons we're set to Absolute, but they we're Relative. 
  
-- true = Absolute 
-- false = Relative 
  
docWindow = guiCreateWindow(0.3672,0.3306,0.2823,0.2481,"Information Panel",true) 
docOverview = guiCreateButton(13,24,92,38,"Overview",false,docWindow) 
docRules = guiCreateButton(13,85,92,38,"Rules",false,docWindow) 
docFAQ = guiCreateButton(14,145,92,38,"FAQ",false,docWindow) 
docClose = guiCreateButton(17,208,92,38,"Close",false,docWindow) 
docMemo = guiCreateMemo(121,29,410,227,texts["Overview"],false,docWindow) 
guiSetVisible(docWindow,false) 
  
bindKey("F1","down",     
    function ( ) 
        guiSetVisible ( docWindow, not guiGetVisible ( docWindow ) ) 
        showCursor ( guiGetVisible ( docWindow ) ) 
    end 
) 
    
function setText ( ) 
    if ( source == docClose ) then -- You had a type here: "soruce" instead of "source". Also you we're checking if the button you've press was "docClose" instead of docClose ( you have to check the element, not the string. ) 
        guiSetVisible ( docWindow, false ) 
        showCursor ( false ) 
        return 
    end 
    local text = guiGetText ( source ) 
    guiSetText ( docMemo, texts[ text ] ) 
end 
addEventHandler("onClientGUIClick",docOverview,setText,false) 
addEventHandler("onClientGUIClick",docRules,setText,false) 
addEventHandler("onClientGUIClick",docFAQ,setText,false) 
addEventHandler("onClientGUIClick",docClose,setText,false) 

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...