Jump to content

2 help needed


Ramyxfa

Recommended Posts

Posted

Yo can u give me code of making that making command /updates open an gui ? help , thanks + i made an memo but can i make that no one can press on it and edit it [ make new text

Posted

Create the gui and use guiSetVisible to hide it, then use addCommandHandler with guiSetVisible to show it again, shouldn't be hard.

addCommandHandler('updates', function() 
 guiSetVisible(WINDOW, true) 
end) 

You can use guiMemoSetReadOnly to disable editing a memo:

local memo = guiCreateMemo(...) 
guiMemoSetReadOnly(memo, false) 

Posted

Please help is that good code :

GUIEditor = { 
    tab = {}, 
    tabpanel = {}, 
    button = {}, 
    window = {}, 
    memo = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(327, 160, 664, 518, "CIP Updates ", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetAlpha(GUIEditor.window[1], 1.00) 
        guiSetProperty(GUIEditor.window[1], "Visible", "False") 
        guiSetProperty(GUIEditor.window[1], "Text", "CIP Updates ") 
  
        GUIEditor.tabpanel[1] = guiCreateTabPanel(9, 204, 645, 304, false, GUIEditor.window[1]) 
  
        GUIEditor.tab[1] = guiCreateTab("Updates", GUIEditor.tabpanel[1]) 
  
        GUIEditor.memo[1] = guiCreateMemo(0, 1, 645, 278, "", false, GUIEditor.tab[1]) 
        GUIEditor.memo[2] = guiCreateMemo(0, 1, 645, 278, "Thursday, September 10, 2015\nAdd updates panel use /updates to open it \nAdded gun shop ", false, GUIEditor.tab[1]) 
        guiMemoSetReadOnly(GUIEditor.memo[2], true) 
  
  
        GUIEditor.button[1] = guiCreateButton(514, 193, 140, 37, "Close", false, GUIEditor.window[1])     
    end 
) 
  
addEventHandler("onClientRender", root, 
    function() 
        dxDrawText("", 913, 183, 982, 200, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false) 
    end 
)addCommandHandler('updates', function() 
 guiSetVisible(WINDOW, true) 
end) 

Posted

No, it's not. You're not hiding the window after it's created, which will result in it showing up as soon as the resource start. There's a useless, empty, dx text.

Also, WINDOW is not defined, you need to replace it with GUIEditor.window[1].

Next time, don't post code and ask if it's "good", try it yourself and tell us if it outputs errors or warnings.

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