Return the 3 top scoring
#8

That will format the top three into the textdraw "FirstPlace"
pawn Code:
//
    new
        wPlayers[MAX_PLAYERS][2]
    ;
    GetHighScorePlayers(wPlayers);
    // wPlayers[x][0] stores the playerid
    // wPlayers[x][1] stores the score
    new
        first[MAX_PLAYER_NAME],
        second[MAX_PLAYER_NAME],
        third[MAX_PLAYER_NAME],
        string[128]
    ;
    GetPlayerName(wPlayers[0][0], first, sizeof first);
    GetPlayerName(wPlayers[1][0], second, sizeof second);
    GetPlayerName(wPlayers[2][0], third, sizeof third);

    format(string, sizeof string,
        "\
            %s(%d)\n\
            %s(%d)\n\
            %s(%d)\
        "

        , first, wPlayers[0][1]
        , second, wPlayers[1][1]
        , third, wPlayers[2][1]
    );
    TextDrawSetString(FirstPlace, string);
    TextDrawShowForAll(FirstPlace);
Reply


Messages In This Thread
Return the 3 top scoring - by Kontrol - 04.05.2014, 01:10
Re: Return the 3 top scoring - by superrobot48 - 04.05.2014, 03:29
Re: Return the 3 top scoring - by Kontrol - 04.05.2014, 10:25
AW: Return the 3 top scoring - by Nero_3D - 04.05.2014, 10:39
Re: AW: Return the 3 top scoring - by Kontrol - 04.05.2014, 11:26
Re: Return the 3 top scoring - by XK - 04.05.2014, 11:40
Re: Return the 3 top scoring - by Kontrol - 04.05.2014, 12:32
AW: Re: Return the 3 top scoring - by Nero_3D - 04.05.2014, 13:33

Forum Jump:


Users browsing this thread: 2 Guest(s)