Wysłany: 2018-07-26, 17:48
Visteros
Mapper
Wiek: 19 Na forum: 3220 dni Posty: 55
Nick w MP: Visteros
Piwa : 302
Tak jak w temacie. Robi? w?asny HUD do serwera. Zrobi?em nazw? gracza oraz ilo?? hajsu. Brakuje mi ilo?? HP oraz Kamizelki. Pomo?e kto??
Wysłany: 2018-07-26, 17:54
PatryKK.
Emeryt LUA
Wiek: 26 Na forum: 3060 dni Posty: 1060
Nick w MP: PatryKK.
Piwa : 2322
Więcej szczegółów
Wystawiono 1 piw(a):Visteros
Wysłany: 2018-07-26, 18:03
Adaskokieblasko
Wiek: 23 Na forum: 2954 dni Posty: 101
Piwa : 18
getElementHealth getPedArmor
Więcej szczegółów
Wystawiono 1 piw(a):Visteros
Wysłany: 2018-07-26, 18:07
Visteros
Mapper
Wiek: 19 Na forum: 3220 dni Posty: 55
Nick w MP: Visteros
Piwa : 302
Dzi?ki za pomoc. Zimne obu wam!
Wysłany: 2018-07-26, 18:08
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Więcej informacji znajdziesz w Wikipedii MTA:
getPedArmor
Więcej szczegółów
Wystawiono 1 piw(a):Visteros
Wysłany: 2018-07-26, 18:34
Visteros
Mapper
Wiek: 19 Na forum: 3220 dni Posty: 55
Nick w MP: Visteros
Piwa : 302
I jak mo?ecie to napiszcie kod na wy??czanie okna.
[ Dodano : 2018-07-26, 18:36 ]
I jeszcze jak zrobi? automatyczne resetowanie HUD co 1s?
Wysłany: 2018-07-26, 18:42
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
Jakie dok?adnie okna?
-- s side
setTimer (function()
restartResource ( resourceRoot )
end , 1000 , 0 )
Wysłany: 2018-07-26, 20:18
Visteros
Mapper
Wiek: 19 Na forum: 3220 dni Posty: 55
Nick w MP: Visteros
Piwa : 302
Damian2511 , mog? poda? ci kod.
local screenW , screenH = guiGetScreenSize ()
local nick = getPlayerName ( getLocalPlayer ()): gsub ( "#%x%x%x%x%x%x" , "" )
local money = getPlayerMoney ( localPlayer )
local health , armor = getElementHealth ( localPlayer ), getPedArmor ( localPlayer )
showPlayerHudComponent ( "clock" , false )
showPlayerHudComponent ( "health" , false )
showPlayerHudComponent ( "money" , false )
showPlayerHudComponent ( "armour" , false )
showPlayerHudComponent ( "weapon" , false )
showPlayerHudComponent ( "ammo" , false )
showPlayerHudComponent ( "wanted" , false )
showPlayerHudComponent ( "breath" , false )
addEventHandler ( "onClientRender" , root ,
function()
dxDrawLine (( screenW * 0.7211 ) - 1 , ( screenH * 0.0586 ) - 1 , ( screenW * 0.7211 ) - 1 , screenH * 0.3229 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine ( screenW * 0.9700 , ( screenH * 0.0586 ) - 1 , ( screenW * 0.7211 ) - 1 , ( screenH * 0.0586 ) - 1 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine (( screenW * 0.7211 ) - 1 , screenH * 0.3229 , screenW * 0.9700 , screenH * 0.3229 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine ( screenW * 0.9700 , screenH * 0.3229 , screenW * 0.9700 , ( screenH * 0.0586 ) - 1 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawRectangle ( screenW * 0.7211 , screenH * 0.0586 , screenW * 0.2489 , screenH * 0.2643 , tocolor ( 19 , 125 , 69 , 178 ), false )
dxDrawText ( "" .. nick .. "" , 1053 - 1 , 55 - 1 , 1263 - 1 , 101 - 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 + 1 , 55 - 1 , 1263 + 1 , 101 - 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 - 1 , 55 + 1 , 1263 - 1 , 101 + 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 + 1 , 55 + 1 , 1263 + 1 , 101 + 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 , 55 , 1263 , 101 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , screenW * 0.7709 , screenH * 0.0716 , screenW * 0.9246 , screenH * 0.1315 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "pricedown" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. health .. " HP" , 1003 , 116 , 1309 , 170 , tocolor ( 254 , 31 , 15 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. armor .. " Armor" , 1003 , 156 , 1309 , 196 , tocolor ( 38 , 140 , 226 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "$" .. money .. "" , 1004 , 192 , 1309 , 234 , tocolor ( 61 , 255 , 8 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
end
)
[ Dodano : 2018-07-26, 20:39 ]
Co zrobic, zeby pokazywalo poprawna ilosc HP oraz Armor bez tych liczb?
Wysłany: 2018-07-26, 22:15
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
nie u?ywaj showPlayerHudComponent to jest stara funkcja teraz si? u?ywa
co do liczb
dxDrawText ( "" .. string . format ( "%01d" , health ).. " HP" , 1003 , 116 , 1309 , 170 , tocolor ( 254 , 31 , 15 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. string . format ( "%01d" , armor ).. " Armor" , 1003 , 156 , 1309 , 196 , tocolor ( 38 , 140 , 226 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
[ Dodano : 2018-07-26, 22:17 ]
A je?li chodzi ci o zamykanie hudu to zr?b tak:
local screenW , screenH = guiGetScreenSize ()
local nick = getPlayerName ( getLocalPlayer ()): gsub ( "#%x%x%x%x%x%x" , "" )
local money = getPlayerMoney ( localPlayer )
local health , armor = getElementHealth ( localPlayer ), getPedArmor ( localPlayer )
local hud = true
bindKey ( "f4" , "down" , function()
if hud == true then
hud = false
else
hud = true
end
end )
showPlayerHudComponent ( "clock" , false )
showPlayerHudComponent ( "health" , false )
showPlayerHudComponent ( "money" , false )
showPlayerHudComponent ( "armour" , false )
showPlayerHudComponent ( "weapon" , false )
showPlayerHudComponent ( "ammo" , false )
showPlayerHudComponent ( "wanted" , false )
showPlayerHudComponent ( "breath" , false )
addEventHandler ( "onClientRender" , root ,
function()
if hud then
dxDrawLine (( screenW * 0.7211 ) - 1 , ( screenH * 0.0586 ) - 1 , ( screenW * 0.7211 ) - 1 , screenH * 0.3229 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine ( screenW * 0.9700 , ( screenH * 0.0586 ) - 1 , ( screenW * 0.7211 ) - 1 , ( screenH * 0.0586 ) - 1 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine (( screenW * 0.7211 ) - 1 , screenH * 0.3229 , screenW * 0.9700 , screenH * 0.3229 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine ( screenW * 0.9700 , screenH * 0.3229 , screenW * 0.9700 , ( screenH * 0.0586 ) - 1 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawRectangle ( screenW * 0.7211 , screenH * 0.0586 , screenW * 0.2489 , screenH * 0.2643 , tocolor ( 19 , 125 , 69 , 178 ), false )
dxDrawText ( "" .. nick .. "" , 1053 - 1 , 55 - 1 , 1263 - 1 , 101 - 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 + 1 , 55 - 1 , 1263 + 1 , 101 - 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 - 1 , 55 + 1 , 1263 - 1 , 101 + 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 + 1 , 55 + 1 , 1263 + 1 , 101 + 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 , 55 , 1263 , 101 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , screenW * 0.7709 , screenH * 0.0716 , screenW * 0.9246 , screenH * 0.1315 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "pricedown" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. string . format ( "%01d" , health ).. " HP" , 1003 , 116 , 1309 , 170 , tocolor ( 254 , 31 , 15 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. string . format ( "%01d" , armor ).. " Armor" , 1003 , 156 , 1309 , 196 , tocolor ( 38 , 140 , 226 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "$" .. money .. "" , 1004 , 192 , 1309 , 234 , tocolor ( 61 , 255 , 8 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
end
end
)
Więcej szczegółów
Wystawiono 1 piw(a):Visteros
Wysłany: 2018-07-26, 22:51
Visteros
Mapper
Wiek: 19 Na forum: 3220 dni Posty: 55
Nick w MP: Visteros
Piwa : 302
Damian2511 , Damian chodzi?o mi o gdy np. dostaniemy kamizelke to odrazu si? pojawia 100 Armor'a
Wysłany: 2018-07-26, 23:08
Xrent
-
Wiek: 21 Na forum: 3047 dni Posty: 230
Nick w MP: Pazdam
Piwa : 535
"Visteros" napisał/a :Damian2511 , Damian chodzi?o mi o gdy np. dostaniemy kamizelke to odrazu si? pojawia 100 Armor'a
local screenW , screenH = guiGetScreenSize ()
showPlayerHudComponent ( "clock" , false )
showPlayerHudComponent ( "health" , false )
showPlayerHudComponent ( "money" , false )
showPlayerHudComponent ( "armour" , false )
showPlayerHudComponent ( "weapon" , false )
showPlayerHudComponent ( "ammo" , false )
showPlayerHudComponent ( "wanted" , false )
showPlayerHudComponent ( "breath" , false )
addEventHandler ( "onClientRender" , root ,
function()
local nick = getPlayerName ( getLocalPlayer ()): gsub ( "#%x%x%x%x%x%x" , "" )
local money = getPlayerMoney ( localPlayer )
local health , armor = getElementHealth ( localPlayer ), getPedArmor ( localPlayer )
dxDrawLine (( screenW * 0.7211 ) - 1 , ( screenH * 0.0586 ) - 1 , ( screenW * 0.7211 ) - 1 , screenH * 0.3229 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine ( screenW * 0.9700 , ( screenH * 0.0586 ) - 1 , ( screenW * 0.7211 ) - 1 , ( screenH * 0.0586 ) - 1 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine (( screenW * 0.7211 ) - 1 , screenH * 0.3229 , screenW * 0.9700 , screenH * 0.3229 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawLine ( screenW * 0.9700 , screenH * 0.3229 , screenW * 0.9700 , ( screenH * 0.0586 ) - 1 , tocolor ( 0 , 0 , 0 , 255 ), 1 , false )
dxDrawRectangle ( screenW * 0.7211 , screenH * 0.0586 , screenW * 0.2489 , screenH * 0.2643 , tocolor ( 19 , 125 , 69 , 178 ), false )
dxDrawText ( "" .. nick .. "" , 1053 - 1 , 55 - 1 , 1263 - 1 , 101 - 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 + 1 , 55 - 1 , 1263 + 1 , 101 - 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 - 1 , 55 + 1 , 1263 - 1 , 101 + 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 + 1 , 55 + 1 , 1263 + 1 , 101 + 1 , tocolor ( 0 , 0 , 0 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , 1053 , 55 , 1263 , 101 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "pricedown" , "center" , "top" , true , false , true , false , false )
dxDrawText ( "" .. nick .. "" , screenW * 0.7709 , screenH * 0.0716 , screenW * 0.9246 , screenH * 0.1315 , tocolor ( 255 , 255 , 255 , 255 ), 2.00 , "pricedown" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. health .. " HP" , 1003 , 116 , 1309 , 170 , tocolor ( 254 , 31 , 15 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "" .. armor .. " Armor" , 1003 , 156 , 1309 , 196 , tocolor ( 38 , 140 , 226 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
dxDrawText ( "$" .. money .. "" , 1004 , 192 , 1309 , 234 , tocolor ( 61 , 255 , 8 , 255 ), 2.50 , "default-bold" , "center" , "top" , false , false , false , false , false )
end
)
do rendera zawsze dawaj
Więcej szczegółów
Wystawiono 1 piw(a):Visteros
Wysłany: 2018-07-27, 14:51
FrosteR
Grafik
Wiek: 25 Na forum: 4029 dni Posty: 355
Nick w MP: FrosteR
Piwa : 488
Z innymi problemami napisz w innym temacie, poniewa? nazwa tematu wci?? prezentuje pomoc z pierwszym skryptem.
Tagi: jak :: zdobyć :: ilość :: życia :: oraz :: ilość :: kamizelki :: gracza?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: