SetPlayerCameraPos Problem with co-ords
#1

pawn Код:
SetPlayerPos(playerid,-2293.9741, 2230.6426, 4.9822);
SetPlayerCameraPos(playerid,-2290.5305, 2237.8984, 4.9822);
SetPlayerCameraLookAt(playerid,-2290.5305, 2237.8984, 4.9822);
That's the code i use and there is nothing wrong with it...
Well atleast it works but the SetPlayerCameraPos and CameraLookAt doesnt work for me,...

So i was wondering if someone could help me with the following problem:

Every time i go somewhere and i think like "Hey this is a great spot!" i do /save to get the X Y Z of the spot im standing on,
But now i wonder,... why doesnt it set the players camera to what im look at or looking from?
every time i do this, it shows me the place where i was not looking at (Right side of me or behind me,.. like that)

So long story short,...
How can i get the CameraPos? as in when i do ex: /save it saves the co-ords of the place i am looking at....


Thanks in advance
Reply
#2

BUMPersticker
Reply
#3

The built in /save command stores the players location in a file called savedpositions.txt. If you were in a vehicle when you types /save it gives a line like this:

AddStaticVehicle(451,-19789.6191,9229.6543,22205.5488,20.7275,125,125);

And if you're on foot it will be subtly different (no vehicle ID, or colours).

The four floating point numbers there are the X Y Z and rotation.

I'm not sure where your code comes into it.
Reply
#4

Quote:
Originally Posted by Weirdosport
Посмотреть сообщение
The built in /save command stores the players location in a file called savedpositions.txt. If you were in a vehicle when you types /save it gives a line like this:

AddStaticVehicle(451,-19789.6191,9229.6543,22205.5488,20.7275,125,125);

And if you're on foot it will be subtly different (no vehicle ID, or colours).

The four floating point numbers there are the X Y Z and rotation.

I'm not sure where your code comes into it.
So if i understand you right i need the X Y Z and rotation?
I only include the X Y Z everytime :$
Reply
#5

The X, Y and Z coordinates are your position in 3D space. The rotation is the direction in which your player is looking.

If you are trying to move a player to a previously saved location you will need to set their position and rotation (separately). If for some reason you have already moved the camera you will need to use:

https://sampwiki.blast.hk/wiki/SetCameraBehindPlayer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)