Jump to content

Defined ID numbers for objects


kuwalda

Recommended Posts

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

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

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