MoveObject more times
#4

pawn Код:
//Filterscriptinit
SetTimer("Move", 500, false);

//Somewhere in script
forward Move(objectid);
public Move(objectid)
{
  MoveObject(obj1, Float:X, Float:Y, Float:Z, 2.5000);
  SetTimer("MoveNext", (MoveObject(obj1, Float:X, Float:Y, Float:Z, 2.5000)), false);//Calculates how long it will take for obj1 to move
}

forward MoveNext(objectid);
public MoveNext(objectid)
{
  MoveObject(obj2, Float:X, Float:Y, Float:Z, 2.5000);
  SetTimer("MoveNext2", (MoveObject(obj2, Float:X, Float:Y, Float:Z, 2.5000)), false);
}

forward MoveNext2(objectid);
public MoveNext2(objectid)
{
  MoveObject(obj3, Float:X, Float:Y, Float:Z, 2.5000);
  SetTimer("MoveNext2", (MoveObject(obj3, Float:X, Float:Y, Float:Z, 2.5000)), false);
}
Then keep doing it like that, the example above will do the following:

1. Filterscript starts, sets a 0.5 second timer to start the "Move" function.
2. Timer starts "Move" function wich moves obj1 to X Y Z then sets a timer to start "MoveNext" function when obj1 is finished.
3. Timer starts "MoveNext" function wich moves obj2 to X Y Z then sets a timer to start "MoveNext2" function when obj2 is finished.
4. Timer starts "MoveNext2" function wich moves obj3 to X Y Z then sets a timer to start "MoveNext3" function when obj3 is finished.
5. Then you can keep doing it like that.
Reply


Messages In This Thread
MoveObject more times - by Freddy Z - 02.04.2010, 20:52
Re: MoveObject more times - by mysql - 02.04.2010, 21:16
Re: MoveObject more times - by Freddy Z - 03.04.2010, 12:56
Re: MoveObject more times - by bajskorv123 - 03.04.2010, 13:09
Re: MoveObject more times - by Freddy Z - 03.04.2010, 20:18
Re: MoveObject more times - by Crezy-Boy - 03.04.2010, 20:24
Re: MoveObject more times - by Freddy Z - 07.04.2010, 16:50

Forum Jump:


Users browsing this thread: 1 Guest(s)