InterpolateCameraPos & InterpolateCameraLookAt
#1

I have added a cinematic while you're in the Login dialog, but it doesn't appear, i don't know why.

Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        ClearChatbox(playerid);
        ClearChatbox(playerid);
        ClearChatbox(playerid);
        InterpolateCameraPos(playerid, 1248.241333, 153.582839, 25.311567, 1370.322875, 431.673645, 24.460834, 30000);
        InterpolateCameraLookAt(playerid, 1250.376098, 158.097091, 25.058088, 1372.360595, 436.238433, 24.562707, 30000);
        TogglePlayerSpectating(playerid, 1);
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Bienvenido!","Introduce tu contraseсa para loguearte:","Log-in","Salir");
    }
    return 1;
}
Код:
OnDialogResponse...

case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    new skin, Float:x, Float:y, Float:z;
                    skin = PlayerInfo[playerid][pSkin];
                    x = PlayerInfo[playerid][pPos_x];
                    y = PlayerInfo[playerid][pPos_y];
                    z = PlayerInfo[playerid][pPos_z];

                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SetSpawnInfo(playerid, 0, skin, x, y, z, 0, 0, 0, 0, 0, 0, 0);
                    SpawnPlayer(playerid);
                    TogglePlayerSpectating(playerid, 0);
                    SetCameraBehindPlayer(playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    
                }
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Has introducido una contraseсa incorrecta.\nIntroduce tu contrseсa para loguearte.","Login","Salir");
                }
                return 1;
            }
        }
Reply
#2

Put TogglePlayerSpectating before InterpolateCam
Reply
#3

Camera interpolating is not working when used with TogglePlayerSpectating. You have to use timer or it will appear only sometimes.
Reply
#4

Quote:
Originally Posted by raydx
Посмотреть сообщение
Camera interpolating is not working when used with TogglePlayerSpectating. You have to use timer or it will appear only sometimes.
A timer with TogglePlayerSpectating or with Interpolate?
Reply
#5

Quote:
Originally Posted by Antenastyle
Посмотреть сообщение
A timer with TogglePlayerSpectating or with Interpolate?
Timer with delay for interpolate.
Reply
#6

Hello dude.
At This Momment u dont need timer. You have to write TogglePlayerSpectating(playerid, 1); When You Are Starting Interpolating Cameras. When You Are Going To Spawn Player Put TogglePlayerSpectating(playerid, 0); Before SpawnPlayer(playerid); .
Reply
#7

Quote:
Originally Posted by Lbaker
Посмотреть сообщение
Hello dude.
At This Momment u dont need timer. You have to write TogglePlayerSpectating(playerid, 1); When You Are Starting Interpolating Cameras. When You Are Going To Spawn Player Put TogglePlayerSpectating(playerid, 0); Before SpawnPlayer(playerid); .
Not working
Reply
#8

I also got this problem. I'm using SetPlayerCameraPos & LookAt under OnPlayerConnect.

Let me know if you find a fix please.
Reply
#9

Quote:
Originally Posted by Lbaker
Посмотреть сообщение
Hello dude.
At This Momment u dont need timer. You have to write TogglePlayerSpectating(playerid, 1); When You Are Starting Interpolating Cameras. When You Are Going To Spawn Player Put TogglePlayerSpectating(playerid, 0); Before SpawnPlayer(playerid); .
Bullshit.

I told you - timer is only solution.
Reply
#10

Quote:
Originally Posted by raydx
Посмотреть сообщение
Bullshit.

I told you - timer is only solution.
It works perfect, but how can I do that when the cinematic finish, the player get to a X position, because I have this...
Код:
case DIALOG_LOGIN:
        {
            if ( !response ) return Kick ( playerid );
            if( response )
            {
                if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
                {
                    new skin, Float:x, Float:y, Float:z;
                    skin = PlayerInfo[playerid][pSkin];
                    x = PlayerInfo[playerid][pPos_x];
                    y = PlayerInfo[playerid][pPos_y];
                    z = PlayerInfo[playerid][pPos_z];

                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
                    SetSpawnInfo(playerid, 0, skin, x, y, z, 0, 0, 0, 0, 0, 0, 0);
                    TogglePlayerSpectating(playerid, 0);
                    SpawnPlayer(playerid);
                    SetCameraBehindPlayer(playerid);
                    GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
                    
				}
                else
                {
                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"Login","Has introducido una contraseсa incorrecta.\nIntroduce tu contrseсa para loguearte.","Login","Salir");
                }
                return 1;
            }
        }
But the player don't get in the position, and OnPlayerSpawn is called twice...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)