help | +REP
#1

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 :



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);
    }
}
how i should to use it ?
where to put the object X Y Z ?
where to put the moves X Y Z ?
Reply
#2

I'm sad that you're refusing to take look at their code it freaking says where to put your values... ; - ;
Reply
#3

Quote:
Originally Posted by MicroD
Посмотреть сообщение
I'm sad that you're refusing to take look at their code it freaking says where to put your values... ; - ;
iam dont know pawn iam beginner ..
so where i need to put it ?
Reply
#4

??
Reply
#5

Just replace each X with its value, For example...
In
pawn Код:
case 0: time = MoveObject(objectid, X1, Y1, Z1, speed);
Replace X1 and Y1 and Z1 with their values you have in the image...
Reply
#6

Quote:
Originally Posted by Ahmad45123
Посмотреть сообщение
Just replace each X with its value, For example...
In
pawn Код:
case 0: time = MoveObject(objectid, X1, Y1, Z1, speed);
Replace X1 and Y1 and Z1 with their values you have in the image...
thanks man !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)