Only ID 0 is picked..
#1

Hello..
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;
}
bugged part;
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?");
        }
When server executes this script, only ID 0 is re-spawned. and only ID0 receives text "sanemi?". Why's that?
Reply
#2

pawn Код:
else if(atskaite=1)
        {
        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?");
        }
or
pawn Код:
else if(atskaite=0)
        {
        beidzies=0;
        PlayerInfo[i][dead]=0;
        atskaite=0;
        PlayerInfo[i][dead]=0;
        StopSpectating(i);
        TogglePlayerSpectating(i,false);
        PlayerInfo[i][currentlyspectating]=1;
        SpawnRandom(i);
        SetCameraBehindPlayer(i);
        SendClientMessage(i, COLOR_RED, "sanemi?");
        }
Reply
#3

pawn Код:
public mute_lower()
{
    new string[128];
    if(atskaite>=1) atskaite --;
    if(atskaite == -1)
    {
        if(GetAliveDrivingPlayers()==0)
        {
            //      atskaite=30;
        }
    }
    for(new i=0;i<MAX_PLAYERS;i++) { //loop for all players
        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)
        {
            PlayerInfo[i][dead]=0;
            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);
        }
    }
    if(atskaite==0)
    {
        beidzies=0;
        atskaite=-1;
    }
    return 1;
}
Reply
#4

Not working.. With MadeMan script, server freezes (not like don't send, but out of sync).
Reply
#5

put eror or warning compiler
Reply
#6

Quote:
Originally Posted by [RSS]Cops_sandu
Посмотреть сообщение
put eror or warning compiler
There's no errors or warnings.
Reply
#7

Show your StopSpectating function.
Reply
#8

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
Show your StopSpectating function.
Thanks, found error in there. Everything works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)