Camera problem.
#1

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;
}
Reply
#2

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;
}
Reply
#3

Ty MP2, but the skins are still invisible ?!
Reply
#4

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

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+ !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)