SA-MP Forums Archive
Textdraw for ScoreBoard !!problems!! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw for ScoreBoard !!problems!! (/showthread.php?tid=220858)



Textdraw for ScoreBoard !!problems!! - BlackWolf120 - 04.02.2011

hi,
ive created a top score board that shows up after a round has ended.
Now theres one textdraw for every player.
It shows the name of the player, his amount of kills and deaths.
But theres one problem:
well, its a bit difficult to explain...

I want the numbers that show the kills and deaths of all the players to be exactly among each other.
Like this:

pawn Код:
Player1      2Kills 3Deaths
Player2      2Kills 3Deaths
Player3      2Kills 3Deaths
But with the texdraw ive created theres a problem as soon as the names of the players have a different length.
Like this:

pawn Код:
Tom      2Kills 3Deaths
Mike Thomson      2Kills 3Deaths
Snake of Death     2Kills 3Deaths
And this looks just ugly
So how can i prevent this little bug??

Id be happy about some tips.

pawn Код:
RoundEndStats1 = TextDrawCreate(3.000000, 156.000000, "1.  --");
TextDrawBackgroundColor(RoundEndStats1, 255);
TextDrawFont(RoundEndStats1, 2);
TextDrawLetterSize(RoundEndStats1, 0.230000, 0.799999);
TextDrawColor(RoundEndStats1, -1);
TextDrawSetOutline(RoundEndStats1, 1);
TextDrawSetProportional(RoundEndStats1, 1);
TextDrawUseBox(RoundEndStats1, 1);
TextDrawBoxColor(RoundEndStats1, -926378346);
TextDrawTextSize(RoundEndStats1, 219.000000, -1.000000);


GetPlayerName(TotalPlayersEnd[0], string, sizeof(string));
format(string, sizeof(string), "~r~1.  ~w~%s               ~r~%d            ~b~%d", name,kills[playerid],deaths[playerid]);//what should be changed/added here???
TextDrawShowForAll(RoundEndStats1);
regards....


Re: Textdraw for ScoreBoard !!problems!! - Krx17 - 04.02.2011

Try using \t


Re: Textdraw for ScoreBoard !!problems!! - BlackWolf120 - 04.02.2011

thx for ur answer

what do u mean by using \t ?

to write \t in front of all the %d's and %s's ?


Re: Textdraw for ScoreBoard !!problems!! - Ricop522 - 04.02.2011

~n~

Try use


Re: Textdraw for ScoreBoard !!problems!! - BlackWolf120 - 04.02.2011

~n~ is for a new line


Re: Textdraw for ScoreBoard !!problems!! - BlackWolf120 - 01.03.2011

any ideas guys?


Re: Textdraw for ScoreBoard !!problems!! - Stigg - 01.03.2011

Id use two textdraws side by side aligned to the right, 1 for players name and 2 for kills + Deaths.
That will keep it neat and tidy. Thats just what i'd do.


Re: Textdraw for ScoreBoard !!problems!! - BlackWolf120 - 01.03.2011

yeah, thats a good trick
But isnt there another solution so i dont have to do all the textdraws again?
a command like /t to kinda freeze the position of some textdraws elements or sth.?

id be so happy if someone can help me or at least tell me if sth. like this is even possible.

thx in advance


Re: Textdraw for ScoreBoard !!problems!! - BlackWolf120 - 01.03.2011

ok, thx alot guys
then ive got alot of work to do now

but if even a pro scripter like ****** says that this is hard and maybe even unpossible i think im supposed to change all my textdraws

thx again for ur help

regards.