controls = {
{
'lst',
id='skinlist',
width=230,
height=290,
columns={
{text='Skin', attr='name'}
},
rows={xml='skins.xml', attrs={'id', 'name'}},
onitemclick=showSkinID,
onitemdoubleclick=applySkin
},
{'txt', id='skinid', text='', width=50},
{'btn', id='set', onclick=applySkin},
{'btn', id='close', closeswindow=true}
},
I wil take this ?
and this is my code grid list
function centerWindow(center_window)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(center_window,false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(center_window,x,y,false)
end
addEventHandler("onClientResourceStart", resourceRoot,
function()
wnd = guiCreateWindow(1052, 184, 314, 510, "..:: [ Selection Skin's ] ::..", false)
guiWindowSetSizable(wnd, false)
centerWindow(wnd)
guiSetAlpha(wnd, 1.00)
guiWindowSetMovable( wnd , false )
gridlist = guiCreateGridList(21, 29, 283, 426, false, wnd)
guiGridListAddColumn(gridlist, "Skin", 0.9)
button = guiCreateButton(85, 465, 156, 35, "Spawn !", false, wnd)
guiSetProperty(button, "NormalTextColour", "FFAAAAAA")
end
)function centerWindow(center_window)
local screenW,screenH=guiGetScreenSize()
local windowW,windowH=guiGetSize(center_window,false)
local x,y = (screenW-windowW)/2,(screenH-windowH)/2
guiSetPosition(center_window,x,y,false)
end
addEventHandler("onClientResourceStart", resourceRoot,
function()
wnd = guiCreateWindow(1052, 184, 314, 510, "..:: [ Selection Skin's ] ::..", false)
guiWindowSetSizable(wnd, false)
centerWindow(wnd)
guiSetAlpha(wnd, 1.00)
guiWindowSetMovable( wnd , false )
gridlist = guiCreateGridList(21, 29, 283, 426, false, wnd)
guiGridListAddColumn(gridlist, "Skin", 0.9)
button = guiCreateButton(85, 465, 156, 35, "Spawn !", false, wnd)
guiSetProperty(button, "NormalTextColour", "FFAAAAAA")
end
)
You got me wrong, I told you to use the XML file only, not the freeroam script.
Use the XML functions to load the content of the XML into a lua table, then you can create a function which will get the skin name from the model.