Jump to content

[Help]Xml Skins


3B00DG4MER

Recommended Posts

Hello,Today i made Skin Shop which get skins id from xml

i have made a xml & Gui

How do i import skins id from xml to client (Gui)

        GUIEditor.window[1] = guiCreateWindow(649, 185, 300, 707, "Skin Shop", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
        guiSetVisible(GUIEditor.window[1],false) 
        GUIEditor.gridlist[1] = guiCreateGridList(21, 33, 260, 604, false, GUIEditor.window[1]) 
        guiGridListAddColumn(GUIEditor.gridlist[1], "Skin Name", 1) 
        GUIEditor.button[1] = guiCreateButton(25, 647, 130, 50, "Buy", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[1], "sa-header") 
        GUIEditor.button[2] = guiCreateButton(165, 647, 116, 50, "Cancel", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], "sa-header")   

Link to comment
xmlLoadFile 
xmlFindChild 
xmlNodeGetAttribute 
  
guiGridListAddRow 
guiGridListSetItemText 

can you fix that plz !!

        local xml = getResourceConfig("skins.xml")  
        local models = xmlNodeGetAttribute(xml, "id") 
        local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        guiGridListSetItemText (GUIEditor.gridlist[1], row, skins, models, false, false )  

Link to comment
  
       local xml = getResourceConfig("skins.xml") 
        local models = xmlNodeGetAttribute(xml, "id") 
        local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
        for k,v in ipairs(models) do 
        guiGridListSetItemText (GUIEditor.gridlist[1], row, skins, v, false, false ) 
       end 
  

Link to comment
local xml = getResourceConfig ( "skins.xml" ) 
for _, v in ipairs ( xmlNodeGetChildren ( xml ) ) do 
    local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
    local model = xmlNodeGetAttribute ( v, "id" ) 
    guiGridListSetItemText ( GUIEditor.gridlist[1], row, skins, tostring ( model ), false, false ) 
end 

By the way: "skins" is the column index, right?

Link to comment
local xml = getResourceConfig ( "skins.xml" ) 
for _, v in ipairs ( xmlNodeGetChildren ( xml ) ) do 
    local row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
    local model = xmlNodeGetAttribute ( v, "id" ) 
    guiGridListSetItemText ( GUIEditor.gridlist[1], row, skins, tostring ( model ), false, false ) 
end 

By the way: "skins" is the column index, right?

Thank you very much

it's work

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