Jump to content

Getting all world objects


bradio10

Recommended Posts

Posted

Hi,

So I am wanting to get all the world objects and store in a table.

How do I get all of them?

I have tried getElementsByType("object") but that only gets objects that are created by the player or that are mapped (I am using it clientside, but have also tried it serverside and it still doesnt work the way I want it to)

How do I get every single object there is in the world as well as the standard GTA world objects that in the world?

Thanks.

Posted

There is no such thing as getting all world objects. They do not exist as elements. You can get all their IDs by simply getting IDs of all objects which could ever exist in GTA, that's pretty much it.

Posted

You could have a look at removeWorldModel's wiki example, one example removes all the world objects if I can remember well, you could try doing what you want by editing the example, also you will need

table.insert 

Sorry for bad English if there was something written wrong, I'm from Hungary, but I hope that I could help you!

Posted

Ahk, thanks for your help.

The reason why I am asking is because I am making a system where players can put there own objects in-game and I am wanting to try and make it so the players can't put items under the ground or inside other world objects.

The way I was going to detect it was getting all the world objects, then having a colshape attached to the players object and when the colshape was inside a world object (which would also mean the object as well), it wouldn't allow the object to be placed.

Unless there is an easier way in doing this?

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