Wysłany: 2018-02-25, 15:14
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
Witam, mam oto taki kod i nie wiem gdzie da? na hp.
tzn jak zgin? by t?o by?o na mniejszej alphy czarne a jak odejmie np 20hp to do ty?u idzie mia?em taki hud ale format mia?em i zapomnia?em troch?.
roundedRectangle ( 1355 * px , 86 * py , 220 * px , 31 * py , tocolor ( 255 , 0 , 0 , 255 ), true ) -- hp
Stawiam
Wysłany: 2018-02-25, 15:41
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Szeroko?? rectangle dzielisz przez obecn? ilo?? HP i podaj?e mno?ysz przez maks. ilo?? HP - czyli 100.
Więcej szczegółów
Wystawiono 1 piw(a):Xrent
Wysłany: 2018-02-25, 17:04
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
"Kalizman" napisał/a :Szeroko?? rectangle dzielisz przez obecn? ilo?? HP i podaj?e mno?ysz przez maks. ilo?? HP - czyli 100.
roundedRectangle ( 1355 * px , 86 / 100 * hp , 220 * px , 31 * py , tocolor ( 255 , 0 , 0 , 255 ), true ) -- hp
tak nie wiem na tele ja wi?c, nie testowa?em powiedz tylko sk?d ma wzi??? element hp czyli = ?ycie gracza.
[ Dodano : 2018-02-25, 17:09 ]
dobra chyba, dzia?a ale jak zabieram hp to rectang w g?r? idzie.
[ Dodano : 2018-02-25, 17:10 ]
A ma si? w bok przesuwa? i znika? jak np 20 hp zabierze.
[ Dodano : 2018-02-25, 17:16 ]
hp = getElementHealth ( localPlayer )
local sx , sy = guiGetScreenSize () -- pobieramy rozdzielczo ?? gracza kt ? ry widzi gui
local px , py = ( sx / 1600 ),( sy / 900 ) -- dzielimy rozdzielczo ?? gracza kt ? ry widzi gui przez rozdzielczo ?? na kt ? rej by ? o robione gui .
font = dxCreateFont ( "font.ttf" , 12 ) or "defaul-bold" -- tworzy font i podmienia pod defaul - bold .
addEventHandler ( "onClientRender" , root , function()
if isPlayerMapVisible () then return end
if getElementHealth ( localPlayer ) == 100 then return end
-- chowa elementy hudu z gta .
showPlayerHudComponent ( "clock" , false )
showPlayerHudComponent ( "health" , false )
showPlayerHudComponent ( "money" , false )
showPlayerHudComponent ( "armour" , false )
showPlayerHudComponent ( "weapon" , false )
showPlayerHudComponent ( "ammo" , false )
showPlayerHudComponent ( "wanted" , false )
showPlayerHudComponent ( "breath" , false )
-- tworzy zaokr ? glenie okna ( rectangle ) --
function roundedRectangle ( x , y , w , h , color )
dxDrawRectangle ( x , y , w , h , color , false )
dxDrawRectangle ( x + 2 , y - 1 , w - 4 , 1 , color , false )
dxDrawRectangle ( x + 2 , y + h , w - 4 , 1 , color , false )
dxDrawRectangle ( x - 1 , y + 2 , 1 , h - 4 , color , false )
dxDrawRectangle ( x + w , y + 2 , 1 , h - 4 , color , false )
end
local nick = getPlayerName ( getLocalPlayer ()): gsub ( "#%x%x%x%x%x%x" , "" ) -- nick gracza .
local money = getPlayerMoney ( localPlayer ) -- $ gracza
local ping = getPlayerPing ( localPlayer ) -- ping gracza .
roundedRectangle ( 1336 * px , 55 * py , 254 * px , 82 * py , tocolor ( 0 , 0 , 0 , 150 ), false ) -- tlo
roundedRectangle ( 1336 * px , 55 * py , 254 * px , 82 * py , tocolor ( 0 , 0 , 0 , 150 ), false ) -- tlo
roundedRectangle ( 1355 * px , 86 / 100 * hp , 220 * px , 31 * py , tocolor ( 255 , 0 , 0 , 255 ), true ) -- hp
dxDrawText ( "" .. nick .. "" , 1369 * px , 53 * py , 1559 * px , 89 * py , tocolor ( 255 , 255 , 255 , 255 ), 1 , font , "center" , "top" , false , false , true , false , false ) -- nick . --
end )
Co? popr?bowa?em b??d z animacj? jest pewnie zamiast na boki da?em w g?r?.
Wysłany: 2018-02-25, 18:20
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4049 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
roundedRectangle ( 1355 * px , 86 * py , 220 * px , 31 * py * getElementHealth ( localPlayer )/ 100 , tocolor ( 255 , 0 , 0 , 255 ), true )
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2018-02-25, 18:35
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
local hp = getElementHealth ( localPlayer )
roundedRectangle ( 1355 * px , 86 * py , 220 * px * hp / 100 , 31 * py , tocolor ( 255 , 0 , 0 , 255 ), true )
Ten kod co poda? Barcioo b?dzie Ci zmienia? szeroko??,a ten m?j d?ugo??,ale nie wiem o kt?re Ci dok?adnie chodzi?o. Je?eli chodzi?o o to co poda? Barcioo to przepraszam.
Więcej szczegółów
Wystawiono 1 piw(a):Xrent
Wysłany: 2018-02-25, 19:01
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
NyAngel thx dzia?a masz
Tagi: pod :: rectanga.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: