Baseplate Posted March 9, 2013 Share Posted March 9, 2013 Hello, well I'm actually having some problemos with getting the text from an xml file and using guiSetText with a memo, here's my code c.lua GUIEditor.memo[2] = guiCreateMemo(169, 27, 395, 194, "", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(10, 27, 156, 219, false, GUIEditor.window[1]) topics = guiGridListAddColumn(GUIEditor.gridlist[1], "Topics", 0.9) rulesRow = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText ( GUIEditor.gridlist[1], rulesRow, topics, "Rules", false, false ) if (guiGridListGetSelectedItem (GUIEditor.gridlist[1]) == rulesRow) then local xmlRules = xmlLoadFile ( "rules.xml" ) local Rulesnode = xmlFindChild( xmlRules, "rules", 0 ) local RulesValue = xmlNodeGetValue ( Rulesnode ) guiSetText (GUIEditor.memo[2], tostring ( RulesValue ) ) rules.xml <rules> Under construction for now. </rules> meta.xml <meta> <script src="c.lua" type="client"/> <file src="rules.xml" type="client"/> </meta> Link to comment
Sasu Posted March 9, 2013 Share Posted March 9, 2013 GUIEditor.memo[2] = guiCreateMemo(169, 27, 395, 194, "", false, GUIEditor.window[1]) GUIEditor.gridlist[1] = guiCreateGridList(10, 27, 156, 219, false, GUIEditor.window[1]) topics = guiGridListAddColumn(GUIEditor.gridlist[1], "Topics", 0.9) rulesRow = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText ( GUIEditor.gridlist[1], rulesRow, topics, "Rules", false, false ) if (guiGridListGetSelectedItem (GUIEditor.gridlist[1]) == rulesRow) then local xmlRules = xmlLoadFile ( "rules.xml" ) local RulesValue = xmlNodeGetValue ( xmlRules) guiSetText (GUIEditor.memo[2], tostring ( RulesValue ) ) meta <meta> <script src="c.lua" type="client"/> <file src="rules.xml" </meta> Link to comment
OGF Posted March 9, 2013 Share Posted March 9, 2013 should not be set to client just enter like Suggest you take a look at https://wiki.multitheftauto.com/wiki/Meta.xml Link to comment
Baseplate Posted March 9, 2013 Author Share Posted March 9, 2013 I do know meta.xml but I just sometimes see people using the xml file as client so followed that. 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