I need help...
#1

I have a cinematic with InterpolateCameraPos and InterpolateCameraLookAt but I want to see them while you're in the Dialog Login, but it shows me after it... I don't know what to do.

Код:
public OnPlayerConnect(playerid)
{
    if(fexist(UserPath(playerid)))
    {
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Welcome","Password:","Log-in","Exit");
    }
    else
    {
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"Welcome","Password to register:","Register","Exit");
    }
	return 1;
}
Код:
public OnPlayerRequestClass(playerid,classid)
{
    new Float:x, Float:y, Float:z;
    x = PlayerInfo[playerid][pPos_x];
    y = PlayerInfo[playerid][pPos_y];
    z = PlayerInfo[playerid][pPos_z];
    
    SetPlayerPos(playerid, x, y, z);
    SetPlayerInterior(playerid, 0);
    TogglePlayerSpectating(playerid, 1);
    SetTimerEx("LoginCinematic", 100, false, "d", playerid);
    PlayAudioStreamForPlayer(playerid,"https://www.dropbox.com/u/2m/login.mp3?dl=1");
    return 1;
}
Код:
forward LoginCinematic(playerid);
public LoginCinematic(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);
	return 1;
}
Reply
#2

Make a timer for OnPlayerConnect.

Copy and paste your OnPlayerConnect and just make it into something else. Set a timer for 1ms.

Add TogglePlayerSpectating(playerid, true) under OnPlayerConnect and the cinematics.

Only way it worked for me.
Reply
#3

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
Make a timer for OnPlayerConnect.

Copy and paste your OnPlayerConnect and just make it into something else. Set a timer for 1ms.

Add TogglePlayerSpectating(playerid, true) under OnPlayerConnect and the cinematics.

Only way it worked for me.
I had it exactly what you say, but camera started skiping some parts of the cinematic and loading it like 6-7 seconds later...
Reply
#4

Now my OnPlayerConnect is right this

Код:
public OnPlayerConnect(playerid)
{
    new Float:x, Float:y, Float:z;
    x = PlayerInfo[playerid][pPos_x];
    y = PlayerInfo[playerid][pPos_y];
    z = PlayerInfo[playerid][pPos_z];

    SetPlayerPos(playerid, x, y, z);
    SetPlayerInterior(playerid, 0);
    TogglePlayerSpectating(playerid, 1);
   	SetTimerEx("LoginCinematic", 1, false, "f", playerid);
But it takes like 5 seconds to the cinematic to be played...
Reply
#5

Don't use a timer for the cinematics. Use a timer for OnPlayerConnect.

Example:
Код:
public OnPlayerConnect(playerid)
{
	SetTimerEx("OP_OnPlayerConnect", 1000, false, "i", playerid);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)