SA-MP Forums Archive
Need a maths formula. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need a maths formula. (/showthread.php?tid=120939)



Need a maths formula. - Celson - 14.01.2010

I wanna make it so I can move a player a certain distance towards another player. So I'm using SetPlayerPos for this. Anybody know a maths formula to do this? Or any other method?


Re: Need a maths formula. - wiilweer - 14.01.2010

Hmm, what you mean ? Like teleporting, but you don't want to teleport yourself or ?

Maybe like this

Код:
new otherplayerid;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(otherplayerid, x, y, z);
SetPlayerPos(playerid, x+5, y, z);
This teleports you to otherplayer.


Re: Need a maths formula. - Celson - 14.01.2010

Nah I don't want to teleport to the player. It just want to set you closer to the player. Like as if you were running towards him. I'm using the SetPlayerPos on an NPC. And I'm gonna be using a run animation on the NPC. So it will look like he's running towards the player.


Re: Need a maths formula. - wafffllesss - 14.01.2010

Quote:
Originally Posted by Celson
Nah I don't want to teleport to the player. It just want to set you closer to the player. Like as if you were running towards him. I'm using the SetPlayerPos on an NPC. And I'm gonna be using a run animation on the NPC. So it will look like he's running towards the player.
In my signature there is a Zombie Filterscript.. take a look at it, you will find what you need =D


Re: Need a maths formula. - Celson - 14.01.2010

Quote:
Originally Posted by wafffllesss
Quote:
Originally Posted by Celson
Nah I don't want to teleport to the player. It just want to set you closer to the player. Like as if you were running towards him. I'm using the SetPlayerPos on an NPC. And I'm gonna be using a run animation on the NPC. So it will look like he's running towards the player.
In my signature there is a Zombie Filterscript.. take a look at it, you will find what you need =D
Thanks