Remake code
#1

I need your help guys i don't get it how i need remake this code, because now this system detect top5 score player bat i need remake it to detect best 5 killstreak person at the round until they die. Here me code
Код:
stock GetPlayerHighestScores(array[][rankingEnum], left, right)
{
    new
    tempLeft = left,
    tempRight = right,
    pivot = array[(left + right) / 2][player_Score],
    tempVar
    ;
    while(tempLeft <= tempRight)
    {
    while(array[tempLeft][player_Score] > pivot) tempLeft++;
    while(array[tempRight][player_Score] < pivot) tempRight--;

    if(tempLeft <= tempRight)
    {
    tempVar = array[tempLeft][player_Score], array[tempLeft][player_Score] = array[tempRight][player_Score], array[tempRight][player_Score] = tempVar;
    tempVar = array[tempLeft][player_ID], array[tempLeft][player_ID] = array[tempRight][player_ID], array[tempRight][player_ID] = tempVar;
    tempLeft++, tempRight--;
    }
    }
    if(left < tempRight) GetPlayerHighestScores(array, left, tempRight);
    if(tempLeft < right) GetPlayerHighestScores(array, tempLeft, right);
}
OnPlayerSpawn
Код:
   new
    playerScores[MAX_PLAYERS][rankingEnum],
    index
    ;
    for(new i; i != MAX_PLAYERS; ++i)
    {
    if(IsPlayerConnected(i) && !IsPlayerNPC(i))
    {
    playerScores[index][player_Score] = GetPlayerScore(i);
    playerScores[index++][player_ID] = i;
    }
    }
    GetPlayerHighestScores(playerScores, 0, index);
    new
    score_Text[256] = "~n~",
    player_Name[20]
    ;
    for(new i; i < 5; ++i)
    {
    if(i < index)
    {
    GetPlayerName(playerScores[i][player_ID], player_Name, sizeof(player_Name));
    format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~w~%s - ~r~%d", score_Text, i + 1, player_Name, playerScores[i][player_Score]);
    }
    else
    format(score_Text, sizeof(score_Text), "%s~n~~b~%d. ~r~N/A", score_Text, i + 1);
    }
    TextDrawSetString(text_Top5[1], score_Text);
    TextDrawShowForPlayer(playerid, text_Top5[0]);
    TextDrawShowForPlayer(playerid, text_Top5[1]);
And me kills variable is pKills and killstreak variable is Killstreak i dont know which you need so i gave both
Reply
#2

Help guys
Reply
#3

Bump
Reply
#4

Here "me" code lmaoo
Reply
#5

Quote:
Originally Posted by setes7
Посмотреть сообщение
Here "me" code lmaoo
Maybe i don't know
Reply
#6

Someone help pls
Reply
#7

Bump
Reply
#8

With that horrible indentation I don't think anyone is going to help you. Consider indenting your code and write your problem properly.
Reply
#9

Quote:
Originally Posted by Jayse
Посмотреть сообщение
With that horrible indentation I don't think anyone is going to help you. Consider indenting your code and write your problem properly.
Well this code show best player who have most exp i need remake this code to show who have best killstreak at that moment. Jesus its so hard to understand?
Reply
#10

Any help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)