SA-MP Forums Archive
Help with a Textdraw - 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)
+--- Thread: Help with a Textdraw (/showthread.php?tid=345124)



Help with a Textdraw - Faisal_khan - 23.05.2012

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);



Re: Help with a Textdraw - Faisal_khan - 25.05.2012

Anyone?


Re: Help with a Textdraw - sampmark05 - 25.05.2012

Don't bump


Re: Help with a Textdraw - Ballu Miaa - 25.05.2012

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.


Re: Help with a Textdraw - Faisal_khan - 25.05.2012

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.


Re: Help with a Textdraw - Faisal_khan - 27.05.2012

Bump! Anyone help me!


Re: Help with a Textdraw - Faisal_khan - 27.05.2012

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)?