Jump to content

Search the Community

Showing results for tags 'xmlcreatechild'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. Hi there, I am trying to implement a error system, and i am stuck on the problem, that xmlCreateChild overwrites the old node and so i cant get an error-list. Here is the Code: [lua]--------------------------------------------------Fehler in XML speichern-------------------------------------------------- function registerError( errorType, errorDescription ) local xmlErrorLog = xmlLoadFile( "errorLog.xml" ) if xmlErrorLog == false then xmlErrorLog = xmlCreateFile( "errorLog.xml", "errors" ) end local time = getRealTime( ) -- Die Zeit des Fehlers local timeString = "" .. time["year"]+1900 .. "." .. time["month"]+1 .. "." .. time["monthday"] .. "-" .. time["hour"] .. "." .. time["minute"] .. "." .. time["second"] local xmlNewError = xmlCreateChild( xmlErrorLog, timeString ) xmlNodeSetAttribute( xmlNewError, "type", errorType ) xmlNodeSetAttribute( xmlNewError, "description", errorDescription ) xmlSaveFile( xmlErrorLog ) xmlUnloadFile( xmlErrorLog ) end addEvent( "registerError" ) addEventHandler( "registerError", root, registerError )[/lua] The node should have been the timestamp, as the "new" node needs a new name, but it doesnt work (old nodes get overwriten). Edit: and somehow the [lua] [/lua] code syntax does not work? Sorry for that too!
×
×
  • Create New...