Jump to content

[HELP]Problem loading XML File


Dreamer

Recommended Posts

Hello! So my problem is that i can't load xml file after i edited data in it. It was loading succesfully, but when i replaced it with the file made exactly like previous. Ok it doesn't loads, and i tried putting back my previous xml file, (which WAS working) but it don't work either anymore. Any suggestions?

Link to comment

Here you go, a part of my script.

function ShowWindow()  
    local player = getLocalPlayer()  
    local vehicle = getPedOccupiedVehicle(player) 
    local trailer = getVehicleTowedByVehicle(vehicle) 
    local towedvehicle = getVehicleTowingVehicle ( trailer ) 
    if vehicle then 
    xmlLoaded = xmlLoadFile( "List.xml" ) 
    if xmlLoaded then 
    outputDebugString("trueloading") 
    else outputDebugString("falseloading") 
    end 
            if ( towedvehicle == vehicle ) then 
                if getElementModel(trailer) == 584 then 
                    Trailerxml = xmlFindChild( xmlLoaded, "Somenode", 0) 
                    guiSetVisible(JOBWindow, true) 
                    guiSetInputEnabled(true) 
                    showCursor(true) 
                    doFunction1() 
                end 
         
                if getElementModel(trailer) == 435 then 
                    Trailerxml = xmlFindChild(xmlLoaded, "Somedifferentnode", 0) 
                    guiSetVisible(JOBWindow, true) 
                    guiSetInputEnabled(true) 
                    showCursor(true) 
                    ChooseCargo() 
                end 
         
                if getElementModel(trailer) == 450 then 
                    Trailerxml = xmlFindChild( xmlLoaded, "Anothernode", 0) 
                    guiSetVisible(JOBWindow, true) 
                    guiSetInputEnabled(true) 
                    showCursor(true) 
                    doDunction1() 
                end 
         
                outputChatBox("Trailer is attached") 
            else 
                outputChatBox("Error! Please Attach Your Trailer!") 
            end 
    else 
    outputChatBox("Error! Enter a vehicle, First!") 
    end 
end 
  
addEvent("ShowWindow", true) 
addEventHandler("ShowWindow",getRootElement(),ShowWindow) 
  

As mentioned before, the script is Fine, fully operational only thing what was changed is xml file, and now it doesn't load

Also I had tried putting xmlLoadFile function in event "onClientResourceStart",but no results. Also tried putting xml file in different resource, still no results

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