04-06-2013, 11:03 PM
Ah, sorry forgot. It returns a list, and you can do like Player[1], player[2] and so on.
cIniFile help?
|
04-06-2013, 11:03 PM
Ah, sorry forgot. It returns a list, and you can do like Player[1], player[2] and so on.
Thanks given by: NiLSPACE
Actually MCServer already has a StringSplit() function that does more or less the same thing, but may be faster because it's native. It returns an AStringVector, which is exported to the Lua API so that you can use:
Code: local Values = StringSplit(IniFile.Get(...), ","); -- split by commas
04-07-2013, 02:07 AM
Arrays are 1-based.
I didn't know that existed, is it in the global function helpers section on the wiki?
04-07-2013, 02:17 AM
Lua arrays are, but are these native arrays as well? That's the question.
It's in the globals, but no wonder noone notices it - the wiki page is almost unreachable: http://www.mc-server.org/wiki/doku.php?i...in:globals
04-07-2013, 03:19 AM
I just added it That's why its there.
04-07-2013, 03:39 AM
(04-07-2013, 02:17 AM)xoft Wrote: Lua arrays are, but are these native arrays as well? That's the question. It's not a native array, it is pushed to Lua as a Lua array effectively copying the entire thing. |
« Next Oldest | Next Newest »
|