Jump to content

[HELP]Gridlist


brocky

Recommended Posts

Hi, Can anyone help me in creating a small functional Gridlist. I have tried a lot but it never works out for me.

Can you give me a small code of Gridlist. for example. 2 weapons in gridlist and when you click the weapon and click "ok", you will get that weapon.

I need the code with some comments in detail if you can.

Hope you understood. Thanks.

Link to comment

I know that I have made many mistakes and they are epic, but I am bad in making gridlist and I need your help.

  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        window1 = guiCreateWindow(245, 209, 309, 271, "", false) 
        guiWindowSetSizable(window1, false) 
  
        gridlist1 = guiCreateGridList(9, 21, 290, 176, false, window1) 
        guiGridListAddColumn(gridlist1, "Weapons", 0.9) 
        guiGridListAddRow(gridlist1) 
     text =  guiGridListSetItemText(gridlist1, 0, 1, "m4", false, false) 
        button1 = guiCreateButton(9, 205, 290, 56, "OK", false, window1)     
    
function getWeapon() 
 if button1 == source then 
    if  guiGridListGetSelectedItem(v[1]) then  
     triggerServerEvent("giveMe", localPlayer)  
                 end  
 end  
end 
addEventHandler("onClientGUIClick", button1, getWeapon, false)  
  
           
  
 end 
) 

Link to comment
addEventHandler('onClientGUIClick', root, 
function() 
if source == button1 then 
if guiGridListGetSelectedItem ( gridlist1 ) ~= -1 then 
ids = guiGridListGetSelectedItem ( gridlist1 ) 
givePedWeapon(source, ids, 5000, true) 
end 
end 
end 
) 

givePedWeapon(source, ids, 5000, true) 

source ??

source = GuiClick

not ped ,

and

zHlJfAV.png

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