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



Camera - Hunud - 16.01.2018

I use InterpolateCameraPos / LookAt, but when the timer is called this Interpolate camera position does not remove. And whenever i move my mouse to any way camera will go behind the player. I won't spawn player, I just want him to be there when he used cmd in isplayerinrangeofpoint.

Example:

Код:
CMD:camera(playerid)
{
    InterpolateCameraPos(playerid, 221.893768, 1822.836059, 11.279774, 220.261932, 1822.938842, 10.925539, 2000);
				InterpolateCameraLookAt(playerid, 217.278533, 1823.135986, 9.379850, 219.826156, 1822.940917, 5.944565, 3000);
SetTimerEx("Unstuck", 2000, false, "i", playerid);
Код:
forward Unstuck(playerid);
public Unstuck(playerid)
{
	TogglePlayerSpectating(playerid, 0);
              SetCameraBehindPlayer(playerid);
	return 1;
}
+REP for a guy who find the solution.


Re: Camera - Daveosss - 16.01.2018

I've just tested the code you posted and it works perfectly fine for me. Something else must be wrong.


Re: Camera - Hunud - 16.01.2018

Quote:
Originally Posted by Daveosss
Посмотреть сообщение
I've just tested the code you posted and it works perfectly fine for me. Something else must be wrong.
Of course it works, but the problem is camera is always behind the player as i doesn't remove and i can't move proper, it's shaking.. Try to move and you'll see.


Re: Camera - Daveosss - 16.01.2018

I had tried and none of that happened, is there anything else in the /camera command?


Re: Camera - Hunud - 16.01.2018

Just a single check IsPlayerInRangeOfPoint, nothing else.


Re: Camera - MP2 - 17.01.2018

SetCameraBehindPlayer shouldn't be necessary if you're disabling spectating anyway. I assume you've put the player in spectate mode to hide the HUD? If so just turning it off should respawn the player.

Try adding debug messages to your code so you have an idea of what's happening and when.