Jump to content

xml nodes and \n


Gordon_G

Recommended Posts

Hello,

I would like to get the last updates by an xml file and write it in a memo. But ; for this I need to pass lines.

My xml : 

<settings>
<news>something \n other</news>
</settings>

server :

-- Server :



function showNews(source)
local settings = xmlLoadFile(":script/settings.xml")
triggerClientEvent(source,"shownews",source,xmlNodeGetValue(xmlFindChild(settings, "news", 0)))
end

-- I made a bind a bind to this function  somewhere else in my script and it work so, it's not the problem

client :

-- Client :



function showNews(news_)
if news then destroyElement(news) else
local screenW, screenH = guiGetScreenSize()
news = guiCreateMemo((screenW - 505) / 2, (screenH - 304) / 2, 505, 304, news_, false)

end
end
addEvent("shownews",true)
addEventHandler("shownews",getLocalPlayer(),showNews)

So, when I push my key who is bind, I can see the memo, I can see the text but, I would like to see it like this :

"something 

other"

not like this "something \n"

 

Thanks !

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