Jump to content

Gridlist with button


DRW

Recommended Posts

Hello, sorry for this, but I'd want to ask you for what should I use to create a gridlist with for example 2 items in it and with an external GUI button in the same window, so when I select a gridlist item and then click the GUI button it does a function, and when I click a second gridlist item and click the same GUI button then it does another function.

Link to comment

a 'gridlist' can't have buttons inside that, i think

EDIT: wrong

button like this code?::

Attach element to gridlist, in side of window

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(108, 98, 643, 422, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(114, 59, 432, 259, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Test2", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Test", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Test3", 0.3) 
  
        GUIEditor.button[1] = guiCreateButton(10, 205, 412, 44, "", false, GUIEditor.gridlist[1]) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")     
    end 
) 
  

Link to comment
a 'gridlist' can't have buttons inside that, i think

EDIT: wrong

button like this code?::

Attach element to gridlist, in side of window

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(108, 98, 643, 422, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.gridlist[1] = guiCreateGridList(114, 59, 432, 259, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Test2", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Test", 0.3) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Test3", 0.3) 
  
        GUIEditor.button[1] = guiCreateButton(10, 205, 412, 44, "", false, GUIEditor.gridlist[1]) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")     
    end 
) 
  

Wasn't talking exactly about a button inside the gridlist, just inside the window where is the gridlist, that's why I said the button was external. Look at this screenshot:

727373E11D78079081A0489386A404B4BE094EA6

Now, as you can see, there is a gridlist and a button saying "APARECER" (I'm spanish, so the language is). I want to press "Traficante" for example, after that, click the "APARECER" button, and then spawn somewhere and in a custom team, but If press "Médico" and click "APARECER", I'll appear in other position in another custom team.

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