Wysłany: 2018-11-28, 18:23
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Jak zrobi? aby w dxDrawText pokazywa?y sie tylko 2 znaki?
dxDrawText ( health .. "%" , 530 , 70 , _ , _ , _ , 2 , "pricedown" , "left" , "top" )
Wysłany: 2018-11-28, 18:53
Wilq
Wiek: 24 Na forum: 4429 dni Posty: 3410
Piwa : 739
Ja to bym zrobi? na warunkach sprawdzaj?cych ilo?? czego?, co chcemy wypisa?.
Je?li kto? ma lepszy pomys? (aktualnie ja na lepszy nie wpad?em), niech ?mia?o pisze w odpowiedzi!
if string . len ( health ) == 4 then
dxDrawText ( string . format ( "%.0f" , health / 100 ).. "%" , 530 , 70 , _ , _ , _ , 2 , "pricedown" , "left" , "top" )
elseif string . len ( health ) == 3 then
dxDrawText ( string . format ( "%.0f" , health / 10 ).. "%" , 530 , 70 , _ , _ , _ , 2 , "pricedown" , "left" , "top" )
elseif string . len ( health ) == 2 or string . len ( health ) == 1 then
dxDrawText ( health .. "%" , 530 , 70 , _ , _ , _ , 2 , "pricedown" , "left" , "top" )
elseif tonumber ( health ) == 0 then
dxDrawText ( health .. "%" , 530 , 70 , _ , _ , _ , 2 , "pricedown" , "left" , "top" )
end
Wysłany: 2018-11-28, 19:55
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
U?yj string . format ( "%d" , zycie ) gdzie zycie to zmienna lokalna getElementHealth.
Rezultat:
Kod: a nie liczba z przecinkiem.
Wysłany: 2018-11-29, 00:44
Vxen
Wiek: 27 Na forum: 4086 dni Posty: 293
Piwa : 1299
Dobra poradzi?em sobie
dxDrawText ( "" .. string . format ( "%.d" , getElementHealth ( localPlayer )).. "%" , 660 , 18 , _ , _ , tocolor ( 178 , 34 , 34 , 255 ), 2 , "default-bold" , "left" , "top" )
Dzi?kuj? wszystkim!
Tagi: jak :: zrobić :: aby :: dxdrawtext :: pokazywały :: sie :: tylko :: znaki
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: