01.02.2015, 14:50
pawn Код:
stock ReverseSpectate(playerid)
{
if(ConnectedPlayers(playerid) == 2)
return StopSpectate(playerid);
if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && Player[playerid][gSpectateID] != INVALID_PLAYER_ID)
{
for(new x=Player[playerid][gSpectateID]-1; x>=0; x--)
{
if(x == 0)
x = MAX_PLAYERS;
if(IsPlayerConnected(x) && x != playerid)
{
if((GetPlayerState(x) == PLAYER_STATE_SPECTATING && Player[x][gSpectateID] != INVALID_PLAYER_ID) ||
(GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
{
continue;
}
else
StartSpectate(playerid, x), break;
}
}
}
return 1;
}