IIIIlllllIII Posted May 22, 2012 Share Posted May 22, 2012 hi i hope you understand me i want add a img of the weapon in gui row client code tab2 = guiCreateTab("Weapons",tabPanel) weapGrid = guiCreateGridList(4,6,305,291,false,tab2) guiGridListSetSelectionMode(weapGrid,0) weapColumn = guiGridListAddColumn(weapGrid,"Weapon",0.5) costColumn = guiGridListAddColumn(weapGrid,"$",0.3) weapButton = guiCreateButton(107,308,100,29,"Buy Weapon",false,tab2) local weapons = {{31,3500},{4,15000},{22,2500},{23,2700},{24,4000},{25,4200},{26,9000},{27,8000},{28,6500},{29,7000},{30,3500},{32,7800},{33,11000},{34,16000},{16,20000}} for i,v in ipairs (weapons) do local itemName = getWeaponNameFromID (v[1]) local row = guiGridListAddRow (weapGrid) guiGridListSetItemText (weapGrid, row, 1, itemName, false, true) guiGridListSetItemText (weapGrid, row, 2, tostring(v[2]), false, true) end guiSetAlpha(weapGrid,1) in local weapons when i select id of the weapon 31 i want when i select the weapon see the img i mean png img how can i add img onto the weapon? Link to comment
Jaysds1 Posted May 22, 2012 Share Posted May 22, 2012 Sorry, I don't see any image funciton in your script, and here: tab2 = guiCreateTab("Weapons",tabPanel) weapGrid = guiCreateGridList(4,6,305,291,false,tab2) guiGridListSetSelectionMode(weapGrid,0) weapColumn = guiGridListAddColumn(weapGrid,"Weapon",0.5) costColumn = guiGridListAddColumn(weapGrid,"$",0.3) weapButton = guiCreateButton(107,308,100,29,"Buy Weapon",false,tab2) local weapons = {{31,3500},{4,15000},{22,2500},{23,2700},{24,4000},{25,4200},{26,9000},{27,8000},{28,6500},{29,7000},{30,3500},{32,7800},{33,11000},{34,16000},{16,20000}} for i,v in ipairs (weapons) do guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 1, getWeaponNameFromID (v[1]), false, false) guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 2, tostring(v[2]), false, false) end guiSetAlpha(weapGrid,1) Link to comment
IIIIlllllIII Posted May 22, 2012 Author Share Posted May 22, 2012 Sorry, I don't see any image funciton in your script, and here:tab2 = guiCreateTab("Weapons",tabPanel) weapGrid = guiCreateGridList(4,6,305,291,false,tab2) guiGridListSetSelectionMode(weapGrid,0) weapColumn = guiGridListAddColumn(weapGrid,"Weapon",0.5) costColumn = guiGridListAddColumn(weapGrid,"$",0.3) weapButton = guiCreateButton(107,308,100,29,"Buy Weapon",false,tab2) local weapons = {{31,3500},{4,15000},{22,2500},{23,2700},{24,4000},{25,4200},{26,9000},{27,8000},{28,6500},{29,7000},{30,3500},{32,7800},{33,11000},{34,16000},{16,20000}} for i,v in ipairs (weapons) do guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 1, getWeaponNameFromID (v[1]), false, false) guiGridListSetItemText (weapGrid, guiGridListAddRow (weapGrid), 2, tostring(v[2]), false, false) end guiSetAlpha(weapGrid,1) i mean i want add a img of the weapons how i add img when i select the weapon i want show the img of the weapon but where i can but the code??? Link to comment
Jaysds1 Posted May 22, 2012 Share Posted May 22, 2012 I know you can't put an image in a GridList, so you could try putting the image somewhere on the tab Link to comment
IIIIlllllIII Posted May 22, 2012 Author Share Posted May 22, 2012 I know you can't put an image in a GridList, so you could try putting the image somewhere on the tab yes i know i cant put the image in a GridList but how i make when i select weapn the img get show how i bind if i select the weapon id 31 i want see the img on the right tap not on GridList ? Link to comment
Jaysds1 Posted May 22, 2012 Share Posted May 22, 2012 Do you mean when the player has the weapon the image is shown? Link to comment
Castillo Posted May 22, 2012 Share Posted May 22, 2012 He want's to show the image of the selected weapon. @MOJRM-511: You have to use the following functions: guiCreateStaticImage guiGridListGetSelectedItem guiGridListGetItemText guiStaticImageLoadImage Link to comment
Cadu12 Posted May 22, 2012 Share Posted May 22, 2012 If you want make image in GirdList, you should make your OWN custom gui. Link to comment
Castillo Posted May 22, 2012 Share Posted May 22, 2012 He doesn't want that Cadu12, read the posts above. Link to comment
Cadu12 Posted May 22, 2012 Share Posted May 22, 2012 His english is not good, so I can't understand. Lets stop off-topic. Link to comment
IIIIlllllIII Posted May 22, 2012 Author Share Posted May 22, 2012 He want's to show the image of the selected weapon.@MOJRM-511: You have to use the following functions: guiCreateStaticImage guiGridListGetSelectedItem guiGridListGetItemText guiStaticImageLoadImage how i make it please put the full code Link to comment
Castillo Posted May 22, 2012 Share Posted May 22, 2012 You wish, I gave you the needed functions, you must learn about them and implement them in your script. Link to comment
IIIIlllllIII Posted May 22, 2012 Author Share Posted May 22, 2012 You wish, I gave you the needed functions, you must learn about them and implement them in your script. i dont understand how i bind the functions in the code Link to comment
Cadu12 Posted May 22, 2012 Share Posted May 22, 2012 This forum is NOT REQUEST. As Solidsnake14 said you have to use function what he sent you. Link to comment
Tete omar Posted May 22, 2012 Share Posted May 22, 2012 (edited) Did you mean select a weapon as image not as button ? Edited May 22, 2012 by Guest Link to comment
X-SHADOW Posted May 22, 2012 Share Posted May 22, 2012 no he want when he select the weapon the image of the weapon show 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