Jump to content

XML problem :$


iFoReX

Recommended Posts

@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 

Link to comment

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

Link to comment

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

Link to comment

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 ?

Link to comment

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...