'Drop' camera with GetPlayerCameraPos - 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: 'Drop' camera with GetPlayerCameraPos (
/showthread.php?tid=336514)
'Drop' camera with GetPlayerCameraPos -
MP2 - 22.04.2012
I've never used GetPlayerCameraFrontVector before. From what I've heard, it returns the position of the player's camera's 'lookat pos' which is 1 meter in front. If this correct?
I'd like to make a /dropcam command that 'drops' their camera, so it doesn't follow them any more.
FIXED:
pawn Код:
new Float:camPos[3], Float:camVector[3];
GetPlayerCameraPos(playerid, camPos[0], camPos[1], camPos[2]);
GetPlayerCameraFrontVector(playerid, camVector[0], camVector[1], camVector[2]);
SetPlayerCameraPos(playerid, camPos[0], camPos[1], camPos[2]);
SetPlayerCameraLookAt(playerid, camPos[0]+camVector[0], camPos[1]+camVector[1], camPos[2]+camVector[2]);
The vectors have to be added to the camera pos.