DutchCaffeine Posted June 22, 2008 Share Posted June 22, 2008 Hello, I be busy with my class selection system. And i use tables/arrays for it, but it gives me every time an error: local classes = { 'police' = { There is everywhere i get the error of, it says that he misses a closing '}' char The script: http://paste.ubuntu.com/22093/ Alexander. Link to comment
tma Posted June 22, 2008 Share Posted June 22, 2008 I think it's the way you're declaring the array indicies. Try it like this instead: local classes = { civilians = { title = 'Street people', team = 'civilian', message = 'Living people on the streets,\nThey do just normal!' }, ... You can then access like: local p = classes["civilians"] OR local p = classes.civilians Link to comment
DutchCaffeine Posted June 22, 2008 Author Share Posted June 22, 2008 Thanks, i't is working now, and how! Link to comment
robhol Posted June 22, 2008 Share Posted June 22, 2008 I'd like to advise you to use XML. It's not too hard, and it's a LOT easier to change and customize later on. Link to comment
Willy Posted June 23, 2008 Share Posted June 23, 2008 I'm going to have to disagree, i've recently written a script and it was a toss up between xml or lua tables, and it turns out that tables were by far the best to use. Once you realise the power of tables XML becomes as insignificant as Brophy's sexual advances. Link to comment
eAi Posted June 24, 2008 Share Posted June 24, 2008 Use XML if you wish the data to be persistent or editable by administrators, otherwise use tables. Link to comment
DutchCaffeine Posted June 24, 2008 Author Share Posted June 24, 2008 in my way i prefer tables, i had created first this system with xml but it wasn't working. And now, i've got the best system of the whole mta community Link to comment
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