PlayerSpectatePlayer in Interiors/Virtual World [0.3 Bug?]
#3

Well, I have a working spectate code in 0.2 Maybe you could try this:

pawn Код:
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    // IF ANYONE IS SPECTATING THIS PLAYER, WE'LL ALSO HAVE
    // TO CHANGE THEIR INTERIOR ID TO MATCH
    new x = 0;
    while(x!=MAX_SERVER_PLAYERS)
    {
      if( IsPlayerConnected(x) && GetPlayerState(x) == PLAYER_STATE_SPECTATING & pSpectating[x] == playerid && gSpectateType[x] == SPECTATE_TYPE_PLAYER )
        {
          SetPlayerInterior(x,newinteriorid);
        }
        x++;
    }
}
Obviously you need to also to have:
pawn Код:
new gSpectateType[MAX_SERVER_PLAYERS];
and set the variable:
pawn Код:
gSpectateType[playerid] = SPECTATE_TYPE_VEHICLE; // if they are spectating a vehicle or:
gSpectateType[playerid] = SPECTATE_TYPE_PLAYER; // if they are speccing a player
Note: MAX_SERVER_PLAYERS can be changed to MAX_PLAYERS
Reply


Messages In This Thread
PlayerSpectatePlayer in Interiors/Virtual World [0.3 Bug?] - by Doktor - 05.10.2009, 07:46
Re: PlayerSpectatePlayer in Interiors? - by Doktor - 05.10.2009, 17:47
Re: PlayerSpectatePlayer in Interiors? - by member - 05.10.2009, 18:23
Re: PlayerSpectatePlayer in Interiors? - by Doktor - 05.10.2009, 19:28

Forum Jump:


Users browsing this thread: 1 Guest(s)