Help with a Textdraw
#1

Hi SA-MP Community,

I made a most wanted player code. So when I have more than 1 players, I only get the first Textdraw filled with a persons name. Eg:- If I and my friends are playing and all have wanted levels, only the first Textdraw will have a name. How can I add more Textdraws to have name of 1st wanted player, 2nd wanted player.....
Here is my code:
pawn Код:
new
                playerWL[MAX_PLAYERS][Crime],
                index
                ;
            for(new i; i != MAX_PLAYERS; ++i) {
                if(IsPlayerConnected(i) && !IsPlayerNPC(i)) {
                    playerWL[index][player_WantedLevel] = GetPlayerWantedLevel(i);
                    playerWL[index++][player_ID] = i;
                }
            }
            GetPlayerHighestWantedLevel(playerWL, 0, index);

            new
                player_Name[20], string[24+MAX_PLAYER_NAME+1], player_Level[256];
            for(new i; i < 5; ++i) {
                if(i < index) {
                    GetPlayerName(playerWL[i][player_ID], player_Name, sizeof(player_Name));
                    format(string, sizeof(string), "~w~%s", player_Name);
                    format(player_Level, sizeof(player_Level), "%d", playerWL[i][player_WantedLevel]);
                }
                else
                    format(string, sizeof(string), "~r~N/A", player_Name);
            }
            TextDrawSetString(Textdraw38, player_Level);// level TD
            TextDrawShowForPlayer(playerid, Textdraw38);
            TextDrawSetString(Textdraw7, player_Name);//name TD
            TextDrawShowForPlayer(playerid, Textdraw7);
Reply
#2

Anyone?
Reply
#3

Don't bump
Reply
#4

If you want to update the same TextDraw.

Use TextDrawSetString under OnPlayerUpdate or anything and check for the player is wanted or not. Then update the TextDraw with the more wanted players?

Else.

Make more textdraws like the same first , just below this one. Use it as you do. But you need to add a random number which will use a switch between cases and it will put the player's name to that.
Reply
#5

I made Textdraws below them. As I said I added the code of getting wanted players for only one TD. I want this to be added in all TDs with the most wanted player on top. How can I do it? Can you explain me with some examples of Tds?
I have seen this in SendClientMessage, ShowPlayerDialogs. But not in TDs.
Reply
#6

Bump! Anyone help me!
Reply
#7

Hey I got an idea! Can't I submerge all the Name TDs to one Td then get all the wanted players name on one line, then in string use /n? But will I be able to click on each players name (i.e. using Selectable Textdraw)?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)