Miika Posted May 24, 2015 Share Posted May 24, 2015 Hi! Again.. I have problem with my script. I don't know, how to get active tab or gridlist. this code doesn't work: if (guiGetVisible(gridlist[1]) == true) then id = guiGridListGetSelectedItemText(gridlist[1], 2) price = guiGridListGetSelectedItemText(gridlist[1], 3) elseif (guiGetVisible(gridlist[2]) == true) then id = guiGridListGetSelectedItemText(gridlist[2], 2) price = guiGridListGetSelectedItemText(gridlist[2], 3) elseif (guiGetVisible(gridlist[3]) == true) then id = guiGridListGetSelectedItemText(gridlist[3], 2) price = guiGridListGetSelectedItemText(gridlist[3], 3) elseif (guiGetVisible(gridlist[4]) == true) then id = guiGridListGetSelectedItemText(gridlist[4], 2) price = guiGridListGetSelectedItemText(gridlist[4], 3) end addEventHandler("onClientGUIClick", button[2], weaponFunc, false) function weaponFunc() triggerServerEvent ( "giveWp", resourceRoot, id, price ) end Link to comment
DNL291 Posted May 24, 2015 Share Posted May 24, 2015 If you mean to get the selected tab, use guiGetSelectedTab. But if you refer to the gridlist column, use guiGridListGetSelectedItem and guiGridListGetItemText to get the text. 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