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



GetPlayerCameraPos problem - Tannz0rz - 03.08.2010

I've been messing with it lately and I've noticed how a player's camera position isn't updated all too frequently. I'd venture to say that it updates roughly every second.

My question is simply the following: are there any plans on finding a fix for this problem?

I'd prefer to hear from someone actually working on SA-MP at the moment (I believe Kye is the only one doing so), but I doubt I would for those whom are are likely busy. Though hearing from anyone who's in on the development gig is all right so long as they can give me an appropriate response.

Thanks.




EDIT: It seems that the camera position updates at a faster rate while you're moving around, is there any way that you guys could make it update at such a rate all the time?


Re: GetPlayerCameraPos problemo - willsuckformoney - 03.08.2010

if i understand you right, you mean you want a moving camera on player class selection, then use a timer updates every what ever seconds.


Re: GetPlayerCameraPos problemo - Tannz0rz - 03.08.2010

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
if i understand you right, you mean you want a moving camera on player class selection, then use a timer updates every what ever seconds.
No, take a peek at the following bit of code:
Код:
public OnPlayerConnect(playerid)
{
	if(!IsPlayerNPC(playerid))
		CameraPosCheck(playerid);

	return 0;
}

forward CameraPosCheck(playerid);
public CameraPosCheck(playerid)
{
	if(IsPlayerConnected(playerid)))
	{
	    new
	        Float:p[3];
	        
		GetPlayerCameraPos(playerid, p[0], p[1], p[2]);
		
		printf("%f, %f, %f",
			p[0],
			p[1],
			p[2]);

		SetTimerEx("CameraPosCheck", 100, 0, "i", playerid);
	}

	return 0;
}
Remain still and move your camera about for awhile. You will notice that even though you've moved your camera, its position doesn't update until about a second later.
Try moving your character now while moving your camera; it updates at a far faster rate than when your character isn't moving.

I simply want the camera to update at the same rate that it would if your character was moving, regardless of whether or not your character is moving.


Re: GetPlayerCameraPos problemo - Daren_Jacobson - 03.08.2010

It updates as often as OnPlayerUpdate, which updates more often if you are moving.


Re: GetPlayerCameraPos problemo - Tannz0rz - 03.08.2010

Quote:
Originally Posted by Daren_Jacobson
Посмотреть сообщение
It updates as often as OnPlayerUpdate, which updates more often if you are moving.
Is there any way to make it update faster whilst not moving about?


Re: GetPlayerCameraPos problemo - Daren_Jacobson - 07.08.2010

I would say no, but I don't know.