Textdraw Help
#1

Hi SA-MP Community,

Can you help me how to make some series of textdraws to get top 5 wanted players?
I tried Ryders script like this:
pawn Code:
{
                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);
                TextDrawShowForPlayer(playerid, Textdraw38);
                TextDrawSetString(Textdraw7, player_Name);
                TextDrawShowForPlayer(playerid, Textdraw7);
                TextDrawSetSelectable(Textdraw7, true);
            }
Its just showing in one textdraw, not in all. Even though I have created all TDs below it.
Help me.
Reply
#2

Bump!
Reply
#3

Provide here the whole code with the textdraw's, and the function you're using to get the wantedlevel.
Reply
#4

Here are the Textdraws and there are two codes for getting Wanted level you can chose anyone I was testing it:
pawn Code:
TextDrawShowForPlayer(playerid, Textdraw0);
            TextDrawShowForPlayer(playerid, Textdraw1);
            TextDrawShowForPlayer(playerid, Textdraw4);
            {
                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);
                TextDrawShowForPlayer(playerid, Textdraw38);
                TextDrawSetString(Textdraw7, player_Name);
                TextDrawShowForPlayer(playerid, Textdraw7);
                TextDrawSetSelectable(Textdraw7, true);
            }
            {
                /*new count = 1, name[24], string[200];
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnected(i))
                        GetPlayerWantedLevel(i);
                    if(GetPlayerWantedLevel(i) >= 5)
                    {
                        GetPlayerName(i, name, sizeof(name));
                        format(string, sizeof(string), "%s%s", string, name);
                        count ++;
                    }
                }

                if(count != 3)
                {
                    TextDrawSetString(Textdraw22, string);
                }
                else TextDrawSetString(Textdraw22, "N/A");*/

                TextDrawShowForPlayer(playerid, Textdraw22);
                TextDrawSetSelectable(Textdraw22, true);
            }
            TextDrawShowForPlayer(playerid, Textdraw23);
            TextDrawSetSelectable(Textdraw23, true);
            TextDrawShowForPlayer(playerid, Textdraw24);
            TextDrawSetSelectable(Textdraw24, true);
            TextDrawShowForPlayer(playerid, Textdraw25);
            TextDrawSetSelectable(Textdraw25, true);
            TextDrawShowForPlayer(playerid, Textdraw26);
            TextDrawSetSelectable(Textdraw26, true);
            TextDrawShowForPlayer(playerid, Textdraw27);
            TextDrawSetSelectable(Textdraw27, true);
            TextDrawShowForPlayer(playerid, Textdraw28);
            TextDrawSetSelectable(Textdraw28, true);
            TextDrawShowForPlayer(playerid, Textdraw29);
            TextDrawSetSelectable(Textdraw29, true);
            TextDrawShowForPlayer(playerid, Textdraw30);
            TextDrawSetSelectable(Textdraw30, true);
            TextDrawShowForPlayer(playerid, Textdraw31);
            TextDrawSetSelectable(Textdraw31, true);
            TextDrawShowForPlayer(playerid, Textdraw32);
            TextDrawSetSelectable(Textdraw32, true);
            TextDrawShowForPlayer(playerid, Textdraw33);
            TextDrawSetSelectable(Textdraw33, true);
            TextDrawShowForPlayer(playerid, Textdraw34);
            TextDrawSetSelectable(Textdraw34, true);
            TextDrawShowForPlayer(playerid, Textdraw35);
            TextDrawShowForPlayer(playerid, Textdraw36);
            TextDrawShowForPlayer(playerid, Textdraw37);
            TextDrawShowForPlayer(playerid, Textdraw39);
            TextDrawShowForPlayer(playerid, Textdraw40);
            TextDrawShowForPlayer(playerid, Textdraw41);
            TextDrawShowForPlayer(playerid, Textdraw42);
            TextDrawShowForPlayer(playerid, Textdraw43);
            TextDrawShowForPlayer(playerid, Textdraw44);
            TextDrawShowForPlayer(playerid, Textdraw45);
            TextDrawShowForPlayer(playerid, Textdraw46);
            TextDrawShowForPlayer(playerid, Textdraw47);
            TextDrawShowForPlayer(playerid, Textdraw48);
            TextDrawShowForPlayer(playerid, Textdraw49);
            TextDrawShowForPlayer(playerid, Textdraw50);
            TextDrawShowForPlayer(playerid, Textdraw51);
            TextDrawShowForPlayer(playerid, Textdraw61);
            TextDrawShowForPlayer(playerid, Textdraw62);
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)