SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 13/02/2013, 01:08 AM   #1
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,306
Reputation: 1164
Cool All GTA SA Object Array

A few days ago I was thinking if it would be possible to create an in game RemoveBuildingForPlayer() for my map editor. I knew I would need a list of all the objects in GTA SA and their positions to make it happen so I went ahead extracting all the object data from all the .IPL's processed them into an array.

ENUM

Code:
enum SearchInfo { 
Search_Model, 
Search_LODModel, 
Search_Model_Name[64], 
Float:SearchX, 
Float:SearchY,
Float:SearchZ, 
Float:SearchRX, 
Float:SearchRY, 
Float:SearchRZ 
}
Test position when using test array since it takes a few minutes to compile with the full array list this will help out.

Code:
CMD:testpos(playerid, arg[])
{
	SetPlayerPos(playerid, 3.6618,-2594.0713,39.7159);
	return 1;
}

There are no LOD objects in the list the object positions have their LODModel counterpart listed so using RemoveBuildingForPlayer() for both model and LODmodel should remove the building.

Known issues:
There are a few objects that might not actually have a LODModel associated but is listed anyways although not very many and really should be so much an issue as these objects are often small components of a house for example that has the same position as house object.

The rotation values may not be 100 percent precise for all objects.

File:

https://www.mediafire.com/?2c8ywc3h1veza4p

Last edited by Pottus; 02/11/2015 at 06:01 AM.
Pottus is offline   Reply With Quote
Old 13/02/2013, 01:12 AM   #2
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,306
Reputation: 1164
Default Re: All GTA SA Object Array

I put this in the wrong section by accident please move to includes thanks.
Pottus is offline   Reply With Quote
Old 13/02/2013, 01:27 AM   #3
Jay_
Beta Tester
 
Jay_'s Avatar
 
Join Date: Jul 2009
Posts: 661
Reputation: 188
Default Re: All GTA SA Object Array

Moved.

Good job - I can think of quite a few uses for this for in game map editing.
Jay_ is offline   Reply With Quote
Old 13/02/2013, 01:40 AM   #4
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,420
Reputation: 968
Default Re: All GTA SA Object Array

Omg, I totally needed this! Thank you!
MP2 is offline   Reply With Quote
Old 13/02/2013, 02:51 AM   #5
CaptainMactavish
Huge Clucker
 
CaptainMactavish's Avatar
 
Join Date: Jun 2012
Location: Argentina
Posts: 344
Reputation: 18
Default Respuesta: All GTA SA Object Array

Very useful, arigatou gozaimasu.
__________________


Quote:
Originally Posted by dugi in Slice's Visitor Messages LOL
Donde, está, la biblioteca. Me llamo T-Bone La araña discoteca. Discoteca, muñeca, La biblioteca Está en bigotes grandes, el perro, manteca. Manteca, bigotes, gigante, pequeño, la cabeza es nieve, cerveza es bueno. Buenos dias, me gusta papas frías, los bigotes de la cabra Es Cameron Diaz.
CaptainMactavish is offline   Reply With Quote
Old 21/02/2013, 01:23 AM   #6
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,420
Reputation: 968
Default Re: All GTA SA Object Array

This takes soooooooooooooo long to compile D: (like 3 minutes!).
MP2 is offline   Reply With Quote
Old 21/02/2013, 01:57 AM   #7
Pottus
Godfather
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 5,306
Reputation: 1164
Default Re: All GTA SA Object Array

Quote:
Originally Posted by MP2 View Post
This takes soooooooooooooo long to compile D: (like 3 minutes!).

That is why is there is a test array there, I wish there was a way to compile it quicker I guess it's just the one real con with the array.
Pottus is offline   Reply With Quote
Old 21/02/2013, 02:20 PM   #8
Edvin
Gangsta
 
Edvin's Avatar
 
Join Date: Dec 2010
Posts: 874
Reputation: 71
Default Re: All GTA SA Object Array

Very useful job!
Edvin is offline   Reply With Quote
Old 21/02/2013, 02:36 PM   #9
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,420
Reputation: 968
Default Re: All GTA SA Object Array

Quote:
Originally Posted by [uL]Pottus View Post
That is why is there is a test array there, I wish there was a way to compile it quicker I guess it's just the one real con with the array.
Do ANY of the objects actually USE the rx/ry rotation? NONE of them seem to. I guess you could remove them?

EDIT: Hmm, a few (less than 1 percent) use x and y rotation :/

Perhaps it may be an idea to store them in files? Eh idk.
MP2 is offline   Reply With Quote
Old 21/02/2013, 02:41 PM   #10
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 11,045
Reputation: 2647
Default Re: All GTA SA Object Array

Hint: use const and stock modifiers.
__________________
Vince is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
EditDynamicObject & Array of object ID [Help] Marricio Scripting Help 1 16/08/2012 10:07 AM
(dFile) error 047: array sizes do not match, or destination array is too small Jack_Leslie Scripting Help 0 06/09/2011 02:20 AM
[SOLVED]error 047: array sizes do not match, or destination array is too small help! Help Archive 7 18/06/2011 09:09 PM
[Sloved]error 047: array sizes do not match, or destination array is too small CoaPsyFactor Help Archive 1 09/06/2011 09:27 PM
<Php> 'Cannot use object of type stdClass as array' DeathOnaStick Help Archive 3 20/09/2010 06:03 PM


All times are GMT. The time now is 01:04 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.