SA-MP Forums Archive
[Ajuda] String em TextDraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] String em TextDraw (/showthread.php?tid=636253)



String em TextDraw - Dragonic - 23.06.2017

Entгo, quero mostrar a pontuaзгo em Textdraw:

Код:
new Text:score;
Код:
score = TextDrawCreate(400, 101, "pontuacao:");
TextDrawSetOutline(score,2);
TextDrawSetShadow(score,0);
TextDrawFont(score,3);
TextDrawLetterSize(score,0.40,1.90);
Код:
new pontuacao[17];
format(pontuacao, sizeof(pontuacao), "~g~Pontuacao: %d", GetPlayerScore(playerid));
TextDrawSetString(score, pontuacao);
TextDrawShowForPlayer(playerid, score);
A pontuaзгo й mostrada, mas sу dois dнgitos. Se for qualquer coisa acima de 99, mostra tipo 1500 = "15", ou 100 = "10".

Alguйm sabe como arrumar?


Re: String em TextDraw - rolex - 23.06.2017

Tenta com isso:

PHP код:
new pontuacao[17];
format(pontuacaosizeof(pontuacao), "~g~Pontuacao: %i"GetPlayerScore(playerid));
TextDrawSetString(scorepontuacao);
TextDrawShowForPlayer(playeridscore); 



Re: String em TextDraw - Dragonic - 23.06.2017

Kkkkkkkkkk. Meu, disfarзa. Logo depois de postar me passou algo pela cabeзa.

Код:
new pontuacao[17];
Eu coloquei 17 pensando no numero exato pra mostrar atй 4 casas de nъmeros, mas aparentemente o ~g~ para dar a cor tambйm conta nos dнgitos. Aumentei pra new pontuacao[19]; e resolveu.


Re: String em TextDraw - rolex - 23.06.2017

Lуgico, limitou a variбvel em 17 kk, tambйm nгo percebi olhando rapido.


Re: String em TextDraw - Dragonic - 23.06.2017

Quote:
Originally Posted by rolex
Посмотреть сообщение
Lуgico, limitou a variбvel em 17 kk, tambйm nгo percebi olhando rapido.
Eu achava que o ~g~ nгo contava, jб que nгo aparecia como dнgito.
Em todo caso TIL.