Advertisement
Guest User

asd

a guest
Jun 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.72 KB | None | 0 0
  1. function loadList()
  2.     if fileExists("wanteds.xml") then
  3.         local node = xmlLoadFile("wanteds.xml")
  4.         if node then
  5.  
  6.         end
  7.     else
  8.         local node = xmlCreateFile("wanteds.xml","wanteds")
  9.         if node then
  10.             local childNode = xmlCreateChild(node, "newchild")
  11.             xmlSaveFile(node)
  12.             xmlUnloadFile(node)
  13.             outputChatBox("wanteds.xml elkészítve.")
  14.         else
  15.             outputChatBox("wanteds.xml elkészítése sikertelen.")
  16.         end
  17.     end
  18. end
  19.  
  20. function createFileHandler()
  21.    local rootNode = xmlCreateFile("new.xml","newroot")
  22.    local childNode = xmlCreateChild(rootNode, "newchild")
  23.    xmlSaveFile(rootNode)
  24.    xmlUnloadFile(rootNode)
  25.    outputChatBox("Elkészítve")
  26. end
  27.  
  28. addCommandHandler("createfile", createFileHandler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement