Jump to content

badArgument


Wei

Recommended Posts

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 ?

Link to comment

<vehicles> 
    <blazyVehicleID>411</blazyVehicleID> 
    <blazyVehicleName>Infernus</blazyVehicleName> 
    <blazyVehicleLocation>1123, 1233, 15</blazyVehicleLocation> 
    <blazyVehicleHealth>851</blazyVehicleHealth> 
</vehicles> 
  

I set those on the server script

Link to comment

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 

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