Jump to content

XML problem :$


iFoReX

Recommended Posts

Posted

@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 

Posted

why it doesnt work :/

function saveXmlFile() 
local RootNode = xmlCreateFile("new.xml"," newroot") 
end 
addCommandHandler("xmlc", saveXmlFile) 

Posted

doesnt work again :/

function saveXmlFile() 
local RootNode = xmlCreateFile("new.xml"," newroot") 
xmlSaveFile( RootNode ) 
end 
addCommandHandler("xmlc", saveXmlFile) 

Posted

How returns ?

function saveXmlFile() 
local RootNode = xmlCreateFile("new.xml"," newroot", true)  ---???? 
xmlSaveFile( RootNode ) 
end 
addCommandHandler("xmlc", saveXmlFile) 

Posted

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

Posted

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) 

mtascreen20120422063055.png

Posted

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 ?

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...