[Solved] - 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: [Solved] (
/showthread.php?tid=137928)
[Solved] -
RyDeR` - 30.03.2010
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?
Re: WTF is wrong with this code? -
Donny_k - 30.03.2010
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.
Re: WTF is wrong with this code? -
Nero_3D - 30.03.2010
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
Re: WTF is wrong with this code? -
RyDeR` - 30.03.2010
mhhh, that was the 'stupid' problem..
Thanks (again) Joker
Regards,