Dreamer Posted November 2, 2012 Share Posted November 2, 2012 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
myonlake Posted November 2, 2012 Share Posted November 2, 2012 Show us the code you are using. Link to comment
Dreamer Posted November 2, 2012 Author Share Posted November 2, 2012 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
50p Posted November 2, 2012 Share Posted November 2, 2012 Check your file doesn't have an error: http://www.w3schools.com/xml/xml_validator.asp Like you said "i can't load xml file after i edited data in it". Link to comment
Dreamer Posted November 2, 2012 Author Share Posted November 2, 2012 Check your file doesn't have an error: http://www.w3schools.com/xml/xml_validator.asp Like you said "i can't load xml file after i edited data in it". Silly mistake (rofl) , , although i made same type of table in .lua(3 level tables, meaning there is table in table) Thanks anyway, didn't thought to validate xml file . Happens sometimes. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now