Jump to content

Verificar quais coordenada que esta na tabela mais não está não esta na XML


Recommended Posts

Bom dia, 

Pessoal to a 2 dias tentando fazer um sistema que verifica quais coordenada que nao esta salva no XML so que nao ta dando certo. O que eu quero que ele verifique as coordenada, esteja igual no XML e os que nao ta no XML ele completa, tipo tenho 114 carros no mapa so que na tabela eu tenho 144 quero que ele complete esses 30 carros que falta no mapa.

OBS: 

 


-------------------------------------------------------------
--- TABELA

x,y,z = data[2],data[3],data[4]

-------------------------------------------------------------
--- NO XML

spawnX,spawnY,spawnZ = tonumber(xmlNodeGetAttribute(node,"spawnX")),tonumber(xmlNodeGetAttribute(node,"spawnY")),tonumber(xmlNodeGetAttribute(node,"spawnZ"))
addCommandHandler("recu", function (ps,cmd)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(ps)),aclGetGroup("Admin")) then
	    spawnDayZVehicles2()
	    outputChatBox("Vehicles has been spawned!",ps,255,0,0,true)
    end
end)

function spawnDayZVehicles2()
	xml = xmlLoadFile("Backups/Vehicles/XVehicles.xml")
	
	for i,data in ipairs(vehSpawns["vehicleSpawns"]) do
	    count = 0
		IDVehicles = tonumber(data[2])
		for i,node in ipairs(xmlNodeGetChildren(xml)) do
			spawnX = tonumber(xmlNodeGetAttribute(node,"spawnX"))
			count = count + 1
			if IDVehicles then
			
				if spawnX == IDVehicles then
			
					outputChatBox("1 - Adicionado carro sem spwan! [#FF0000"..count.."#FFFFFF]",getRootElement(),255,255,255,true)
				-- else
				-- count = count + 1	
				-- outputChatBox("2 - Adicionado carro sem spwan! [#FF0000"..count.."#FFFFFF]",getRootElement(),255,255,255,true)
				end
			end
		end
		return
	end
	xmlUnloadFile(xml)
end

 

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