Gang

Location

Occupation

Interests

Hello Everybody !
Please help me to fix below script with XML file.
There's a XML file called 'codes.xml'. Inside of that XML file looks like below.
<pass characters="1234" allowed="true" />
<pass characters="5678" allowed="true" />
<pass characters="9012" allowed="true" />
Characters shown in above XML is used as a security key for open a certain door. Each character set can be used only once. There's a LUA script which is not completed yet can be seen below.
function open(player, command, code)
if code then
---
addCommandHandler("pass",open)
Well. If any player command as /pass 5678 , then the door will be open as security code is inserted in the previous XML file. But I need your help to make this work.
* When a player command, how to check that the security code is inserted in XML file ?
* When the security code is right, how to change corresponding allowed node to false ?

Hello,
I'm trying to pass my server side settings defined in my meta.xml to the client. However, when passing the table of XML data to the client, the data does not persist.
Here's my server side code:
addEvent("onClientRequestResourceSettings", true)
addEventHandler("onClientRequestResourceSettings", resourceRoot,
function()
local xml = xmlLoadFile("meta.xml")
local settingsNode = xmlFindChild(xml, "settings", 0)
if(settingsNode) then
local settings = xmlNodeGetChildren(settingsNode)
triggerClientEvent(client, "onServerProvideResourceSettings", resourceRoot, settings)
end
xmlUnloadFile(xml)
end
)
That above event is called client side when the resource starts.
Here's the client side code:
addEvent("onServerProvideResourceSettings", true)
addEventHandler("onServerProvideResourceSettings", resourceRoot,
function(theSettings)
iprint("Settings provided: "..inspect(theSettings)) --Output: "Settings provided: { }"
end
)
However my settings table is not being passed to the client. When printing the output, it appears to be an empty table. I'm aware there is a limitation of passing xml data to the client, however as this is in fact a table data type, I wouldn't of thought there would be an issue?
Can anyone point me in the right direction, or perhaps provide some better solutions for passing settings data from the meta.xml to the client?
Cheers.

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 !