[Ajuda] Float vida - 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] Float vida (
/showthread.php?tid=389650)
Float vida -
Maklister - 02.11.2012
Float
Qual format uso para formatar a vida ?
Pois se eu colocar %f fica 100.0000000
se eu colocar %d %i fica 42463526186
Queria que ficasse somente numeros inteiros comparado a vida,
100
90
80
50
30
10
1
PHP код:
new string[60], Float:Vida;
GetPlayerHealth(x, Vida);
format(string, sizeof(string), "{FFFFA8}Vida {FF2F2F}%i", Vida);
SetPlayerChatBubble(x, string, -1, 30.0, 999999);
Re: Float vida -
DrTHE - 02.11.2012
#Edit:
%
0.2f pode alterar esse valor no meio para seu gosto.
ou:
Floatround
Re: Float vida -
Maklister - 02.11.2012
Quote:
Originally Posted by DrTHE
#Edit:
% 0.2f pode alterar esse valor no meio para seu gosto.
ou:
Floatround
|
Obrigado ai lek =)
Re: Float vida -
zSuYaNw - 03.11.2012
Quote:
Originally Posted by Murilo_sousa
Obrigado ai lek =)
|
Para sair inteiro use FloatRound:
pawn Код:
printf("%d", floatround(16, floatround_round));
Saida: "16".