Pershing
Умник
Ребят, нашел сток с рекурсией, но как не пробовал чё сделать - ничего не получилось, куча ошибок вылазило.
Вот собственно сам сток:
А вот сама строка, которая вызывает рекурсию:
Вот собственно сам сток:
PHP:
stock AdvanceSpectate(playerid)
{
if(ConnectedPlayers() == 2)
{
StopSpectate(playerid);
return true;
}
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)
{
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 true;
}
PHP:
StartSpectate(playerid, x);
