Jump to content

-.Paradox.-

Members
  • Posts

    1,239
  • Joined

  • Last visited

Everything posted by -.Paradox.-

  1. Spider, You will never understand, For me (no offence) Maybe it's somebody else script, Anyway Line 20 change 'onPlayerLogin' and create an event name it 'onPlayerTeamChange' and use it.
  2. -.Paradox.-

    Help!

    You mean onPlayerWasted
  3. No still nothing, Here is the directory of the resource:
  4. Is rootNote returning a file? Try this: function playersData() local rootNote; if ( not fileExists ( 'file.xml' ) ) then rootNote = xmlCreateFile("Data.xml", "Data") xmlSaveFile ( rootNote ) else rootNote = xmlLoadFile("Data.xml") end local playerName = getPlayerName(source) local playerLevel = getElementData(source, "LV") or 0 local playerNode = xmlCreateChild(rootNode, "Player") xmlNodeSetAttribute(playerNode, "Name", playerName) xmlNodeSetAttribute(playerNode, "Level", playerLevel) xmlSaveFile(rootNote) xmlUnloadFile(rootNode) --don't forget to unload it outputChatBox("Succesfully saved !", source) end addEventHandler("onPlayerLogin", root, playersData) if it is still giving you errors, try using this code that I filled with status messages, and tell us what it outputs: function playersData() local rootNote = xmlLoadFile("Data.xml") --to load it once outputDebugString ( "Loading file.... results: "..tostring ( rootNote ) ) if not rootNode then rootNode = xmlCreateFile("Data.xml", "Data") xmlSaveFile ( rootNode ) outputDebugString ( "File created and saved... Result: "..tostring ( rootNote ) ) end local playerName = getPlayerName(source) local playerLevel = getElementData(source, "LV") or 0 local playerNode = xmlCreateChild(rootNode, "Player") outputDebugString ( "Creating 'Player' child... result: "..tostring ( playerNode ) ) xmlNodeSetAttribute(playerNode, "Name", playerName) xmlNodeSetAttribute(playerNode, "Level", playerLevel) local save = xmlSaveFile(rootNote) local unload = xmlUnloadFile(rootNode) --don't forget to unload it outputDebugString ( "File saved and unloaded. Save return: "..tostring(save).." | Unload return: "..tostring ( unload ) ) end addEventHandler("onPlayerLogin", root, playersData) I will try it, Anyway the location where i want this file to get created is in the same directory where the script is.
  5. function playersData() local rootNote = xmlLoadFile("Data.xml") --to load it once if not rootNode then rootNode = xmlCreateFile("Data.xml", "Data") outputChatBox("File created !", source) end local playerName = getPlayerName(source) local playerLevel = getElementData(source, "LV") or 0 local playerNode = xmlCreateChild(rootNode, "Player") xmlNodeSetAttribute(playerNode, "Name", playerName) xmlNodeSetAttribute(playerNode, "Level", playerLevel) xmlSaveFile(rootNote) xmlUnloadFile(rootNode) --don't forget to unload it outputChatBox("Succesfully saved !", source) end addEventHandler("onPlayerLogin", root, playersData) Still not working.. Bad argument 'xmlSaveFile'
  6. No not working...The Data.xml is not created, No errors in debug.
  7. -.Paradox.-

    webmap

    Restart the webmap resource.
  8. Yeah, but sometimes something veery interesting can be seen in other's scripts and you'd improve yourself. From seeing other scripts i got a huge improvement in tables wich i wouldnt have done by myself. Its more like seeing wiki examples, if you think it detailed. I had this also, but in a jar, i deleted it some time ago thought. In my opinion, I think Jar just ruin your computer
  9. For me, He is trying to decompile a client sided script from client cache..
  10. Just mess around with the position of the dxText
  11. I don't think it will help...(no offence)
  12. getAccountName is a Server side function, Your code is client side.
  13. Thanks, But does it create a child "Player" Every time a player login? Like example: <Data> <Player>"Nikolai" "Level"</Player> </Data> And when another player login it will output like this <Data> <Player>"Nikolai" "Level"</Player> <Player>"Citizen" "Level"</Player> </Data> And etc..
  14. -.Paradox.-

    XML Data

    Hello guys, Again i'm trying to output the name and the Level of every player that login to the server, But wasn't working, here is my code. Client: function playersData() if xmlLoadFile(":Data/Data.xml") then outputChatBox("Succesfully loaded!", source) local file = xmlLoadFile(":Data/Data.xml") local dataNode = xmlFindChild(file, "Player", 0) local playerName = getPlayerName(source) local playerLevel = getElementData(source, "LV") or 0 xmlNodeSetAttribute(dataNode, "Name", playerName.."Level" .. playerLevel) else local File = xmlCreateFile("Data.xml"," Data") local Child = xmlCreateChild(File, "Player") xmlSaveFile(File) outputChatBox("File created!", source) end end addEventHandler("onPlayerLogin", getRootElement(), playersData) Data.xml < Data> <Player></Player> </ Data>
  15. Yes exactly, Thanks. I will try to mess around with it to make it work with what i want.
  16. Just do some funky maths to the ScreenWorldPosition. Or mess around with them, I suggest to use offset
  17. I'm trying to solve it... Just wait
  18. -.Paradox.-

    Question

    Hello guys, How i can check when the player register and login with the account that he registred with it, Because i'm trying to create an ElementData(New) for the players that registred with an account and logged in with it for first time, Thanks.
  19. I will try it in server side thanks anyway
  20. I guess it will add 100 in Driving ElementData only once not every 5 minutes, I didn't tested but it seems that there is something wrong with the timer... And thanks for your work i really appreciate it.
×
×
  • Create New...