Moving multiple objects at one time
#2

Here is what I do with my Area 51 gates script...

First create new variables(or something like that XD)...

Код:
new gate1;
new gate2;
Then create the objects...

Код:
gate1 = CreateObject(2927,215.92999390,1875.50000000,13.89999962,0.00000000,0.00000000,0.00000000); //object(a51_blastdoorr) (D)
gate2 = CreateObject(2929,211.85000732,1875.50000000,13.89999962,0.00000000,0.00000000,0.00000000); //object(a51_blastdoorl) (D)
Then make the command to open the gates(Can be done in other ways also)...

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/hopen", cmdtext, true, 6) == 0) 
	{
    		if(IsPlayerInRangeOfPoint(playerid, 5, 213.8570,1875.4865,13.1470))
    		{
			MoveObject(gate1, 219.92999390,1875.50000000,13.89999962, 1);// Opening the gate
			MoveObject(gate2, 207.85000732,1875.50000000,13.89999962, 1);// Opening the gate
			SetTimer("TimerName",5000,false); //5000 in milliseconds = 5 Seconds
    		}
		return 1;
	}
	return 0; //I put this return here because for some reason my code didn't want to work without it lol
}
Remember to make a forward for the timer and also a public function...
First the forward...

Код:
forward TimerName(playerid);
Then the public function...

Код:
public TimerName(playerid)
{
	MoveObject(gate1, 215.92999390,1875.50000000,13.89999962, 1);// Moving the gate
	MoveObject(gate2, 211.85000732,1875.50000000,13.89999962, 1);// Moving the gate
}
That should do it, hope I helped.
Reply


Messages In This Thread
Moving multiple objects at one time - by jeremy8810 - 06.09.2012, 19:14
Re: Moving multiple objects at one time - by Hyperfire - 06.09.2012, 20:09
Re: Moving multiple objects at one time - by jeremy8810 - 06.09.2012, 21:14
Re: Moving multiple objects at one time - by Hyperfire - 06.09.2012, 21:48
Re: Moving multiple objects at one time - by jeremy8810 - 07.09.2012, 06:10
Re: Moving multiple objects at one time - by Hyperfire - 08.09.2012, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)