3B00DG4MER Posted March 28, 2014 Share Posted March 28, 2014 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
WhoAmI Posted March 28, 2014 Share Posted March 28, 2014 xmlLoadFile xmlFindChild xmlNodeGetAttribute guiGridListAddRow guiGridListSetItemText Link to comment
3B00DG4MER Posted March 28, 2014 Author Share Posted March 28, 2014 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
Anubhav Posted March 28, 2014 Share Posted March 28, 2014 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
3B00DG4MER Posted March 28, 2014 Author Share Posted March 28, 2014 Can you post the XML code? Link to comment
Castillo Posted March 28, 2014 Share Posted March 28, 2014 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
3B00DG4MER Posted March 28, 2014 Author Share Posted March 28, 2014 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
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