Log-in camera movement
#1

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

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"2000false"i"playerid);
    
// Rest of OnPlayerConnect...
}
forward ConnectionCamera(playerid);
public 
ConnectionCamera(playerid)
{
    
TogglePlayerSpectating(playeridtrue);
    
InterpolateCameraPos(playerid3.1435,-1955.6364,88.11942106.8354,-1270.0221,100.705710000CAMERA_MOVE);
    
InterpolateCameraLookAt(playerid2325.7061,-1063.7642,55.42022325.7061,-1063.7642,45.420210000CAMERA_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.
Reply
#3

i add in onplayerconnect and it still work
Reply
#4

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"2000false"i"playerid);
    
// Rest of OnPlayerConnect...
}
forward ConnectionCamera(playerid);
public 
ConnectionCamera(playerid)
{
    
TogglePlayerSpectating(playeridtrue);
    
InterpolateCameraPos(playerid3.1435,-1955.6364,88.11942106.8354,-1270.0221,100.705710000CAMERA_MOVE);
    
InterpolateCameraLookAt(playerid2325.7061,-1063.7642,55.42022325.7061,-1063.7642,45.420210000CAMERA_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++;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)