SA-MP Forums Archive
How to use SetPlayerCameraPos and SetPlayerCameraLookAt - 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: How to use SetPlayerCameraPos and SetPlayerCameraLookAt (/showthread.php?tid=657603)



How to use SetPlayerCameraPos and SetPlayerCameraLookAt - Wreeper - 11.08.2018

I /save-d a position somewhere. At the player skin selection(with the arrows and the spawn) i've been put these coordinates like this(/save at position 0 0 3, which i would look at a camp).

SetPlayerCameraPos(playerid, 0.0, 0.0, 0.3);
SetPlayerCameraLookAt(playerid, 0.5, 0.8, 0.;

I was doing the good work with these coordinates. It was supposed to look at the camp , not the sky.

Someone help me? What filterscript/mod is good for saving the real coords for these scripts?(i mean they would look in the right place).

(if you need the real coords, well i don't have them no more)


Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - UFF - 11.08.2018

Код:
SetPlayerPos(playerid, xyz); //Player position 
SetPlayerCameraPos(playerid, xyz); //the camera position
SetPlayerCameraLookAt(playerid, xyz; //playerposition



Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - Wreeper - 11.08.2018

Quote:
Originally Posted by UFF
Посмотреть сообщение
Код:
SetPlayerPos(playerid, xyz); //Player position 
SetPlayerCameraPos(playerid, xyz); //the camera position
SetPlayerCameraLookAt(playerid, xyz; //playerposition
Dafuq? Do i need to type the coordinates pasted each other?

Like 0, 0, 0 to be 000? I don't think so...


Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - UFF - 11.08.2018

Quote:
Originally Posted by Wreeper
Посмотреть сообщение
Dafuq? Do i need to type the coordinates pasted each other?

Like 0, 0, 0 to be 000? I don't think so...
that's just an example code.

Actually the code should be like this
Код:
SetPlayerPos(playerid, -1431.4838,  1580.5219, 1055.7191); // Player's Position (To set player position before camera)
SetPlayerCameraPos(playerid, -1437.9672, 1575.3422, 1057.6042); // The Camera Position
SetPlayerCameraLookAt(playerid, -1431.4838, 1580.5219, 1055.7191); // Set this as Player's position so that the camera will look at the player's position.



Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - Wreeper - 12.08.2018

Quote:
Originally Posted by UFF
Посмотреть сообщение
that's just an example code.

Actually the code should be like this
Код:
SetPlayerPos(playerid, -1431.4838,  1580.5219, 1055.7191); // Player's Position (To set player position before camera)
SetPlayerCameraPos(playerid, -1437.9672, 1575.3422, 1057.6042); // The Camera Position
SetPlayerCameraLookAt(playerid, -1431.4838, 1580.5219, 1055.7191); // Set this as Player's position so that the camera will look at the player's position.
It shows me like this when i put the coords as you said
https://i.imgur.com/n5xRSR0.png


Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - Heress - 12.08.2018

try:

Quote:

SetPlayerPos(playerid, -1431.4838, 1580.5219, 1055.7191);
SetPlayerCameraPos(playerid, -1431.1512, 1578.6967, 1055.6981);
SetPlayerCameraLookAt(playerid, -1431.4838, 1580.5219, 1055.7191);




Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - Wreeper - 12.08.2018

Quote:
Originally Posted by Heress
Посмотреть сообщение
try:
Wow, that's not even the coordinates i want. It's a map bug for me , but i will try to fix it.

OnGameModeInit:
AddPlayerClass(60,1551.9125,-1337.8092,330.0630,151.9482,0,0,0,0,0,0);
OnPlayerSpawn:
SetPlayerPos(playerid, 1726.8832,-1634.1729,20.2160);
OnPlayerConnect:
SetPlayerCameraPos(playerid, 1548.1187,-1341.4335,329.4604);
SetPlayerCameraLookAt(playerid, 1551.9125,-1337.8092,330.0630);


Re: How to use SetPlayerCameraPos and SetPlayerCameraLookAt - Heress - 12.08.2018

SetPlayerPos must be after OnPlayerConnect. Dont use it after OnPlayerSpawn because you have AddPlayerClass.

And say, what coordinates you want to use? Then I help