SA-MP Forums Archive
Help With 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 Textdraw (/showthread.php?tid=629251)



Help With Textdraw - Speaker - 23.02.2017

Hi guys help me fix it see the picture Amount Kills are Overlapping With Dealths



My code
Код:
At Top 
new Text:sstats;
new Text:kstats;
new Text:dstats;
new Text:rstats;
new Text:tstats;



ongamemodinit
    sstats = TextDrawCreate(152.800018, 344.213348, "~y~Score:");
    TextDrawLetterSize(sstats, 0.244399, 1.749332);
    TextDrawAlignment(sstats, 1);
    TextDrawColor(sstats, -1);
    TextDrawSetShadow(sstats, 0);
    TextDrawSetOutline(sstats, 1);
    TextDrawBackgroundColor(sstats, 51);
    TextDrawFont(sstats, 2);
    TextDrawSetProportional(sstats, 1);

    kstats = TextDrawCreate(152.799987, 357.653320, "Kills:");
    TextDrawLetterSize(kstats, 0.286799, 1.502933);
    TextDrawTextSize(kstats, 84.799995, 13.440000);
    TextDrawAlignment(kstats, 1);
    TextDrawColor(kstats, -1);
    TextDrawSetShadow(kstats, 0);
    TextDrawSetOutline(kstats, 1);
    TextDrawBackgroundColor(kstats, 51);
    TextDrawFont(kstats, 2);
    TextDrawSetProportional(kstats, 1);

    dstats = TextDrawCreate(152.800018, 368.853302, "Deaths:");
    TextDrawLetterSize(dstats, 0.220399, 1.659734);
    TextDrawAlignment(dstats, 1);
    TextDrawColor(dstats, -1);
    TextDrawSetShadow(dstats, 0);
    TextDrawSetOutline(dstats, -1);
    TextDrawBackgroundColor(dstats, 51);
    TextDrawFont(dstats, 2);
    TextDrawSetProportional(dstats, 1);

    rstats = TextDrawCreate(152.800003, 381.546569, "Rank:");
    TextDrawLetterSize(rstats, 0.305199, 1.487999);
    TextDrawAlignment(rstats, 1);
    TextDrawColor(rstats, -1);
    TextDrawSetShadow(rstats, 0);
    TextDrawSetOutline(rstats, 1);
    TextDrawBackgroundColor(rstats, 51);
    TextDrawFont(rstats, 2);
    TextDrawSetProportional(rstats, 1);

    tstats = TextDrawCreate(152.800018, 392.746643, "Team");
    TextDrawLetterSize(tstats, 0.293199, 1.585066);
    TextDrawAlignment(tstats, 1);
    TextDrawColor(tstats, -1);
    TextDrawSetShadow(tstats, 0);
    TextDrawSetOutline(tstats, 1);
    TextDrawBackgroundColor(tstats, 51);
    TextDrawFont(tstats, 2);
    TextDrawSetProportional(tstats, 1);


On player spawn
	new str1[100];
	format(str1, sizeof(str1),"~y~SCORE: ~w~%d",GetPlayerScore(playerid));
	TextDrawSetString(sstats, str1);
	TextDrawShowForPlayer(playerid, sstats);
	new str8[100];
	format(str8, sizeof(str8),"~y~KILLS: ~w~%d",PlayerInfo[playerid][Kills]);
	TextDrawSetString(kstats, str8);
	TextDrawShowForPlayer(playerid, kstats);
	new str4[100];
	format(str4, sizeof(str4),"~y~DEATHS: ~w~%d",PlayerInfo[playerid][Deaths]);
	TextDrawSetString(dstats, str4);
	TextDrawShowForPlayer(playerid, dstats);
	new str5[100];
	format(str5, sizeof(str5),"~y~RANK: ~w~%s",GetRankName(playerid));
	TextDrawSetString(rstats, str5);
	TextDrawShowForPlayer(playerid, rstats);
	new str[100];
	format(str, sizeof(str),"~y~TEAM: ~w~%s",GetTeamName(playerid));
	TextDrawSetString(tstats, str);
	TextDrawShowForPlayer(playerid, tstats);



Re: Help With Textdraw - Toroi - 25.02.2017

You can have all these functions in 1 textdraw.

pawn Код:
At Top
new Text:sstats;



ongamemodinit
    sstats = TextDrawCreate(152.800018, 344.213348, "~y~SCORE:~n~KILLS:~n~DEATHS:~n~RANK:~n~TEAM:");
    TextDrawLetterSize(sstats, 0.244399, 1.749332);
    TextDrawAlignment(sstats, 1);
    TextDrawColor(sstats, -1);
    TextDrawSetShadow(sstats, 0);
    TextDrawSetOutline(sstats, 1);
    TextDrawBackgroundColor(sstats, 51);
    TextDrawFont(sstats, 2);
    TextDrawSetProportional(sstats, 1);


On player spawn
    new str1[128];
    format(str1, sizeof(str1),"~y~SCORE: ~w~%d~n~~y~KILLS: ~w~%d~n~~y~DEATHS: ~w~%d~n~~y~RANK: ~w~%s~n~~y~TEAM: ~w~%s",GetPlayerScore(playerid),PlayerInfo[playerid][Kills],PlayerInfo[playerid][Deaths],GetRankName(playerid),GetTeamName(playerid));
    TextDrawSetString(sstats, str1);
    TextDrawShowForPlayer(playerid, sstats);
That's what I did when I faced a similar problem.