SA-MP Forums Archive
SetPlayerCameraPos Not Working - 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: SetPlayerCameraPos Not Working (/showthread.php?tid=469540)



SetPlayerCameraPos Not Working - Dennis_Smith - 13.10.2013

I'm trying to use 'SetPlayerCameraPos' to change the players camera position to a few spots where I have placed camera objects. SetPlayerCameraPos isn't doing anything, nor is it giving me errors. The 'SetCameraBehindPlayer' is working fine.

Код:
	if(strcmp("/cam1", cmdtext, false) == 0)
	{
	    SetPlayerCameraPos(playerid, 2247.3000488,1693.0000000,1011.4000244);
	    return 1;
	}
	if(strcmp("/cam2", cmdtext, false) == 0)
	{
	    SetPlayerCameraPos(playerid, 2233.8999023,1635.6999512,1014.7000122);
	    return 1;
	}
	if(strcmp("/cam3", cmdtext, false) == 0)
	{
	    SetPlayerCameraPos(playerid, 2175.6000977,1612.1999512,1012.2999878);
	    return 1;
	}
	if(strcmp("/stopcam", cmdtext, false) == 0)
	{
		SetCameraBehindPlayer(playerid);
		return 1;
	}
-- Thanks in advance for any help.


Respuesta: SetPlayerCameraPos Not Working - [CG]Milito - 13.10.2013

Use SetPlayerCameraLookAt

https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt


Re: Respuesta: SetPlayerCameraPos Not Working - Dennis_Smith - 13.10.2013

Quote:
Originally Posted by [CG]Milito
Посмотреть сообщение
That worked. Thanks.
However, my original intentions were to let the camera be controllable and free to rotate with the mouse, the same way you do when behind a player. Am I able to do that in a remote position?


Respuesta: SetPlayerCameraPos Not Working - [CG]Milito - 13.10.2013

You can try

TogglePlayerSpectating or PlayerSpectatePlayer but I'm not sure if this will work

Like this

pawn Код:
if(strcmp("/cam3", cmdtext, false) == 0)
    {
        TogglePlayerSpectating(playerid, 1);
        return 1;
    }
or

pawn Код:
if(strcmp("/cam3", cmdtext, false) == 0)
    {
       TogglePlayerSpectating(playerid,1);
           PlayerSpectatePlayer(playerid,playerid);
        return 1;
    }