Auto elevator problem
#1

i have this elevators but the last doent work properly. here is the code

Код:
new lift1
new lift2;
new lift3;

forward lift1up();
forward lift1down();
forward lift2up();
forward lift2down();
forward lift3up();
forward lift3down();

//ongamodeinit
lift1 = CreateObject(974, 948.788574, 2439.683350, 9.874555, 90.2400, 0.0000, 0.0000);
lift2 = CreateObject(974, 957.282593, 2432.806641, 42.432281, 90.2400, 0.0000, 0.0000);
lift3 = CreateObject(974, 957.160950, 2442.099365, 81.161102, 90.2400, 0.0000, 0.0000);

SetTimer("lift1up",8000,0);
SetTimer("lift2up",8000,0);
SetTimer("lift3up",8000,0);

//the timers
public lift1up()
{
    MoveObject(lift1,948.794312, 2439.689941, 42.391544,10.0);
    SetTimer("lift1down",8000,0);
}
public lift1down()
{
    MoveObject(lift1,948.788574, 2439.683350, 9.874555,5.0);
    SetTimer("lift1up",8000,0);
}
public lift2up()
{
    MoveObject(lift2,957.270447, 2432.764160, 81.292969,10.0);
    SetTimer("lift2down",8000,0);
}
public lift2down()
{
    MoveObject(lift2,957.282593, 2432.806641, 42.432281,5.0);
    SetTimer("lift2up",8000,0);
}
public lift3up()
{
    MoveObject(lift3,956.364319, 2442.081299, 198.766342,10.0);
    SetTimer("lift3down",8000,0);
}
public lift3down()
{
    MoveObject(lift3,957.160950, 2442.099365, 81.161102,5.0);
    SetTimer("lift3up",8000,0);
}
i want the elevators to stay for 8 secs and then move. all working fine exept the last. when the elevator getting down and is almost on the down position suddenly go very speed up and then wait for 8 secs and then go down and again and again the same problem. i dont know what is wrong.
Reply
#2

i think this is happening because the difference of going up and down is really big.

lift1
up:42.391544
down:9.874555
difference:33

lift2
up:81.292969
down:42.432281
difference:39

lift3
up:198.766342
down:81.161102
difference:117

As you can see, the difference is really big at the last one, you can either increase the speed, so it can go faster and reach its destination, or reduce the hight.
Reply
#3

you think? ill try thanks for help
Reply
#4

hey worked thanks really thanks
Reply
#5

Quote:
Originally Posted by billiout
Посмотреть сообщение
hey worked thanks really thanks
You are welcome, as there is one more solution. You can increase the timer waiting, from 8secs(change both up and down) to 15? You can go in-game and see how much time this needs to reach its destination.

btw MoveObject returns the time that it does to finally arrive.

Look HERE for an example.(you can use this time + 5 secs? so you can have enough time to enter/exit elevator)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)