04.12.2017, 23:01
Quote:
How to make an adequate GetXYInFrontOfPlayer using this library?
|
But to answer your question you could use any "Rotate" function
Quote:
MatrixRotate(Float: matrix[4][4], Float: oX, Float: oY, Float: oZ, Float: oT, & Float: X, & Float: Y, & Float: Z) QuatRotate(Float: w, Float: x, Float: y, Float: z, Float: oX, Float: oY, Float: oZ, & Float: X, & Float: Y, & Float: Z) EulerRotate(Float: rX, Float: rY, Float: rZ, Float: oX, Float: oY, Float: oZ, & Float: X, & Float: Y, & Float: Z, eulermode: mode = euler_samp) AxisAngleRotate(Float: angle, Float: aX, Float: aY, Float: aZ, Float: oX, Float: oY, Float: oZ, & Float: X, & Float: Y, & Float: Z) |
PHP код:
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
new Float: rZ; // the only angle you can get is rZ
GetPlayerFacingAngle(playerid, rZ); // use 0.0 for rX and rY
// oX (right vector offset) = 0.0, oY (front vector offset) = 5.0, oZ (up vector offset) = 0.0
EulerRotate(0.0, 0.0, rZ, 0.0, 5.0, 0.0, X, Y, Z);
// X, Y, Z should now be 5 units before the player
Just search for GetXYInFrontOfPlayer, it has been asked / posted thousand times