[Solved]
#1

Hi, I'm try to create a very easy RequestClass by using goniometric numbers.. Sometimes it works but not now..

What I'm saying is I try to create this (not the black boxes): >>

(this picture is with a lot of coords, you know a request class)
But not in a lot different coords but only one coord and that's the coord of the player.

This is my code.. Like I said, it works only sometimes correct but not now? Can anyone see something wrong?
Код:
new
    Float: Crd[4]
;
Crd[0] = 12.7373, Crd[1] = 296.2621, Crd[2] = 1200.1439, Crd[3] = 240.1869;
SetPlayerPos(playerid, Crd[0], Crd[1], Crd[2]);
SetPlayerFacingAngle(playerid, Crd[3]);
SetPlayerCameraPos(playerid, Crd[0] + (25 * floatsin(-Crd[3], degrees)), Crd[1] + (25 * floatcos(-Crd[3], degrees)), Crd[2]);
SetPlayerCameraLookAt(playerid, Crd[0] + (25 * floatsin(-Crd[3], degrees)), Crd[1] + (25 * floatcos(-Crd[3], degrees)), Crd[2]);
(For more info Crd[0] = X, Crd[1] = Y, Crd[2] = Z; Crd[3] = Angle)

I just try to take the coords in front of the player..


Anyone knows?
Reply
#2

Swap your cos and sin around, so cos is x and sin is y, it's currently the other way around (left).

Don't quote me on this, it's been a while.
Reply
#3

Donny you are correct but for that you need to do Angle + 90.0
Because the angle in san andreas start at north not like the normal at east

pawn Код:
#define X (12.7373)
#define Y (296.2621)
#define Z (1200.1439)
#define A (240.1869)
SetPlayerPos(playerid, X, Y, Z);
SetPlayerFacingAngle(playerid, A);
SetPlayerCameraLookAt(playerid, X, Y, Z);
SetPlayerCameraPos(playerid, X + (25 * floatsin(-A, degrees)), Y + (25 * floatcos(-A, degrees)), Z);
#undef X
#undef Y
#undef Z
#undef A
Reply
#4

mhhh, that was the 'stupid' problem..

Thanks (again) Joker


Regards,
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)