hi találtam egy spec \"rendszert\" de csak a legnagyobb és a leg kissebb játékos id-k között váltogat mi lehet vele a gond?
forward SpectateOn(playerid);
public SpectateOn(playerid)
{
TogglePlayerSpectating(playerid, 1);
for(new i=0; i {
if(IsPlayerConnected(i))
{
SpectatedPlayer[playerid] = i;
PlayerSpectatePlayer(playerid, i);
}
}
IsPlayerSpectating[playerid] = true;
new str[128];
format(str, 128, \"You are now spectating %s (ID:%d).\", GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
SendClientMessage(playerid, colorSPECTATE, str);
}
forward SpectateOff(playerid);
public SpectateOff(playerid)
{
TogglePlayerSpectating(playerid, 0);
SpectatedPlayer[playerid] = 0;
IsPlayerSpectating[playerid] = false;
SendClientMessage(playerid, colorSPECTATE, \"You stopped spectating.\");
}
forward SpectateNext(playerid);
public SpectateNext(playerid)
{
for(new i=SpectatedPlayer[playerid]; i {
if(i==MAX_PLAYERS) i=0;
if(IsPlayerConnected(i))
{
PlayerSpectatePlayer(playerid, i);
SpectatedPlayer[playerid] = i;
}
}
new str[128];
format(str, 128, \"You are now spectating %s (ID:%d).\", GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
SendClientMessage(playerid, colorSPECTATE, str);
return 1;
}
forward SpectatePrevious(playerid);
public SpectatePrevious(playerid)
{
for(new i=SpectatedPlayer[playerid]; i>-1; i--)
{
if(i==-1) i=MAX_PLAYERS;
if(IsPlayerConnected(i))
{
PlayerSpectatePlayer(playerid, i);
SpectatedPlayer[playerid] = i;
}
}
new str[128];
format(str, 128, \"You are now spectating %s (ID:%d).\", GetName(SpectatedPlayer[playerid]), SpectatedPlayer[playerid]);
SendClientMessage(playerid, colorSPECTATE, str);
return 1;
}