05.10.2009, 18:23
Well, I have a working spectate code in 0.2 Maybe you could try this:
Obviously you need to also to have:
and set the variable:
Note: MAX_SERVER_PLAYERS can be changed to MAX_PLAYERS
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++;
}
}
pawn Код:
new gSpectateType[MAX_SERVER_PLAYERS];
pawn Код:
gSpectateType[playerid] = SPECTATE_TYPE_VEHICLE; // if they are spectating a vehicle or:
gSpectateType[playerid] = SPECTATE_TYPE_PLAYER; // if they are speccing a player