25.08.2010, 14:23
Здравствуйте! Сделал перекл. спек на кнопку, ток когда переключаю, он начинает следить за другой командой, где тут ошибка?
Code:
stock AdvanceSpectate(playerid) { if(ConnectedPlayers() == 2) { StopSpectate(playerid); return 1; } if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && gSpectateID[playerid] != INVALID_PLAYER_ID) { for(new x=gSpectateID[playerid]+1; x<=MAX_PLAYERS; x++) { if(x == MAX_PLAYERS) { x = 0; } if(IsPlayerConnected(x) && x != playerid && Player[x][pTeam] != Player[playerid][pTeam]) { if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && gSpectateID[x] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3)) { continue; } else { StartSpectate(playerid, x); break; } } } } return 1; }