Strike27208 Posted November 18, 2014 Share Posted November 18, 2014 (edited) Hi. i make a new freeroam F1 and i need some help. I try to make a list of the all skins but not work . I find this code but he take only ID of the XML i try to add Name but he give me error. Argument 5 got string "And name of the skin" Please help me.. This is the code what i find : ---My code Gui.staticimage[1] = guiCreateStaticImage( 1040*sW, 220*sH, 300, 400, "window.png", false ) Gui.gridlist[1] = guiCreateGridList(4, 35, 291, 340, false, Gui.staticimage[1]) ---column = guiGridListAddColumn (Gui.gridlist[1]) name = guiGridListAddColumn(Gui.gridlist[1], "Name", 0.6) column = guiGridListAddColumn(Gui.gridlist[1], "ID", 0.4) ---The finde code local xml = getResourceConfig ( "xml/skins.xml" ) for _, v in ipairs ( xmlNodeGetChildren ( xml ) ) do local row = guiGridListAddRow ( Gui.gridlist[1] ) local model = xmlNodeGetAttribute ( v, "id") local model = xmlNodeGetAttribute ( v, "name") guiGridListSetItemText ( Gui.gridlist[1], row, column, name, tostring ( model ), false, false ) end And i have a question. How i can make this to load the skins.xml of the freeroam resource. I use this in xml: "1" name="Truth"/> "2" name="Maccer" keywords="maccer,male,white,:O"/> "265" name="Tenpenny" keywords="officer,tenpenny,male,black,cop"/> "266" name="Pulaski" keywords="officer,pulaski,male,white,cop"/> "267" name="Hern" keywords="officer,hern,male,latin"/> "268" name="Dwayne" keywords="dwayne,male,white,mechanic"/> Thanks very much man. I love you!!! But now how i can make this to load the xml with group like this : type="skin"> "Special"> "1" name="Truth" keywords="truth,male,white,hippie"/> "2" name="Maccer" keywords="maccer,male,white,wanker"/> "265" name="Tenpenny" keywords="officer,tenpenny,male,black,cop"/> "Beach"> "139" name="Yellow Bikini" keywords="swimsuit,black,girl,woman,beach"/> "154" name="Beach Blonde" keywords="guy,male,white,shorts,swim"/> If someone can help me i appreciate very much. I don't now how to use xml.. Edited November 18, 2014 by Guest Link to comment
AJXB Posted November 18, 2014 Share Posted November 18, 2014 ---My code Gui.staticimage[1] = guiCreateStaticImage( 1040*sW, 220*sH, 300, 400, "window.png", false ) Gui.gridlist[1] = guiCreateGridList(4, 35, 291, 340, false, Gui.staticimage[1]) ---column = guiGridListAddColumn (Gui.gridlist[1]) name = guiGridListAddColumn(Gui.gridlist[1], "Name", 0.6) column = guiGridListAddColumn(Gui.gridlist[1], "ID", 0.4) ---The finde code local xml = getResourceConfig ( "xml/skins.xml" ) for _, v in ipairs ( xmlNodeGetChildren ( xml ) ) do local row = guiGridListAddRow ( Gui.gridlist[1] ) local model = xmlNodeGetAttribute ( v, "id") local model2 = xmlNodeGetAttribute ( v, "name") guiGridListSetItemText ( Gui.gridlist[1], row, name, tostring ( model2 ), false, false ) guiGridListSetItemText ( Gui.gridlist[1], row, column, tostring ( model ), false, false ) end Fixed a bit, try it. Link to comment
Strike27208 Posted November 18, 2014 Author Share Posted November 18, 2014 Thanks very much man. I love you!!! But now how i can make this to load the xml with group like this : type="skin"> "Special"> "1" name="Truth" keywords="truth,male,white,hippie"/> "2" name="Maccer" keywords="maccer,male,white,wanker"/> "265" name="Tenpenny" keywords="officer,tenpenny,male,black,cop"/> "Beach"> "139" name="Yellow Bikini" keywords="swimsuit,black,girl,woman,beach"/> "154" name="Beach Blonde" keywords="guy,male,white,shorts,swim"/> If someone can help me i appreciate very much. I don't now how to use xml.. Link to comment
AJXB Posted November 18, 2014 Share Posted November 18, 2014 Thanks very much man. I love you!!!But now how i can make this to load the xml with group like this : type="skin"> "Special"> "1" name="Truth" keywords="truth,male,white,hippie"/> "2" name="Maccer" keywords="maccer,male,white,:O"/> "265" name="Tenpenny" keywords="officer,tenpenny,male,black,cop"/> "Beach"> "139" name="Yellow Bikini" keywords="swimsuit,black,girl,woman,beach"/> "154" name="Beach Blonde" keywords="guy,male,white,shorts,swim"/> If someone can help me i appreciate very much. I don't now how to use xml.. You're more than welcome mate. Neither do I, XML is just too laggy, use a Lua table: Skins = { Special = { {1,"Truth", "truth,male,white,hippie"}, {2,"Maccer","maccer,male,white,:O"}, {265,"Tenpenny","officer,tenpenny,male,black,cop"}, }, Beach = { {139,"Yellow Bikini", "swimsuit,black,girl,woman,beach"}, {154,"Beach Blonde", "guy,male,white,shorts,swim"}, }, } Now you can loop it Link to comment
Strike27208 Posted November 18, 2014 Author Share Posted November 18, 2014 Thanks very much man. I love you!!!But now how i can make this to load the xml with group like this : type="skin"> "Special"> "1" name="Truth" keywords="truth,male,white,hippie"/> "2" name="Maccer" keywords="maccer,male,white,:O"/> "265" name="Tenpenny" keywords="officer,tenpenny,male,black,cop"/> "Beach"> "139" name="Yellow Bikini" keywords="swimsuit,black,girl,woman,beach"/> "154" name="Beach Blonde" keywords="guy,male,white,shorts,swim"/> If someone can help me i appreciate very much. I don't now how to use xml.. You're more than welcome mate. Neither do I, XML is just too laggy, use a Lua table: Skins = { Special = { {1,"Truth", "truth,male,white,hippie"}, {2,"Maccer","maccer,male,white,:O"}, {265,"Tenpenny","officer,tenpenny,male,black,cop"}, }, Beach = { {139,"Yellow Bikini", "swimsuit,black,girl,woman,beach"}, {154,"Beach Blonde", "guy,male,white,shorts,swim"}, }, } Now you can loop it I will try this bro. Thanks 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