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 

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
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

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

Your script is client side or server side?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 ?

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

That's server side, and ALL GUI functions are client side, could you start thinking on what are you doing?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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