SA-MP Forums Looking at a point
 Members List Search Today's Posts Mark Forums Read

 18/02/2020, 03:57 PM #1 Davi52 Little Clucker   Join Date: Sep 2018 Posts: 40 Reputation: 0 Looking at a point Hey guys, sorry again for disturbing you! How can I set my players camera looking at a point? After I freeze my character, i want it to look at a point. I tried SetPlayerCameraLookAt, but it sets my camera at the default server connecting place(on the sky). SetPlayerFacingAngle sets only the rotation of the character. How should I solve this? Thank you!
 18/02/2020, 04:54 PM #2 SiaReyes Gangsta   Join Date: Mar 2019 Location: Coordinates X,Y,Z Posts: 617 Reputation: 57 Re: Looking at a point https://wiki.sa-mp.com/wiki/SetPlayerCameraLookAt Did you use SetPlayerCameraPos?
 18/02/2020, 05:22 PM #3 Davi52 Little Clucker   Join Date: Sep 2018 Posts: 40 Reputation: 0 Re: Looking at a point No I didnt. I want to point the camera to an object while its behind the player.
 18/02/2020, 06:06 PM #4 Radless Little Clucker   Join Date: Jul 2019 Posts: 48 Reputation: 3 Re: Looking at a point Code: ```stock SetPlayerLookAt(playerid, Float:X, Float:Y) { new Float:Px, Float:Py, Float: Pa; GetPlayerPos(playerid, Px, Py, Pa); Pa = floatabs(atan((Y-Py)/(X-Px))); if (X <= Px && Y >= Py) Pa = floatsub(180, Pa); else if (X < Px && Y < Py) Pa = floatadd(Pa, 180); else if (X >= Px && Y <= Py) Pa = floatsub(360.0, Pa); Pa = floatsub(Pa, 90.0); if (Pa >= 360.0) Pa = floatsub(Pa, 360.0); SetPlayerFacingAngle(playerid, Pa); }```

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post tommzy09 Scripting Help 5 23/05/2015 05:58 AM Fantje Scripting Help 5 16/03/2015 05:21 PM tommzy09 Scripting Help 6 25/07/2014 12:29 AM Thomas. Scripting Help 3 28/11/2011 01:22 AM Chivava Help Archive 4 27/12/2010 02:55 PM

All times are GMT. The time now is 05:34 AM.

 -- (EN) English -- (RU) Русски SA-MP - Archive - Top