Tete omar Posted July 5, 2012 Share Posted July 5, 2012 (edited) If i want to change something into meta.xml file should i use fileWrite ? ok i want to use it after click on a button like this server side addEvent("thebutton1", true) function thebutton1() destroyElement( Marker2 ) end addEventHandler('thebutton1',getRootElement(),thebutton1) addEvent("thebutton2", true) function thebutton2() destroyElement( Marker2 ) end addEventHandler('thebutton2',getRootElement(),thebutton2) client side function closethewindow() if ( source == GUIEditor_Button[3] ) then guiSetVisible(GUIEditor_Window[2], false) showCursor(false) guiSetInputEnabled(false) triggerServerEvent("thebutton1", getRootElement()) outputChatBox(" now go take this house", getRootElement(), 255,255,0 ) elseif ( source == GUIEditor_Button[4] ) then guiSetVisible(GUIEditor_Window[2], false) showCursor(false) guiSetInputEnabled(false) triggerServerEvent("thebutton2", getRootElement()) outputChatBox(" now go take this house !!! ", getRootElement(), 255,255,0 ) end end addEventHandler('onClientGUIClick', root, closethewindow) this is 2 buttons on 2 tabs so .. i want here to make fileWrite happens after this function thebutton1() destroyElement( Marker2 ) fileWrite("meta.xml", "anything here") end addEventHandler('thebutton1',getRootElement(),thebutton1) addEvent("thebutton2", true) function thebutton2() destroyElement( Marker2 ) fileWrite("meta.xml", "anything here") end addEventHandler('thebutton2',getRootElement(),thebutton2) but i don't want the meta.xml only " anything here " here's the meta.xml file "#minplayers" value="[ 0 ]"> "#maxplayers" value="[ 128 ]"> "#gravity" value="[ 0.008000 ]"> "#weather" value="[ 0 ]"> "#time" value="6:0"> "#locked_time" value="[ false ]"> "#waveheight" value="[ 0 ]"> "#gamespeed" value="[ 1 ]"> "maps/MAKR1.map" dimension="0"> actually i want to change time to 00:00 into the meta file but not to use setTime function suppose i do like this function thebutton1() destroyElement( Marker2 ) fileWrite("meta.xml", "" value="00:00">") end addEventHandler('thebutton1',getRootElement(),thebutton1) addEvent("thebutton2", true) function thebutton2() destroyElement( Marker2 ) fileWrite("meta.xml", "" value="00:00">") end addEventHandler('thebutton2',getRootElement(),thebutton2) if there are an otherwise i would be thankful if you told me here. Edited July 5, 2012 by Guest Link to comment
Castillo Posted July 5, 2012 Share Posted July 5, 2012 "meta.xml" is a XML file, you must use the XML functions. Link to comment
Tete omar Posted July 5, 2012 Author Share Posted July 5, 2012 "meta.xml" is a XML file, you must use the XML functions. how ???? XML functions ?? Link to comment
Castillo Posted July 5, 2012 Share Posted July 5, 2012 https://wiki.multitheftauto.com/wiki/Ser ... _functions Link to comment
TAPL Posted July 5, 2012 Share Posted July 5, 2012 (edited) if you want change the settings in meta.xml you can use this https://wiki.multitheftauto.com/wiki/Set https://wiki.multitheftauto.com/wiki/Set ... ting_names Edited July 5, 2012 by Guest Link to comment
Tete omar Posted July 5, 2012 Author Share Posted July 5, 2012 xmlNodeSetName is fit i guess .. and sorry .. for the first time i use XML functions Link to comment
Tete omar Posted July 5, 2012 Author Share Posted July 5, 2012 if you want change the settings in meta.xmlyou can use this https://wiki.multitheftauto.com/wiki/Set https://wiki.multitheftauto.com/wiki/Set ... ting_names hmm i used it like this TAPL function thebutton1() destroyElement( Marker2 ) set ("#time", 00:00) end addEventHandler('thebutton1',getRootElement(),thebutton1) it worked but i want to set time when i press on the button not when the resource start :\ Link to comment
Jaysds1 Posted July 5, 2012 Share Posted July 5, 2012 you could use the set get functions anytime, not only on resource start. Link to comment
Tete omar Posted July 5, 2012 Author Share Posted July 5, 2012 you could use the set get functions anytime, not only on resource start. get ( "#time" ) set ( "#time", 00:00 ) how about this .. i see the time suddenly changed when i restarted the gamemode .. but i want it if i press the button Link to comment
TAPL Posted July 5, 2012 Share Posted July 5, 2012 Why you don't use setTime? settings is an data that saved inside meta the gamemode when you start it, it will get the time in the settings and set it using setTime you can use this event https://wiki.multitheftauto.com/wiki/OnSettingChange with setTime and when you click on the button, use this https://wiki.multitheftauto.com/wiki/set and the time will changed. Link to comment
Tete omar Posted July 6, 2012 Author Share Posted July 6, 2012 doesn't work tapl and i told you i don't want to use setTime function ... but. .. .. .. i keep try it over then over .. nothing supports me i guess thanks all Link to comment
TAPL Posted July 6, 2012 Share Posted July 6, 2012 explain for us why you don't want use function setTime as far as i know there no other way to change the time without using setTime 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