Need Help [Quick]
#1

I got a bug in my script. i have a function in which it finds the highest killer but it is not working perfectly.

pawn Код:
for(new i = 0; i <= MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(pcount>=2){
            if(Kills[i] > mostkills) mostkills = Kills[i];
            PlayerInfo[i][pWins]++;
            new name[MAX_PLAYER_NAME], string2[ 64 ];
            GetPlayerName(i, name, sizeof(name));
            format( string2, sizeof(string2), "~r~%s ~w~has won the match with ~r~%d~w~ kills.", name,Kills[i]);
            GameTextForAll(string2, 5000, 3);}

        }
    }
    for(new i = 0; i <= MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
        {
            if(pcount>=2){
            if(Kills[i] == Kills[i])
            {
            new string2[ 64 ];
            format( string2, sizeof(string2), "~g~Draw! ~r~No one ~w~is winner in this match.");
            GameTextForAll(string2, 5000, 3);}
            }
        }
    }
    if(pcount==1){
    new string[ 64 ];
    format( string, sizeof(string), "~w~You ~r~need ~w~one more player to win this match.");
    GameTextForAll( string, 5000, 3 );
    }
please hlep.......
Reply
#2

aaaa i gues, you get Draw No one is winner.

Because you are doing this if(Kills[i] == Kills[i]) its like you are checking if (true), try changing if(Kills[i] == mostkills)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)