get highest killstreak
#1

hi,

i got killstreaks on my server but now id like to know how would i get the highest killstreak that has been made in the round and the name of the player who did this at the end of the round?
This is how my killstreaks work:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
Killstreak[playerid] = 0;
     if(IsPlayerConnected(killerid))
     {
        Killstreak[killerid]++;
        switch(Killstreak[killerid])
        {
            case 1:
            {
            //code for 1 kill.......
            }
I think i have to save the killstreaks of every playe to variables and compare them at the end of the round?
I hope someone can help me.

regards.
Reply
#2

pawn Код:
new HighestKillstreak;
new HighestKillstreakPlayer;
pawn Код:
Killstreak[killerid]++;
if(Killstreak[killerid] > HighestKillstreak)
{
    HighestKillstreak = Killstreak[killerid];
    HighestKillstreakPlayer = killerid;
}
Reply
#3

thx, i got an even better idea and with ur code this was possible thx alot !!!

regards.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)