SA-MP Forums Archive
GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 - 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: GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 (/showthread.php?tid=422134)



GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 - Edvin - 12.03.2013

Hi.

Why when i using GetPlayerCameraPos at OnPlayerRequestClass the function, returns me:
Код:
X: 0.00 Y: 0.00 Z: 0.00
I don't know, but why it doesn't return normal camera pos?
Код:
case 0, 1, 2:
		{
		    new Float:X, Float:Y, Float:Z;
			
            SetPlayerPos( playerid, -2685.925292, -2395.514160, 3.264465 );
			SetPlayerFacingAngle( playerid, 77.605529 );
			
			
			GetPlayerCameraPos( playerid, X, Y, Z );
			printf( "Camera pos: X:%.2f | Y:%.2f | Z:%.2f", X, Y, Z );
			
			if ( X != -2699.76 /*&& camera[ 1 ] != -2393.5374 && camera[ 2 ] != 8.2042*/ )
			{
			    SetPlayerCameraPos( playerid, -2735.2820, -2361.4514, 24.9300 );
				SetPlayerCameraLookAt( playerid, -2734.4592, -2362.0229, 24.5299 );
			
				InterpolateCameraPos( playerid, -2735.2820, -2361.4514, 24.9300, -2699.7625, -2393.5374, 8.2042, 2500, CAMERA_MOVE );
				InterpolateCameraLookAt( playerid, -2734.4592, -2362.0229, 24.5299, -2698.7788, -2393.7117, 8.0342, 2500, CAMERA_MOVE );

				Streamer_UpdateEx( playerid, -2685.92, -2395.51, 3.26, 11 );
			}
		}



Re: GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 - MP2 - 12.03.2013

Perhaps it doesn't work straight after SetPlayerPos. Make a test command.


Re: GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 - DiGiTaL_AnGeL - 12.03.2013

What?
pawn Код:
%.2f



Re: GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 - IstuntmanI - 12.03.2013

Quote:
Originally Posted by DiGiTaL_AnGeL
Посмотреть сообщение
What?
pawn Код:
%.2f
Examples:
%.2f with 43.45235523: 43.45
%.3f with the same number: 43.452
etc.

GetPlayerPos also returns 0 in OnPlayerRequestClass. Player is like invisible in OnPlayerRequestClass, nobody can see him, you also can't get his coords.


Re: GetPlayerCameraPos returns X:0.00 Y:0.00 Z:0.00 - Edvin - 12.03.2013

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
Examples:
%.2f with 43.45235523: 43.45
%.3f with the same number: 43.452
etc.

GetPlayerPos also returns 0 in OnPlayerRequestClass. Player is like invisible in OnPlayerRequestClass, nobody can see him, you also can't get his coords.
Pfff ... this sucks ... thanks, btw.