[Help] Barrier Rotation
#1

Hi, i make some barrier rotation on my server. It's ok, when i open barrier she work perffect. But i've got one problem, how to make it to work when i wanna to close it? This is codes

Код:
CMD:open(playerid,params[])
{
MoveObject(barrier1, 1668.00000000,-1882.59997559,13.30000019+0.0001, 0.0001, 0.0, 0.0001, 0.0001);
return 1;
}
Код:
barrier1 = CreateObject(968,1668.00000000,-1882.59997559,13.30000019,0.00000000,270.00000000,0.00000000);
I wanna to make it work when i try to close barrier. To rotate it on firs position.
Reply
#2

Maybe try MoveObject to the original position?
Edit: failed at coding
Reply
#3

No, this dosen't work.
Reply
#4

What's the result? It should work.
Reply
#5

pawn Код:
CMD:close(playerid,params[])
{
MoveObject(barrier1, 1668.00000000, -1882.59997559, 13.30000019, 3.0, 0.0, 270.0,0.0);// try this it should work
SendClinetMessage(playerid, 0xFFFFFFF, "Closing the Gate");
return 1;
}
Reply
#6

Yea, it's work. but barrier close very fast. I wanna to close it like she's opening. If u understand. Like in real life.
Wen i type /open, it's work, like in real life, but when i type /close she's close like when u using CreateObject. Like she's destroyed.
Reply
#7

Edit the 4. parameter (speed) for your needs.
https://sampwiki.blast.hk/wiki/MoveObject
To close with the same speed you open it, try:
pawn Код:
CMD:close(playerid,params[])
{
MoveObject(barrier1,1668.0,-1882.59997559,13.30000019,0.0001,0.0,270.0,0.0);
return 1;
}
Reply
#8

Thank's it's work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)