Wei Posted June 3, 2012 Posted June 3, 2012 function refresh() local theVehXML = xmlLoadFile("vehicle.xml") local node = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleID", 0 ) local success = xmlNodeGetValue ( node ) local node1 = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleName", 0 ) local success1 = xmlNodeGetValue ( node1 ) local node2 = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleLocation", 0 ) local success2 = xmlNodeGetValue (node2 ) local node3 = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleHealth", 0 ) local success3 = xmlNodeGetValue ( node3 ) guiSetText(theVehID, tostring( success ) ) guiSetText(theVehName, tostring( success1 ) ) guiSetText(theVehLocation, tostring( success2 ) ) guiSetText(theVehHealth, tostring( success3 ) ) end It say for some bad argument whats wrong ?
Wei Posted June 3, 2012 Author Posted June 3, 2012 <vehicles> <blazyVehicleID>411</blazyVehicleID> <blazyVehicleName>Infernus</blazyVehicleName> <blazyVehicleLocation>1123, 1233, 15</blazyVehicleLocation> <blazyVehicleHealth>851</blazyVehicleHealth> </vehicles> I set those on the server script
Castillo Posted June 3, 2012 Posted June 3, 2012 I've tested your script and it has no problems, it's working fine. Are you sure that the XML is successfully loaded? Try this: function refresh ( ) local theVehXML = xmlLoadFile ( "vehicle.xml" ) if ( theVehXML ) then local node = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleID", 0 ) local success = xmlNodeGetValue ( node ) local node1 = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleName", 0 ) local success1 = xmlNodeGetValue ( node1 ) local node2 = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleLocation", 0 ) local success2 = xmlNodeGetValue (node2 ) local node3 = xmlFindChild ( theVehXML, getPlayerName(getLocalPlayer()).."VehicleHealth", 0 ) local success3 = xmlNodeGetValue ( node3 ) guiSetText(theVehID, tostring( success ) ) guiSetText(theVehName, tostring( success1 ) ) guiSetText(theVehLocation, tostring( success2 ) ) guiSetText(theVehHealth, tostring( success3 ) ) else outputChatBox ( "Failed to load vehicle.xml!", 255, 0, 0 ) end end
Wei Posted June 3, 2012 Author Posted June 3, 2012 I've forgot to put it in the meta. Sory for disturbing you. Thanks
Castillo Posted June 3, 2012 Posted June 3, 2012 You're not disturbing me, I'm here to help. You're welcome.
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