bradio10 Posted January 9, 2015 Share Posted January 9, 2015 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. Link to comment
Gallardo9944 Posted January 9, 2015 Share Posted January 9, 2015 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. Link to comment
Dzsozi (h03) Posted January 9, 2015 Share Posted January 9, 2015 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! Link to comment
bradio10 Posted January 9, 2015 Author Share Posted January 9, 2015 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? Link to comment
Dzsozi (h03) Posted January 10, 2015 Share Posted January 10, 2015 Maybe you could try getGroundPosition instead of colshapes, but it's a CLIENT ONLY function. 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