Jump to content

Recommended Posts

You could use the same XML file and load them content into a lua table.

  
    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 
) 
Link to comment
You could use the same XML file and load them content into a lua table.

  
    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.

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