Spectating Issue
#1

I made the player to spectate nothing for 5 secondsTogglePlayerSpectating(playerid, 1);
After 5 seconds I tried TogglePlayerSpectating(playerid, 0); But the player is still in spectate mode. Is it a bug?

Here's the code:
Код:
TogglePlayerSpectating(playerid, 1);
SetTimerEx("PlayerOff", 5000, 0, "d", playerid);
After 5 seconds....
Код:
public PlayerOff(playerid)
{
SetPlayerPos(playerid, 1481.2018, 1778.8016, 14.7248);
SetPlayerFacingAngle(playerid, 264.7461);
SetPlayerCameraLookAt(playerid, 1481.2018, 1778.8016, 14.7248);
SetPlayerCameraPos(playerid, 1481.2018 + (10 * floatsin(-272.846618, degrees)), 1778.8016 + (10 * floatcos(-272.846618, degrees)), 14.7248);
TogglePlayerSpectating(playerid, 0);
return 1;
}
Reply
#2

I don't understand, why are you setting the pos, before you put spectating to 0, spectating to 0 will spawn the player. Also you should use PlayerSpectatePlayer( playerid, targetid )
So:
pawn Код:
TogglePlayerSpectating( playerid, 1 ); PlayerSpectatePlayer( playerid, targetid );
And just:
pawn Код:
public PlayerOff( playerid ) return TogglePlayerSpectating( playerid, 0 );
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)