kuwalda Posted May 23, 2014 Share Posted May 23, 2014 Hello. My problem is that when I create "speaker object" with "speakerObject = createObject(2229, x, y, z-1)" it stores object data to this global variable. Everything is fine, but when I want to add more of these "speaker objects" they ofcorse overwrite "speakerObject" variable. So my question is - how do I make some kind of list for all of those speakers and numerate them in some kind of order for later use? Like /speaker [id] [settings...] One of my solutions was array, but I was not quite sure how to use them, because I have other settings for these speakers, like sound volume, radio station and so on. Any help will be appriciated. Link to comment
xXMADEXx Posted May 23, 2014 Share Posted May 23, 2014 Read my table section on my tutorial. viewtopic.php?f=148&t=75501 Link to comment
kuwalda Posted May 23, 2014 Author Share Posted May 23, 2014 Thanks for replays, I managed to work something out, but I think it was total shot in the dark for me. For speaker create I use table.insert ( speakerArray, createObject(2229, x, y, z-1) ) Which works fine, but I can`t manage to remove them by using destroyElement(speakerArray[1]) table.remove ( speakerArray, 1 ) And table was created using speakerArray = { } 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