Camera Positions & Spectating
#1

I've always had a problem with this.. Can anybody tell me what I'm doing wrong?

pawn Code:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating( playerid, true );

    SetPlayerCameraPos( playerid, 27.3945, -69.8670, 1.7541 );
    SetPlayerCameraLookAt( playerid, -3.7998, -114.1504, 1.7880, CAMERA_MOVE );
    return 1;
}
Of course, there's other code beneath this, I just snipped it out.
Reply
#2

pawn Code:
TogglePlayerSpectating(playerid, true);
SetTimerEx("OwnedNoob", 5000, false, "d", playerid);

public OwnedNoob(playerid)
{
     TogglePlayerSpectating(playerid, false);
     SpawnPlayer(playerid);
     return 1;
}
I have this code in my GM to make the Spectator.
Reply
#3

Quote:
Originally Posted by .FuneraL.
View Post
pawn Code:
TogglePlayerSpectating(playerid, true);
SetTimerEx("OwnedNoob", 5000, false, "d", playerid);

public OwnedNoob(playerid)
{
     TogglePlayerSpectating(playerid, false);
     SpawnPlayer(playerid);
     return 1;
}
I have this code in my GM to make the Spectator.
I'm sorry, but what? That's nowhere near what I need..
Reply
#4

I too have had problems making a smooth server entrance. The main point is the delay timer, and using InterpolateCameraPos with the to and from coordinates the same. Dumb, but it works.
pawn Code:
public OnPlayerConnect(playerid)
{
    SetTimerEx("SetJoinCamera", 100, false, "d", playerid);
    return 1;
}
public SetJoinCamera(playerid)
{
    TogglePlayerSpectating(playerid, 1);
    switch(random(5))
    {
        case 0:
        {
            InterpolateCameraPos(playerid,1006.8538, 282.1343, 85.7583, 1006.8538, 282.1343, 85.7583, 1000, CAMERA_CUT);
            InterpolateCameraLookAt(playerid, 1007.8502, 282.1040, 85.5879, 1007.8502, 282.1040, 85.5879, 1000, CAMERA_CUT);
        }
        case 1:
        {
            InterpolateCameraPos(playerid,646.6002, -594.4451, 15.9723, 646.6002, -594.4451, 15.9723, 1000, CAMERA_CUT);
            InterpolateCameraLookAt(playerid,646.9472, -593.6812, 16.1468, 645.9472, -593.6812, 16.1468, 1000, CAMERA_CUT);
        }
        case 2:
        {
            InterpolateCameraPos(playerid, 651.7802, -494.6155, 30.2279, 651.7802, -494.6155, 30.2279, 1000, CAMERA_CUT);
            InterpolateCameraLookAt(playerid, 652.5730, -493.9993, 29.9173, 652.5730, -493.9993, 29.9173, 1000, CAMERA_CUT);
        }
        case 3:
        {
            InterpolateCameraPos(playerid, 187.5941, -217.7278, 1.9320, 187.5941, -217.7278, 1.9320, 1000, CAMERA_CUT);
            InterpolateCameraLookAt(playerid, 188.3079, -217.0226, 2.0968, 188.3079, -217.0226, 2.0968, 1000, CAMERA_CUT);
        }
        default:
        {
            InterpolateCameraPos(playerid, 94.6793, -215.7012, 3.1615, 94.6793, -215.7012, 3.1615, 1000, CAMERA_CUT);
            InterpolateCameraLookAt(playerid, 94.1885, -216.5767, 3.2614, 94.1885, -216.5767, 3.2614, 1000, CAMERA_CUT);
        }
    }
    return 1;
}
Reply
#5

I guess I didn't make myself clear enough, lol. That's not what i need either, however, I appreciate the share on your part.

What I'm wondering is, why can't I toggle them spectating, and then set their camera position? It refuses to work.
Reply
#6

Whoops. Well like I said, using SetPlayerCameraPos doesn't work for some reason. However, using InterpolateCameraPos, it's the same thing as SetPlayerCameraPos, only if you use the TO and FROM the coordinates the same, and you use CAMERA_CUT (obviously). I was just providing an alternative.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)