SA-MP Forums Archive
Tolls - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tolls (/showthread.php?tid=616354)



Tolls - GoldenLion - 03.09.2016

Hi, I've just created a toll system, but the tolls are not opening when I do /opentoll.
Here's the code for one of the tolls:
Код:
TollData[tollBarriers][0] = CreateDynamicObject(968, 1738.59460, 530.57202, 27.36010,   0.00000, 90.00000, 160.36710);
This line should open the toll (set rot Y to 0 which will open it):
Код:
MoveObject(TollData[tollBarriers][0], 1738.59460, 530.57202, 27.36010, 2.0, 0.00000, 0.00000, 160.36710);
But the toll doesn't move at all, what am I doing wrong here? Basically I just copied and pasted the coordinates of the toll there and changed the rot Y to 0. I've never used MoveObject before though so I might be doing something wrong.


Re: Tolls - saffierr - 03.09.2016

I'm not very sure though, but to open the toll, You have to use the Z co-ordination.


Re: Tolls - Ultraz - 03.09.2016

Quote:
Originally Posted by saffierr
Посмотреть сообщение
I'm not very sure though, but to open the toll, You have to use the Z co-ordination.
+1 , In my opinion too you have to use Z co-ordination


Re: Tolls - GoldenLion - 03.09.2016

No, it's Y. I tried that in map editor. Everytime I changed the rot Y to 0 it was opened and when I changed it back to 90 it was closed again. It doesn't matter as well because the object is not moving at all.
If I'd use SetObjectRot this way it would work, but I want it to move smoothy, but I've never used MoveObject before so I'm probably doing something wrong.


Re: Tolls - GoldenLion - 04.09.2016

I got it working when I added like 0.00001 to Z, but it's not moving smoothly. It's like SetObjectRot, it just sets the rotation without opening smoothly.


Re: Tolls - Vince - 04.09.2016

Dynamic objects must be moved with MoveDynamicObject.


Re: Tolls - Logic_ - 04.09.2016

If the object doesnt moves, you better change the object because that object doesnt supports move(ing) or you need to change point a with b like replacing something upside-down (i don't know how to explain that lol)...


Re: Tolls - GoldenLion - 04.09.2016

Quote:
Originally Posted by Vince
Посмотреть сообщение
Dynamic objects must be moved with MoveDynamicObject.
Yeah, that's a typo, I have them created with CreateObject.

Quote:
Originally Posted by ALiScripter
Посмотреть сообщение
If the object doesnt moves, you better change the object because that object doesnt supports move(ing) or you need to change point a with b like replacing something upside-down (i don't know how to explain that lol)...
But I have seen servers that have tolls moving like that.


Re: Tolls - Sjn - 04.09.2016

Quote:
Originally Posted by GoldenLion
Посмотреть сообщение
No, it's Y. I tried that in map editor. Everytime I changed the rot Y to 0 it was opened and when I changed it back to 90 it was closed again. It doesn't matter as well because the object is not moving at all.
If I'd use SetObjectRot this way it would work, but I want it to move smoothy, but I've never used MoveObject before so I'm probably doing something wrong.
In order for barriers (like SLPD barrier in single player) to move smoothly, you have to set the movement time to at least 0.05 otherwise the movement will be very fast making it look like SetObjectRot.


Re: Tolls - GoldenLion - 04.09.2016

Quote:
Originally Posted by Sjn
Посмотреть сообщение
In order for barriers (like SLPD barrier in single player) to move smoothly, you have to set the movement time to at least 0.05 otherwise the movement will be very fast making it look like SetObjectRot.
It's still like SetObjectRot. :P