09.07.2010, 21:10
Its a small hand full math.
By default, the rotation the pet has to have can be calculated like this:
a: the y-coord difference of the pos of the object and the target
b: the x-coord difference
c: sqare root (aІ + bІ)
rotation of object = arcsin (a / c)
So: get the position of object and target and transcribe this to pawn, in one or more lines (arcsin = asin in pawn)
Edit: You also have to add something (180 i think) to the calculated rotation for samp
By default, the rotation the pet has to have can be calculated like this:
a: the y-coord difference of the pos of the object and the target
b: the x-coord difference
c: sqare root (aІ + bІ)
rotation of object = arcsin (a / c)
So: get the position of object and target and transcribe this to pawn, in one or more lines (arcsin = asin in pawn)
Edit: You also have to add something (180 i think) to the calculated rotation for samp