SetPlayerCameraPos Not Working
#1

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.
Reply
#2

Use SetPlayerCameraLookAt

https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt
Reply
#3

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?
Reply
#4

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;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)