SA-MP Forums Archive
get highest killstreak - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: get highest killstreak (/showthread.php?tid=243993)



get highest killstreak - BlackWolf120 - 25.03.2011

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.


Re: get highest killstreak - MadeMan - 25.03.2011

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



Re: get highest killstreak - BlackWolf120 - 25.03.2011

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

regards.