Moving Camera on Request Class
#5

Try to use SetPlayerCameraPos and SetPlayerCameraLookAt instead (you can't set the time though, so the time depends on distance between cameras)... You will have to store the camera offset values for each class.
Код:
public OnPlayerRequestClass(playerid, classid)
{
	new Float:CCPX, Float:CCPY, Float:CCPZ, // CCP stands for Class Camera Pos
		Float:CCLX, Float:CCLY, Float:CCLZ; // CCL stands for Class Camera Look at
	switch(classid)
	{
		case 0 .. 6:
		{
			CCPX = 1542.339843, CCPY = -1676.244384, CCPZ = 30.847208; // this is from your 2nd to 4th arguments in InterpolateCameraPos
			CCLX = 1547.319580, CCLY = -1676.068481, CCLZ = 30.433620; // this is from your 2nd to 4th arguments in InterpolateCameraLookAt
			// your code
		}
		case 7 .. 8:
		{
			CCPX = 1421.688476, CCPY = -1647.271606, CCPZ = 38.576740; // this is from your 5th to 7th arguments in InterpolateCameraPos
			CCLX = 1418.010864, CCLY = -1643.885131, CCLZ = 38.490806; // this is from your 5th to 7th arguments in InterpolateCameraLookAt
			// your code
		}
	}
	SetPlayerCameraPos(playerid, CCPX, CCPY, CCPZ);
	SetPlayerCameraLookAt(playerid, CCLX, CCLY, CCLZ, CAMERA_MOVE);
}
Note: the camera will also try to move when you connect to the server or when player just die... To prevent this, you have to mark as player variable to check if player was in class selection.


If you wanted to use Interpolate (and the way), then you have to store the camera offset and class selection category per player's variable and set them depending on the value you specified on each class, which i have not found the best way to code it, i don't know why GetPlayerCameraPos doesn't return the correct value here.
Reply


Messages In This Thread
Moving Camera on Request Class - by FunnyBear - 22.12.2015, 18:29
Re: Moving Camera on Request Class - by FunnyBear - 23.12.2015, 11:42
Re: Moving Camera on Request Class - by vassilis - 23.12.2015, 12:10
Re: Moving Camera on Request Class - by FunnyBear - 23.12.2015, 12:26
Re: Moving Camera on Request Class - by RoboN1X - 23.12.2015, 12:50

Forum Jump:


Users browsing this thread: 1 Guest(s)