TOP 5 Kills
#1

Hello guys, I need help with this function I've Copy `Ryder Function for Highlist Scores And trying Change it From Scores to Kills What I mean? I want make It If there a player kill someone Textdraw Updated to
Example: RedRex - 1 Its mean I've killed a 1player now I've Creating it and Its worked But If I killed my Friend The textdraw is not updated to 1 or 2 Help me?

//OnPlayerDeath adding this


PHP код:
new
            
playerKills[MAX_PLAYERS][rankingEnum],
            
index
        
;
        for(new 
i!= MAX_PLAYERS; ++i)
        {
            if(
IsPlayerConnected(i) && !IsPlayerNPC(i))
            {
                
playerKills[index][player_Kill] = GetPlayerKills(i);
                
playerKills[index++][player_ID] = i;
            }
        }
        
GetPlayerHighestKills(playerKills0index);
        new
            
score_Text[256] = "~n~",
            
player_Name[20]
        ;
        for(new 
i5; ++i)
        {
            if(
index)
            {
                
GetPlayerName(playerKills[i][player_ID], player_Namesizeof(player_Name));
                
format(score_Textsizeof(score_Text), "%s~n~~b~%d. ~w~%s - ~r~%d"score_Text1player_NameplayerKills[i][player_Kill]);
            }
            else
                
format(score_Textsizeof(score_Text), "%s~n~~b~%d. ~r~N/A"score_Text1);
        }
        
TextDrawSetString(text_Top5[1], score_Text);
        
TextDrawShowForPlayer(playeridtext_Top5[0]);
        
TextDrawShowForPlayer(playeridtext_Top5[1]); 
PHP код:
stock GetPlayerKills(playerid)
{
    return 
PlayerInfo[playerid][pKills];
}
stock GetPlayerHighestKills(array[][rankingEnum], leftright)
{
    new
        
tempLeft left,
        
tempRight right,
        
pivot = array[(left right) / 2][player_Kill],
        
tempVar
    
;
    while(
tempLeft <= tempRight)
    {
        while(array[
tempLeft][player_Kill] > pivottempLeft++;
        while(array[
tempRight][player_Kill] < pivottempRight--;
        if(
tempLeft <= tempRight)
        {
            
tempVar = array[tempLeft][player_Kill], array[tempLeft][player_Kill] = array[tempRight][player_Kill], array[tempRight][player_Kill] = tempVar;
            
tempVar = array[tempLeft][player_ID], array[tempLeft][player_ID] = array[tempRight][player_ID], array[tempRight][player_ID] = tempVar;
            
tempLeft++, tempRight--;
        }
    }
    if(
left tempRightGetPlayerHighestKills(array, lefttempRight);
    if(
tempLeft rightGetPlayerHighestKills(array, tempLeftright);

Reply


Messages In This Thread
TOP 5 Kills - by RedRex - 28.12.2017, 10:54
Re: TOP 5 Kills - by Hunud - 28.12.2017, 14:46
Re: TOP 5 Kills - by RedRex - 28.12.2017, 17:55
Re: TOP 5 Kills - by RedRex - 28.12.2017, 22:49
Re: TOP 5 Kills - by mirou123 - 28.12.2017, 22:56
Re: TOP 5 Kills - by RedRex - 28.12.2017, 22:59
Re: TOP 5 Kills - by Sew_Sumi - 28.12.2017, 23:07
Re: TOP 5 Kills - by RedRex - 28.12.2017, 23:08
Re: TOP 5 Kills - by Sew_Sumi - 28.12.2017, 23:27
Re: TOP 5 Kills - by RedRex - 29.12.2017, 22:49

Forum Jump:


Users browsing this thread: 3 Guest(s)