Jump to content

Gridlist with button


DRW

Recommended Posts

Posted

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.

tJ5zeFm.gif

Proud owner and developer of ZNEXT: Aftermath.

Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience.

Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. 

Español, Pусский, Türk, عربى, Polski, Português

IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB

Posted

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 
) 
  

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

tJ5zeFm.gif

Proud owner and developer of ZNEXT: Aftermath.

Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience.

Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. 

Español, Pусский, Türk, عربى, Polski, Português

IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB

Posted

all whay you need is

guiCreateButton() 
guiGridListGetItemText() 
triggerServerEvent() 
onClientGUIClick() 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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