19.08.2014, 18:24
(
Последний раз редактировалось noamch1997; 19.08.2014 в 18:55.
)
I want to make my object to move with timer from:
X1,Y1,Z1 -->X2,Y2,Y3-->X3,Y3,Z3-->X4,Y4,Z4-->X5,Y5,Z5-->X6,Y6,Z6 .
with timer .. I want to make this move , to move over and over again without stop (when player near the object - somthing like 30.000)
the object X,Y,Z :
X1Y1Z1 - http://prntscr.com/4dbnpz
X2Y2Z2 - http://prntscr.com/4dbnvs
X3Y3Z3 - http://prntscr.com/4dboii
X4Y4Z4 - http://prntscr.com/4dbolm
X5Y5Z5 - http://prntscr.com/4dbodl
X6Y6Z6 - http://prntscr.com/4dboom
code :
how i should to use it ?
where to put the object X Y Z ?
where to put the moves X Y Z ?
X1,Y1,Z1 -->X2,Y2,Y3-->X3,Y3,Z3-->X4,Y4,Z4-->X5,Y5,Z5-->X6,Y6,Z6 .
with timer .. I want to make this move , to move over and over again without stop (when player near the object - somthing like 30.000)
the object X,Y,Z :
X1Y1Z1 - http://prntscr.com/4dbnpz
X2Y2Z2 - http://prntscr.com/4dbnvs
X3Y3Z3 - http://prntscr.com/4dboii
X4Y4Z4 - http://prntscr.com/4dbolm
X5Y5Z5 - http://prntscr.com/4dbodl
X6Y6Z6 - http://prntscr.com/4dboom
code :
pawn Код:
// global
new bool: gMoveObjects;
pawn Код:
// code from Jeff
forward MoveObjects(index);
public MoveObjects(index)
{
new Float: X, Float: Y, Float: Z;
GetObjectPos(objectid, X, Y, Z);
for(new i; i != MAX_PLAYERS; ++i)
{
if(IsPlayerInRangeOfPoint(i, 30.0, X, Y, Z))
{
static time;
switch(index %= 6)
{
case 0: time = MoveObject(objectid, X1, Y1, Z1, speed);
case 1: time = MoveObject(objectid, X2, Y2, Z2, speed);
case 2: time = MoveObject(objectid, X3, Y3, Z3, speed);
case 3: time = MoveObject(objectid, X4, Y3, Z4, speed);
case 4: time = MoveObject(objectid, X5, Y4, Z5, speed);
case 5: time = MoveObject(objectid, X6, Y6, Z6, speed);
}
++index;
SetTimerEx("MoveObjects",time+150,false,"i",index);
return ;
}
}
gMoveObjects = false;
}
pawn Код:
// OnPlayerUpdate - to start the movement
if(gMoveObjects == false)
{
new Float: X, Float: Y, Float: Z;
GetObjectPos(objectid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, 30.0, X, Y, Z))
{
gMoveObjects = true;
MoveObjects(0);
}
}
where to put the object X Y Z ?
where to put the moves X Y Z ?