flot : text
#1

pawn Код:
GetPlayerHealth(killerid,killhealth);
                    GetPlayerArmour(killerid,killarmor);
                    new out[256];
                    format(out,256,"%s Slaughtered %s | Health - %f , Armor - %f",killername,playername,killhealth,killarmor);
                    TextDrawSetString(TextdrawB,out);
okay so the output i get is

A slaugtered B | Health = 100.0000000 Armour = 50.00000000000


how do i get rid of the 0000000 only 2 0 is enough
Reply
#2

Use %.1f to show only part of the float.

Код:
%.1f -> 100.0
%.2f -> 100.00
%.3f -> 100.000
I think that explains enough.
Reply
#3

Oh yes I was not aware of this thanks a lot
Reply
#4

Quote:
Originally Posted by spd_sahil
Посмотреть сообщение
Oh yes I was not aware of this thanks a lot
You are welcome!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)