An Additon to /siren command
#3

Код:
// Declaring SirenObject1,2,3,etc. (Top of Script somewhere)

static SirenObject1[2000]; // change 2000 to the number of vehicles in your server though
static SirenObject2[2000];
static SirenObject3[2000];

// Siren On Code:

SirenObject1[VID] = CreateObject();// Of course you'll need to fill in the object info :P
SirenObject2[VID] = CreateObject();
SirenObject3[VID] = CreateObject();

// Siren Off Code:

DestroyObject(SirenObject1[VID]);
DestroyObject(SirenObject2[VID]);
DestroyObject(SirenObject3[VID]);
You're using SirenObject[VID] for 3 object ids which can only hold 1, thus each time you do SirenObject[VID]=, it's just over writting what was previously stored. So then when you use DestroyObject(SirenObjectpVID]); 3 times, it only delete the last object id that was stored to it, 3 times (Deleting the same object 3 times). So, I've provided a example above that stores all 3 object ids to 3 diffirent Varibles (Adding a number after each one: 1, 2 and 3). So when it comes time to destroy the objects, simply destroy all 3 of those varibles as shown...

There are far greater ways to do this, but kept it real simple so you can grasp the basic concept
(But it will be vital later on to practice good optimized code and learning everything about mem/cpu usage etc.)

As for moving attached objects inside the vehicle, I've never attempted this, so I don't know if possible or not. But just play around with the cordinates and see what can be done. If you cant seem to move the object inside at all, then it's not likely possible... (Try placing the object way in the vehicle just to see if its even possible)

EDIT: Just noticed the REP comment, but I responded to help, not to gain REP (That part is completely optional)
Reply


Messages In This Thread
An Additon to /siren command - by Harmon - 07.09.2012, 01:39
Re: An Additon to /siren command - by Harmon - 07.09.2012, 02:26
Re: An Additon to /siren command - by XGh0stz - 07.09.2012, 07:08
Re: An Additon to /siren command - by Harmon - 07.09.2012, 12:07
Re: An Additon to /siren command - by XGh0stz - 07.09.2012, 14:55

Forum Jump:


Users browsing this thread: 1 Guest(s)