ertlflorian1 Posted February 13, 2013 Posted February 13, 2013 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
iPrestege Posted February 13, 2013 Posted February 13, 2013 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)
csiguusz Posted February 13, 2013 Posted February 13, 2013 Is your file correctly added to the meta.xml?
iPrestege Posted February 13, 2013 Posted February 13, 2013 Is your file correctly added to the meta.xml? Yes, he should add it!
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