SA-MP Forums Archive
How to move object - 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: How to move object (/showthread.php?tid=645496)



How to move object - MasterCodez - 28.11.2017



How to move object like this picture and check it if them fallen into the ground.


Re: How to move object - Daymen - 28.11.2017

Are you attempting to launch a projectile and then track it's movement? Or what?

You need to go more in depth about what your idea is for us to be able to help.


Re: How to move object - Lucases - 28.11.2017

You got some gravity problems because objects when are placed stay in their place until you move them scriptwisely.
It needs some hard scripting, I wouldn't suggest you to try


Re: How to move object - OneDay - 28.11.2017

https://en.wikipedia.org/wiki/Ballistics


Re: How to move object - Tagic - 28.11.2017

You can try with this include:
https://sampforum.blast.hk/showthread.php?tid=446286


Re: How to move object - MasterCodez - 28.11.2017

Can anyone give example for me


Re: How to move object - Tagic - 28.11.2017

Quote:
Originally Posted by MasterCodez
Посмотреть сообщение
Can anyone give example for me
Video: Soccer gamemode
Link


Re: How to move object - ATomas - 28.11.2017

Use this:




x0,y0 - start position
t - time (1,2,3,4,5..., you can use Float for better results)
alpha - angle for shoot
v0 - speed of shoot
g - gravitation (9.806)
x,y - current position for object in time t


cyklus for t (time) + caltulate position in time (more times it's better look, but many calculates).

I had used for golf engine on my server and works fine.


Re: How to move object - MasterCodez - 29.11.2017

Quote:
Originally Posted by ATomas
Посмотреть сообщение
Use this:




x0,y0 - start position
t - time (1,2,3,4,5..., you can use Float for better results)
alpha - angle for shoot
v0 - speed of shoot
g - gravitation (9.806)
x,y - current position for object in time t


cyklus for t (time) + caltulate position in time (more times it's better look, but many calculates).

I had used for golf engine on my server and works fine.
I can't do this with pawn samp code


Re: How to move object - FrezQ - 29.11.2017

Quote:
Originally Posted by MasterCodez
Посмотреть сообщение
I can't do this with pawn samp code
You need to calculate or else you wont get the result that you want.