Jump to content

XML problem


JeViCo

Recommended Posts

Hello guys, i have a problem.

--------LOADING POSITION
	if not fileExists("settings.xml") then
		local x, y, z = getElementPosition(player)
		local settingsXML = xmlCreateFile("settings.xml", "settings")
		xmlNodeSetAttribute(xmlCreateChild(settingsXML, "positionX"), "x", "false")
		xmlNodeSetAttribute(xmlCreateChild(settingsXML, "positionY"), "y", "false")
		xmlSaveFile(settingsXML)
		xmlUnloadFile(settingsXML)
		chatbox.posX = screenX/2-200
		chatbox.posY = 10 + chatbox.tabHeight
	else
		local settingsXML = xmlLoadFile("settings.xml")
		local positionX = xmlFindChild(settingsXML, "positionX", 0)
		if positionX then
			local x = xmlNodeGetAttribute(positionX, "x")
			chatbox.posX = tonumber(x) or 10
		end
		local positionY = xmlFindChild(settingsXML, "positionY", 0)
		if positionY then
			local y = xmlNodeGetAttribute(positionY, "y")
			chatbox.posY = tonumber(y) or 10 + chatbox.tabHeight
		end
		xmlUnloadFile(settingsXML)
	end

this part of dx chat doesn't work. How can i fix it? Should i write something in meta.xml to make it work?

Link to comment

The file, which is created by script, always in client-side folders. In other words, the script use this file to save player datas and doing this with created files in client-side folders. If file doesn't exist then new one is created. In this lines you did this. And you must look downloaded client scripts. (...MTA/mods/deathmatch/resources and find your script.)

  • Thanks 1
Link to comment
  • 3 months later...
On 07.02.2018 at 14:25, URBAN said:

If its client sided check mta resources folder

 

On 07.02.2018 at 16:42, Maes said:

The file, which is created by script, always in client-side folders. In other words, the script use this file to save player datas and doing this with created files in client-side folders. If file doesn't exist then new one is created. In this lines you did this. And you must look downloaded client scripts. (...MTA/mods/deathmatch/resources and find your script.)

yeah, that was so stupid xD Thank you both

Link to comment

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