Log-in camera movement -
iamjems - 18.10.2016
When I turn on my server, go into samp, on my log-in screen, the camera is looking at the default verona beach thing, unless I do /rcon gmx, then it runs fine and the camera moves as I wanted to.
When you turn on sa-mp at first, the camera is looking at the default verona beach thing, but when you /rcon gmx, it's fine.
I added this under OnPlayerConnect.
pawn Код:
SpawnPlayer(playerid);
TogglePlayerSpectating(playerid, 1);
InterpolateCameraLookAt(playerid, 2325.7061,-1063.7642,55.4202, 2325.7061,-1063.7642,45.4202, 10000, CAMERA_MOVE);
InterpolateCameraPos(playerid, 3.1435,-1955.6364,88.1194, 2106.8354,-1270.0221,100.7057, 10000, CAMERA_MOVE);
Any solution for this, or this is just a typical bug? Thanks
Re: Log-in camera movement -
Threshold - 19.10.2016
It's quite common. Assign a timer for the player under OnPlayerConnect so the camera functions operate on a slight delay.
Eg.
PHP код:
public OnPlayerConnect(playerid)
{
SetTimerEx("ConnectionCamera", 2000, false, "i", playerid);
// Rest of OnPlayerConnect...
}
forward ConnectionCamera(playerid);
public ConnectionCamera(playerid)
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraPos(playerid, 3.1435,-1955.6364,88.1194, 2106.8354,-1270.0221,100.7057, 10000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 2325.7061,-1063.7642,55.4202, 2325.7061,-1063.7642,45.4202, 10000, CAMERA_MOVE);
// Set a timer for 10 seconds here to spawn the player?
}
And are you sure those coordinates are correct? That camera is travelling quite a distance.
Re: Log-in camera movement -
thienle7090 - 19.10.2016
i add in onplayerconnect and it still work
Re: Log-in camera movement -
iamjems - 19.10.2016
Quote:
Originally Posted by Threshold
It's quite common. Assign a timer for the player under OnPlayerConnect so the camera functions operate on a slight delay.
Eg.
PHP код:
public OnPlayerConnect(playerid)
{
SetTimerEx("ConnectionCamera", 2000, false, "i", playerid);
// Rest of OnPlayerConnect...
}
forward ConnectionCamera(playerid);
public ConnectionCamera(playerid)
{
TogglePlayerSpectating(playerid, true);
InterpolateCameraPos(playerid, 3.1435,-1955.6364,88.1194, 2106.8354,-1270.0221,100.7057, 10000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 2325.7061,-1063.7642,55.4202, 2325.7061,-1063.7642,45.4202, 10000, CAMERA_MOVE);
// Set a timer for 10 seconds here to spawn the player?
}
And are you sure those coordinates are correct? That camera is travelling quite a distance.
|
Works great now... Thank you man! rep++;