SA-MP Forums Archive
Camera problem. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Camera problem. (/showthread.php?tid=343928)



Camera problem. - x96664 - 19.05.2012

There is a new function in 0.3e: InterpolateCameraPos,and I want to use the moving camera in my server, but I have 2 problems.
The first one is,when I click to choose another skin the camera moves again from starting position to class selection position(that's not very cool :S).
And the second problem is that skins are not visible.
Код:
public OnPlayerRequestClass(playerid, classid)
{
   	SetPlayerPos(playerid, 330.0273,1307.4177,59.0736);
	SetPlayerFacingAngle(playerid, 358.2263);
        InterpolateCameraPos(playerid, -385.947540, 1386.031005, 44.999927, -332.731658, 1311.356323, 59.700035, 5000);
        InterpolateCameraLookAt(playerid, -383.063262, 1381.969848, 45.433204, -330.227203, 1307.135375, 58.745227, 2000);
	return 1;
}



Re: Camera problem. - MP2 - 19.05.2012

Use a variable.

pawn Код:
new somevariable[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    somevariable[playerid] = 0; // You must reset the variable
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    if(!somevariable[playerid]) // If it's 0 it means the class selection hasn't been set up yet
    {
    SetPlayerPos(playerid, 330.0273,1307.4177,59.0736);
    SetPlayerFacingAngle(playerid, 358.2263);
        InterpolateCameraPos(playerid, -385.947540, 1386.031005, 44.999927, -332.731658, 1311.356323, 59.700035, 5000);
        InterpolateCameraLookAt(playerid, -383.063262, 1381.969848, 45.433204, -330.227203, 1307.135375, 58.745227, 2000);
        somevariable[playerid] = 1; // Mark it as 'set up'
    }
    return 1;
}



Re: Camera problem. - x96664 - 19.05.2012

Ty MP2, but the skins are still invisible ?!


Re: Camera problem. - MP2 - 19.05.2012

I set my position to your SetPlayerPos coordinates - it's in the sky.


Re: Camera problem. - x96664 - 19.05.2012

Quote:
Originally Posted by MP2
Посмотреть сообщение
I set my position to your SetPlayerPos coordinates - it's in the sky.
Yes,that's the reason,when I copied the coordinates from savedpositions list (ingame /save) I have missed one "-".
So,thank you a lot.REP+ !