thenuke321

Untitled

Feb 26th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.96 KB | None | 0 0
  1. Loco = xmlLoadFile("accountsDB.xml")
  2.  
  3. function startup()
  4.     for k, v in ipairs(xmlNodeGetChildren(Loco)) do    
  5.         local pos = split(xmlNodeGetAttribute(v,"pos"),string.byte(","))
  6.         PAS = createMarker(pos[1],pos[2],pos[3]-1,"cylinder",5)
  7.         bl = createBlip(pos[1],pos[2],pos[3]-1,63)
  8.             setBlipVisibleDistance(bl,200)
  9.         addEventHandler("onMarkerHit",PAS,Logic)
  10.     end
  11. end
  12. --setTimer(startup,50,1)
  13. addCommandHandler("rerun",startup)
  14. addEvent("Zoo.zooLoop1", true)
  15. addEventHandler("Zoo.zooLoop1", root, startup)
  16.  
  17. --[[
  18.         xmlUnloadFile(Loco)
  19.         triggerEvent("Zoo.zooLoop1",root)
  20. ]]--
  21.  
  22. local reloads = false
  23. function reload ()
  24.     if (not reloads) then
  25.         reloads = true
  26.             xmlUnloadFile(Loco)
  27.             outputChatBox("reload")
  28.             setTimer(reload,50,1)
  29.     else
  30.         reloads = false
  31.         outputChatBox("reload2")
  32.         Loco = xmlLoadFile("accountsDB.xml")
  33.         triggerEvent("Zoo.zooLoop1",root)
  34.     end
  35. end
  36. addCommandHandler("flashxml",reload)
  37.  
  38. function inject (playerSource)
  39. local x,y,z = getElementPosition(playerSource)
  40. local account = getPlayerAccount(playerSource)
  41. local Name = getAccountName(account)
  42. local Cash = getPlayerMoney(playerSource)
  43. local pos = xmlFindChild(Loco,Name,0)
  44.     if not pos then
  45.         outputChatBox("created")
  46.         xmlCreateChild(Loco,Name)
  47.         outputChatBox("True")
  48.         --setTimer(inject,50,1)
  49.     else
  50.         xmlNodeSetAttribute(pos,Name,Name..","..tostring(Cash)..","..x .. "," .. y .. "," .. z)
  51.         xmlSaveFile(Loco)
  52.         outputChatBox(x..","..y..","..z)
  53.         outputChatBox(tostring(Name))
  54.         outputChatBox("True1")
  55.     end
  56. end
  57. addCommandHandler("de",inject)
  58.  
  59. function LA (playerSource)
  60. local account = getPlayerAccount(playerSource)
  61. local Name = getAccountName(account)
  62.     outputChatBox(tostring(Name))
  63. end
  64. addCommandHandler("LULZ",LA)
  65.  
  66.  
  67. function DAX (playerSource)
  68. local account = getPlayerAccount(playerSource)
  69. local Name = getAccountName(account)
  70. local LSX = xmlFindChild(Loco,Name,0)
  71. for k, v in ipairs(xmlNodeGetChildren(Loco)) do    
  72.         local Info = split(xmlNodeGetAttribute(v,Name),string.byte(","))
  73.         outputChatBox(tostring(Info))
  74.         --[[
  75.         outputChatBox("Name: "..tostring(Info[1]))
  76.         outputChatBox("Cash: "..Info[2])
  77.         outputChatBox("X: "..Info[3])
  78.         outputChatBox("Y: "..Info[4])
  79.         outputChatBox("Z: "..Info[5])
  80.         setElementPosition(playerSource,Info[3],Info[4],Info[5])
  81.         setPlayerMoney(playerSource,tonumber(Info[2]))
  82.         ]]--
  83.     end
  84. end
  85. addCommandHandler("pull",DAX)
  86.  
  87. function DOX (playerSource)
  88. local account = getPlayerAccount(playerSource)
  89. local Name = getAccountName(account)
  90. local LSX = xmlFindChild(Loco,Name,0)  
  91. local Find = xmlFindChild(Loco,tostring(Name),0)
  92. local PULL = xmlNodeGetAttribute(Find,tostring(Name))
  93. --  outputChatBox(tostring(Name))
  94.     outputChatBox(tostring(PULL))
  95.  
  96. end
  97. addCommandHandler("DOXIN",DOX)
  98.  
  99. function XMLLOAD ()
  100. Loco = xmlLoadFile("accountsDB.xml")
  101.     if Loco then
  102.         outputChatBox(tostring(Loco))
  103.         outputChatBox("True")
  104.     else
  105.         outputChatBox("false")
  106.         return false
  107.     end
  108. end
  109. addCommandHandler("xmlload",XMLLOAD)
Advertisement
Add Comment
Please, Sign In to add comment