SA-MP Forums Archive
Figuring out the next position. - 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: Figuring out the next position. (/showthread.php?tid=586162)



Figuring out the next position. - Denying - 19.08.2015

Uh, maybe the title isn't all that great but what I mean is.. how do I find out what position (x, y and z axis) will the player have.

What I mean is, using math, of course.. once the player presses W, A, S or D, how to detect the next position he will have? I am trying to make players run faster using SetPlayerVelocity, but I do not know how to detect the way the player is going. My math is not all that great.

If anyone has an idea and is willing to share, please post it here.

Thanks in advance.


AW: Figuring out the next position. - Nero_3D - 19.08.2015

Well just use GetPlayerVelocity for the direction he is moving
pawn Код:
new
    Float: vX,
    Float: vY,
    Float: vZ
;
GetPlayerVelocity(playerid, vX, vY, vZ);
SetPlayerVelocity(playerid, vX * 2.0, vY * 2.0, vZ * 2.0);
That will simply double his movement speed each time it is called