13.01.2014, 16:22
Hello,
So i have edited a spec system but i have a problem. As i am making a no respawn tdm server. So I want a spec system which spec only spawned and alive players.
Don't know how to edit in such a way that it only specs the spawned players not the dead one.
Any Idea ?
So i have edited a spec system but i have a problem. As i am making a no respawn tdm server. So I want a spec system which spec only spawned and alive players.
pawn Код:
public SpectateNext(playerid) {
for(new i = 1, j = SpectatedPlayer[playerid] + 1; i < MAX_PLAYERS; ++i, j = (j + 1) % MAX_PLAYERS) {
if(IsPlayerConnected(j)) {
switch(GetPlayerState(j)) {
case 1: PlayerSpectatePlayer(playerid, j);
case 2, 3: PlayerSpectateVehicle(playerid, GetPlayerVehicleID(j));
default: continue;
}
SpectatedPlayer[playerid] = j;
new
str[128]
;
format(str, sizeof str, "You are now spectating %s (ID:%d).", GetName(j), j);
return SendClientMessage(playerid, colorSPECTATE, str);
}
}
return false;
}
Any Idea ?