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



SetPlayerCameraPos - PizNiz - 28.05.2011

Can someone please tell me which float controls the distance between the camera and "character"?

Код:
	SetPlayerPos(playerid, 15.304734, 2418.625976, 32.578125);
	SetPlayerFacingAngle(playerid, 112.558120);
	SetPlayerCameraLookAt(playerid, 15.304734, 2418.625976, 32.578125);
	SetPlayerCameraPos(playerid, 15.304734 + (10 * floatsin(-112.558120, degrees)), 2418.625976 + (10 * floatcos(-112.558120, degrees)), 34);



Re: SetPlayerCameraPos - Mike_Peterson - 28.05.2011

It's easy mate, SetPlayerPos is to set the player's location/position to XYZ co-ordinates, SetPlayerCameraPos is exactly the same but then it's the camera's (screen) location/position.. so those two are the answer on your question, have a nice day further.


Re: SetPlayerCameraPos - PizNiz - 28.05.2011

Ahh okay, so 10 is the distance, cheers


Re: SetPlayerCameraPos - Mike_Peterson - 28.05.2011

No, i didn't said that.. I'll give you an example:
If the player's pos is X: 1500 Y: 700 Z: 20
and the player's camera is X: 1550 Y: 710 Z: 20
Then the distances are:
X: 1550 - 1500 = 50 difference
Y: 710 - 700 = 10 difference
Z: 20 - 20 = 0 difference
The distance between the player and camera is 50 X, 10 Y. (Correct me if i'm wrong bcoz im kinda tired.)


Re: SetPlayerCameraPos - PizNiz - 29.05.2011

Well anyway i changed the "10"-values in:
Код:
	SetPlayerCameraPos(playerid, 15.304734 + (10 * floatsin(-112.558120, degrees)), 2418.625976 + (10 * floatcos(-112.558120, degrees)), 34);
So it worked out, don't really know what you're saying man :/


Re: SetPlayerCameraPos - Mike_Peterson - 29.05.2011

Lol, not my problem.. You should explain clear what you wanted, i thought you wanted the distance between camera and player..


Re: SetPlayerCameraPos - PizNiz - 29.05.2011

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
Lol, not my problem.. You should explain clear what you wanted, i thought you wanted the distance between camera and player..
Exactly, that controls the distance between the player and the camera.


Re: SetPlayerCameraPos - jameskmonger - 29.05.2011

There is no way to "control the distance", you can set the camera position, and the player position, but not the distance.