Jump to content

XML Problem


ertlflorian1

Recommended Posts

Hi i have an problem there will be always showerror triggered, when the xml exists and when not please help me

I will wen the xml exists then the first part will happen else show error must be triggered

addEventHandler ("onClientGUIClick", getRootElement(), 
    function (state) 
        if state == "left" then 
            if source == but1 then 
            gme = getLocalPlayer() 
            pname = getPlayerName (gme) 
                    if (fileExists ("koordinaten.xml") )then 
    local rootnode = xmlLoadFile("koordinaten.xml") 
    local children = xmlNodeGetChildren(rootnode) 
    for index, node in ipairs(children) do 
        local xx = tonumber(xmlNodeGetAttribute(node, "x")) 
        local yy = tonumber(xmlNodeGetAttribute(node, "y")) 
        local zz = tonumber(xmlNodeGetAttribute(node, "z")) 
         guiSetText (text, xx..", "..yy..", "..zz..", ") 
         end 
else 
        triggerServerEvent ("showerror", getRootElement(), pname) 
        end 
        end 
        end 
end) 

Sorry for my very bad english :(

Link to comment
addEventHandler ("onClientGUIClick", getRootElement(), 
    function (state) 
        if state == "left" then 
            if source == but1 then 
            gme = getLocalPlayer() 
            pname = getPlayerName (gme) 
                    if (fileExists ("koordinaten.xml") )then 
    local rootnode = xmlLoadFile("koordinaten.xml") 
    local children = xmlNodeGetChildren(rootnode) 
    for index, node in ipairs(children) do 
        local xx = tonumber(xmlNodeGetAttribute(node, "x")) 
        local yy = tonumber(xmlNodeGetAttribute(node, "y")) 
        local zz = tonumber(xmlNodeGetAttribute(node, "z")) 
         guiSetText (text, xx..", "..yy..", "..zz..", ") 
         end 
else 
        triggerServerEvent ("showerror", localPlayer, pname) 
        end 
        end 
        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...