SA-MP Forums Archive
Moving cameras. - 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: Moving cameras. (/showthread.php?tid=152079)



Moving cameras. - IcyBlight - 02.06.2010

Hey there.

I'm making a dynamic intro-screen to my server.

I need my SetPlayerCamera and SetPlayerCameraLookAt to move, somehow.

Any ideas?


Re: Moving cameras. - MadeMan - 02.06.2010

Timer.


Re: Moving cameras. - IcyBlight - 02.06.2010

Yeah, of course I can change the position instantly, but I want it smoothly.

Like, the camera turning around in a circle or sliding etc.


Re: Moving cameras. - dice7 - 02.06.2010

http://forum.sa-mp.com/index.php?topic=115765.0


Re: Moving cameras. - MadeMan - 02.06.2010

How smooth it moves depends on the timer interval. The faster you change position the smoother it is.


Re: Moving cameras. - IcyBlight - 02.06.2010

pawn Код:
forward startscreen(playerid);
public startscreen(playerid)
{
  SetPlayerCameraPos(playerid, 956.0391,2585.1912,10.6282);
    SetPlayerCameraLookAt(playerid, 977.8350,2575.9636,21.6403);
    SetTimerEx("visagecam", 10000, false, "%d", playerid);
}

forward visagecam(playerid);
public visagecam(playerid)
{
    cam_x = 2128.9561;
    cam_y = 1858.9218;
    cam_z = 10.6719;
    SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
    SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
    SetTimerEx("visagecammove", 100, true, "%d", playerid);
}

forward visagecammove(playerid);
public visagecammove(playerid)
{
    cam_y = cam_y + 1.2;
    cam_z = cam_z + 1.0;
    SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
    SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
}
So why doesn't this work?

Startscreen is called on a 1,1second interval on connect, and it works fine. However, the camera outside the Visage hotel does not move.


Re: Moving cameras. - MadeMan - 02.06.2010

Is startscreen called only once or many times?


Re: Moving cameras. - IcyBlight - 02.06.2010

pawn Код:
SetTimerEx("startscreen", 1100, false, "%d", playerid);
At the end of OnPlayerConnect.

That works fine though, and the camera is set to the correct position after the camera has been at the "startscreen"s position for 10 seconds, however it does not move.

I set it to move slightly every 0,1 second, however it doesn't move at all...

Strange stuff.


Re: Moving cameras. - Naxix - 02.06.2010

Код:
forward startscreen(playerid);
public startscreen(playerid)
{
  SetPlayerCameraPos(playerid, 956.0391,2585.1912,10.6282);
	SetPlayerCameraLookAt(playerid, 977.8350,2575.9636,21.6403);
	SetTimerEx("visagecam", 10000, false, "%d", playerid);
}

forward visagecam(playerid);
public visagecam(playerid)
{
	cam_x = 2128.9561;
	cam_y = 1858.9218;
	cam_z = 10.6719;
	SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
	SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
	SetTimerEx("visagecammove", 100, true, "%d", playerid);
}

forward visagecammove(playerid);
public visagecammove(playerid)
{
	cam_y = cam_y += 1.2;
	cam_z = cam_z += 1.0;
	SetPlayerCameraPos(playerid, cam_x, cam_y, cam_z);
	SetPlayerCameraLookAt(playerid, 2079.2136,1905.7064,32.4599);
}
Try that


Re: Moving cameras. - IcyBlight - 02.06.2010

What did you change?