DRW Posted May 16, 2015 Share Posted May 16, 2015 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
UserToDelete Posted May 16, 2015 Share Posted May 16, 2015 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
DRW Posted May 16, 2015 Author Share Posted May 16, 2015 a 'gridlist' can't have buttons inside that, i thinkEDIT: 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: 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
Walid Posted May 16, 2015 Share Posted May 16, 2015 all whay you need is guiCreateButton() guiGridListGetItemText() triggerServerEvent() onClientGUIClick() Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now