[duvida]
#1

alguйm sabe como tirar o "0.000000" de uma float ?
por exemplo:
pawn Код:
new Float:vida = 10;
format(string, sizeof(string), "Float vida: %f", vida);
SendClientMessage(playerid, -1, string);
no caso vai aparecer 10.00000
espero que entendam o que quero dizer...
Reply
#2

pawn Код:
new Float:vida = 10;
format(string, sizeof(string), "Float vida: %.2f", vida);
SendClientMessage(playerid, -1, string);
tente assim.
Reply
#3

Obrigado.
no final, meu cуdigo iria ficar assim:
pawn Код:
new Float:vida = 10;
format(string, sizeof(string), "Float vida: %.0f", vida);//sem nenhum .000 :D
SendClientMessage(playerid, -1, string);
(te daria rep+, mas jб te dei alguma vez .-.)
Reply
#4

Nгo precisa disso
Use a funзгo floatround
pawn Код:
new Float:vida = 10;
format(string, sizeof(string), "Float vida: %f", floatround(vida));
SendClientMessage(playerid, -1, string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)