iFoReX Posted April 21, 2012 Posted April 21, 2012 @Tittle please help me , the xml.file doesnt create here the script elseif source == GUIEditor_Button[3] then setCameraTarget( localPlayer ) guiSetVisible( GUIEditor_Window[1], false ) guiSetVisible( GUIEditor_Window[2], false ) showCursor(false) setElementDimension( localPlayer, 0 ) setElementAlpha( localPlayer, 255 ) local money = getPlayerMoney( localPlayer ) if ( money >= 15000 ) then triggerServerEvent("qtm", getLocalPlayer() ) setElementModel( localPlayer, tonumber ( guiGetText ( GUIEditor_Edit[1] ) ) ) local skinxml = xmlCreateFile("skins.xml"," skinsp") local NewNode = xmlCreateChild(skinxml, "skinsps") xmlSaveFile(skinxml) else outputChatBox( " Para Comprarte este skin necesitas $15000 y tu dinero es ".. money .." " ) end end end
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 but the getplayermoney and the takeplayermoney work , the xml create doenst work
Michael# Posted April 21, 2012 Posted April 21, 2012 Because getPlayerMoney don't return a right value, it don't pass statement. You should learn and check if it pass statement.
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 why it doesnt work function saveXmlFile() local RootNode = xmlCreateFile("new.xml"," newroot") end addCommandHandler("xmlc", saveXmlFile)
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 doesnt work again function saveXmlFile() local RootNode = xmlCreateFile("new.xml"," newroot") xmlSaveFile( RootNode ) end addCommandHandler("xmlc", saveXmlFile)
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 Doesnt Work man , The file.xml doesnt create
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 How returns ? function saveXmlFile() local RootNode = xmlCreateFile("new.xml"," newroot", true) ---???? xmlSaveFile( RootNode ) end addCommandHandler("xmlc", saveXmlFile)
Kenix Posted April 21, 2012 Posted April 21, 2012 I mean check returned value. https://wiki.multitheftauto.com/wiki/OutputChatBox https://wiki.multitheftauto.com/wiki/OutputDebugString .. I think your script not working, because you not add lines to meta.xml or script have syntax errors. File new.xml should created. Also function xmlCreateFile have only 2 arguments. Why you use 3? And can you tabulate your code? Founded http://gmc.yoyogames.com/index.php?showtopic=511359
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 Doesnt Work The Chat message appear but the file .xml doesnt appear function saveXmlFile() local RootNode = xmlCreateFile("new.xml"," newroot") xmlSaveFile( RootNode ) outputChatBox("Element Created Succesfelly") end addCommandHandler("xmlc", saveXmlFile)
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 Lolllllllllllllllll sory my Error is server-side xDD now create the file
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 Please Kenix send me the Manuals Now I read it
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 I done it : function e ( ) local money = getPlayerMoney ( source ) if ( money >= 15000 ) then takePlayerMoney ( source, 15000 ) local Skins = xmlCreateFile("skins.xml","Propietarios") local propietarios = xmlCreateChild(Skins, "owners") local success = xmlNodeSetValue ( propietarios, "..trosting ( guiGetText ( GUIEditor_Edit[1] ) ).. " ) xmlSaveFile( Skins ) else outputChatBox ( " tu Dinero es ".. money .." y necesitas $15000 para comprarte un skin." ) end end addEvent ( "qtm", true ) addEventHandler ( "qtm", root, e ) Work... But Doesnt get The text of the GUIEditor_Editor[1] why ?
Castillo Posted April 21, 2012 Posted April 21, 2012 That's server side, and ALL GUI functions are client side, could you start thinking on what are you doing?
iFoReX Posted April 21, 2012 Author Posted April 21, 2012 yeah solid I thinked it But IDK how I put my element in server-side if the element is client-side
Michael# Posted April 22, 2012 Posted April 22, 2012 Trigger event "qtm" to server-side with GUI element text after the element and in event function "qtm" add ... example, myText. myText will be the GUI element text that you triggered. Understand?
iFoReX Posted April 22, 2012 Author Posted April 22, 2012 ye seb I has undestand it , but I dont undestand "myText"
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