Jump to content

Nothing?


Stevenn

Recommended Posts

Posted

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) 
     

Posted (edited)

if you use argument relative ( true ) you need use numbers like this 0.9 not 900

Edited by Guest

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

Im not sure, but maby because you mixed relative positions with absolute position.

Currently working on gamemodes :

  • Reallife Script 70%
  • Breakout Script 10%
Posted
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) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Solidsnake, thanks it works but could you just add some comments on where I did wrong so if I were to do it in the future i'd know what I did wrong? :)

Posted

You need use it in any resolutions?

You should use relative argument or calculate it your self.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
Solidsnake, thanks it works but could you just add some comments on where I did wrong so if I were to do it in the future i'd know what I did wrong? :)

Done, added some comments.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
You need use it in any resolutions?

You should use relative argument or calculate it your self.

Yeah, just noticed it doesn't work with a lower res, but if I need to calculate it myself, how would I do that?

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