need help in editing a simple spec system. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: need help in editing a simple spec system. (
/showthread.php?tid=487468)
need help in editing a simple spec system. -
Champ - 13.01.2014
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.
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;
}
Don't know how to edit in such a way that it only specs the spawned players not the dead one.
Any Idea ?