Jump to content

help with add img in gui row


Recommended Posts

Posted

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?

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

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) 

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

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

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted
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

?

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

He want's to show the image of the selected weapon.

@MOJRM-511: You have to use the following functions:

guiCreateStaticImage 
guiGridListGetSelectedItem  
guiGridListGetItemText 
guiStaticImageLoadImage 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

He doesn't want that Cadu12, read the posts above.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

http://mojrm511.x10.mx

msn:

[email protected]

my server ip:

176.9.40.71:22779

-------------------------------------- 2012 updated--------

Posted

You wish, I gave you the needed functions, you must learn about them and implement them in your script.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

This forum is NOT REQUEST. As Solidsnake14 said you have to use function what he sent you.

Ingame nick: Cadu12

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