SA-MP Forums Archive
TogglePlayerSpectating kicks player from the server. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: TogglePlayerSpectating kicks player from the server. (/showthread.php?tid=488204)



TogglePlayerSpectating kicks player from the server. - Lorenc_ - 17.01.2014

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.


Re: TogglePlayerSpectating kicks player from the server. - ViruZz - 17.01.2014

I can confirm this.


Re: TogglePlayerSpectating kicks player from the server. - EmilLykke - 18.01.2014

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

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



Re : TogglePlayerSpectating kicks player from the server. - Stefano.R - 18.01.2014

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;
}