SA-MP Forums Archive
InterpolateCameraLookAt Help - 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)
+--- Thread: InterpolateCameraLookAt Help (/showthread.php?tid=461818)



InterpolateCameraLookAt Help - DJ_Shocker - 03.09.2013

Hey everyone.
I'm needing some pointers on what I'm doing wrong, here.
No matter how I put this, it continues to show the default LookAt point when connecting to the server.
pawn Код:
public OnPlayerConnect(playerid)
{
    playerOnline++;
    ResetVars(playerid);
    ConnectVars(playerid);
    new Query[300],string[128],pname[24],escpname[24];
    GetPlayerName(playerid,pname,24);
    mysql_real_escape_string(pname, escpname);
    format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%s'", escpname);
    mysql_query(Query);
    mysql_store_result();
    if(mysql_num_rows() != 0)
    {
        InterpolateCameraLookAt(playerid, -1971.6453,137.9267,27.6875, 1582.3514,-1732.9550,20.9012, 32000);
        format(string,sizeof(string),""chat" Welcome back %s",PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,string,""chat" Our system have detected your username registered please login","Login","Quit");
    }
    else
    {
        InterpolateCameraLookAt(playerid, -1971.6453,137.9267,27.6875, 1582.3514,-1732.9550,20.9012, 32000);
        format(string,sizeof(string),""chat" Hello %s to "NAME"",PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,string,""chat" Welcome to "NAME" you'll be forced to register please click register!","Register","Quit");
    }
    mysql_free_result();
    return 1;
}
Any ideas would be appreciated.
I've tried putting it at the top, the end, and in the dialogs. The camera will not go nor move. It just sits at the default camera position that SA-MP has!


Re: InterpolateCameraLookAt Help - DJ_Shocker - 03.09.2013

A little update:
I've used a CinematicCamera Editor I found here: https://sampforum.blast.hk/showthread.php?tid=329813

I used that to create one to test, still no luck:
pawn Код:
public OnPlayerConnect(playerid)
{
    playerOnline++;
    ResetVars(playerid);
    ConnectVars(playerid);
    new Query[300],string[128],pname[24],escpname[24];
    GetPlayerName(playerid,pname,24);
    mysql_real_escape_string(pname, escpname);
    format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `Username` = '%s'", escpname);
    mysql_query(Query);
    mysql_store_result();
    if(mysql_num_rows() != 0)
    {
       
        InterpolateCameraPos(playerid, 384.976440, -1783.745849, 24.020172, 370.032226, -1797.584228, 14.453218, 20000, 2);
        InterpolateCameraLookAt(playerid, 384.515258, -1787.649169, 23.277631, 370.464813, -1801.427734, 13.433354, 20000, 2);
        format(string,sizeof(string),""chat" Welcome back %s",PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,string,""chat" Our system have detected your username registered please login","Login","Quit");
    }
    else
    {
        InterpolateCameraPos(playerid, 384.976440, -1783.745849, 24.020172, 370.032226, -1797.584228, 14.453218, 20000, 2);
        InterpolateCameraLookAt(playerid, 384.515258, -1787.649169, 23.277631, 370.464813, -1801.427734, 13.433354, 20000, 2);
        format(string,sizeof(string),""chat" Hello %s to "NAME"",PlayerName(playerid));
        ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD,string,""chat" Welcome to "NAME" you'll be forced to register please click register!","Register","Quit");
    }
    mysql_free_result();
    return 1;
}



Re: InterpolateCameraLookAt Help - Konstantinos - 03.09.2013

Do not use it in OnPlayerConnect. When a player connects, it shows the santa maria beach (default), after OnPlayerConnect has been called, OnPlayerRequestClass is being called. This is where you should add the camera stuff.


Re: InterpolateCameraLookAt Help - DJ_Shocker - 03.09.2013

Thanks, Konstantinos!
I appreciate it! +Rep