TogglePlayerSpectating kicks player from the server.
#1

This bug has been usual for the past couple of RC and had been inherited with the Spawn( playerid ); bug (0.3d, or below) during Class Selection.

Step-by-step:
1. Connect the player to the server and TogglePlayerSpectating( playerid, 1 );
2. Place a couple dialogs and whatnot, one especially to spawn the player.
3. In the dialog to spawn the player, instead of SpawnPlayer( playerid ); use TogglePlayerSpectating( playerid, 0 );
4. You just randomly get kicked.

It's just like the same concept in 0.3d I believe, where you could only use SetSpawnInfo instead of SpawnPlayer.

Would be great if it is fixed because calling OnPlayerSpawn twice does bother me, and most likely some other people.
Reply
#2

I can confirm this.
Reply
#3

That's obvious. Of course you cannot spawn while you are spectating.

Put
pawn Code:
TogglePlayerSpectating(playerid, false);
TogglePlayerControllable(playerid, true);
Reply
#4

Spawn the player under OnPlayerConnect and use TogglePlayerSpectating under OnPlayerSpawn.

OnPlayerSpawn :
pawn Code:
if(FirstSpawn[playerid] == 0)
{
    FirstSpawn[playerid] = 1;
    TogglePlayerSpectating(playerid, true);
    //camera effect? InterpolateCameraPos/SetPlayerCameraPos
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)