08.05.2011, 15:28
Hello..
Here's the script:
bugged part;
When server executes this script, only ID 0 is re-spawned. and only ID0 receives text "sanemi?". Why's that?
Here's the script:
pawn Код:
public mute_lower()
{
if(atskaite>=1) atskaite --;
if(atskaite == -1)
{
if(GetAliveDrivingPlayers()==0)
{
// atskaite=30;
}
}
for(new i=0;i<MAX_PLAYERS;i++) { //loop for all players
new string[128];
if(atskaite>=2) //loop for all players
{
format(string, sizeof(string), "~g~Jauns raunds pec ~r~%i~g~ sekundem", atskaite);
GameTextForPlayer(i, string, 1500, 4);
}
else if(atskaite==1)
{
GameTextForPlayer(i, "~g~Jauns raunds pec ~r~1.~g~ sekundes", 1500, 4);
}
else if(atskaite==0)
{
beidzies=0;
PlayerInfo[i][dead]=0;
atskaite=-1;
PlayerInfo[i][dead] = 0;
StopSpectating(i);
TogglePlayerSpectating(i,false);
PlayerInfo[i][currentlyspectating]=-1;
SpawnRandom(i);
SetCameraBehindPlayer(i);
SendClientMessage(i, COLOR_RED, "sanemi?");
}
if (PlayerInfo[i][mute] <= 0) continue;
else if (PlayerInfo[i][mute] >= 1)
{
PlayerInfo[i][mute] --;
}
else if (PlayerInfo[i][mute] == 0)
{
GameTextForPlayer(i,"~g~Tu atkal vari runat~g~!",5000,1);
}
else if (PlayerInfo[i][mute] >= 1)
{
format(string, sizeof(string), "~r~Apklusinats! Atlikusais laiks: %i sekundes", PlayerInfo[i][mute]);
GameTextForPlayer(i, string, 1500, 4);
}
}
return 1;
}
pawn Код:
else if(atskaite==0)
{
beidzies=0;
PlayerInfo[i][dead]=0;
atskaite=-1;
PlayerInfo[i][dead] = 0;
StopSpectating(i);
TogglePlayerSpectating(i,false);
PlayerInfo[i][currentlyspectating]=-1;
SpawnRandom(i);
SetCameraBehindPlayer(i);
SendClientMessage(i, COLOR_RED, "sanemi?");
}