manve1 Posted January 3, 2013 Posted January 3, 2013 Is there a way of changing .xml file while you are in game? For example: If the .xml file had inside: 'here type anything' how could i change the 'here type anything' to anything a player wants to type inside? Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted January 3, 2013 Posted January 3, 2013 Use the XML functions. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted January 3, 2013 Author Posted January 3, 2013 I mean which function do i use Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted January 3, 2013 Posted January 3, 2013 xmlNodeSetAttribute San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jaysds1 Posted January 3, 2013 Posted January 3, 2013 well, you would need to find the child first. example: > >>> to set what ever is in the rootChild, use what solidSnake posted. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
manve1 Posted January 3, 2013 Author Posted January 3, 2013 I have tried to make it to work, but as i am new to the xml functions, i need some help: LUA: addEventHandler('onResourceStart', resourceRoot, function( ) saveS = xmlLoadFile( 'save.xml' ) local save_info = xmlFindChild(saveS, 'turf', 0) xmlNodeSetAttribute( save_info, 'turf', 'nothing new' ) end ) META: SAVE.XML: "No" /> Looking for tutorials or information? check out: www.simpleask.co.uk
Castillo Posted January 3, 2013 Posted January 3, 2013 addEventHandler('onResourceStart', resourceRoot, function( ) saveS = xmlLoadFile( 'save.xml' ) local save_info = xmlFindChild(saveS, 'turf', 0) xmlNodeSetAttribute( save_info, 'save', 'nothing new' ) end ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
manve1 Posted January 3, 2013 Author Posted January 3, 2013 It didn't change the xml file, any ideas why it didn't? Looking for tutorials or information? check out: www.simpleask.co.uk
manve1 Posted January 3, 2013 Author Posted January 3, 2013 Thank you Castro and Solidsnake14 Looking for tutorials or information? check out: www.simpleask.co.uk
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