Detecting who has the most kills
#3

Alright but would this work to get the players name iwth the highest kills?

pawn Код:
stock GetHighestKills()
{
    new player = INVALID_PLAYER_ID;
    new kills;
    for (new i; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if (GetPVarInt(i, "Kills") > kills)
            {
                player = i;
                kills = GetPVarInt(i, "Kills");
                GetPlayerName(i, hk, sizeof(hk));
            }
        }
    }
    return player;
}
Reply


Messages In This Thread
Detecting who has the most kills - by new121 - 16.03.2012, 18:30
Re: Detecting who has the most kills - by Psymetrix - 16.03.2012, 19:34
Re: Detecting who has the most kills - by new121 - 16.03.2012, 19:46
Re: Detecting who has the most kills - by coole210 - 16.03.2012, 19:47
Re: Detecting who has the most kills - by Psymetrix - 16.03.2012, 19:49
Re: Detecting who has the most kills - by new121 - 16.03.2012, 19:52

Forum Jump:


Users browsing this thread: 3 Guest(s)