Wysłany: 2018-08-26, 08:59
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Witam, po wgraniu nowego hudu, jak jest panel logowania to wida? ten hud i to przeszkadza, jak zrobi? aby nie by? widoczny w panelu logowania, tylko na serwerze?
Wysłany: 2018-08-26, 10:33
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Po zalogowaniu na serwer:
setElementData ( zmienna_gracza , "hud" , true )
W HUD daj warunek:
if getElementData ( localPlayer , "hud" ) then
-- hud
end
Wysłany: 2018-08-26, 10:45
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Doda?em to na samym dole hudu
if getElementData ( localPlayer , "hud" ) then
-- hud
end
i nic sie nie stalo, hud dalej jest w panelu logowania
Wysłany: 2018-08-26, 14:42
Adis.exe
LUA Developer
Wiek: 23 Na forum: 3498 dni Posty: 292
Nick w MP: Adiś.exe
Piwa : 997
Kulegg , w evencie "onClientRender" dodajesz PRZED tym jak renderujesz hud ifa z eldat?, czyli
if getElementData ( localPlayer , "hud" ) then
-- TUTAJ DO ? RODKA DAJESZ KOD W KT ? RYM RENDERUJESZ HUD
end
i w skrypcie z panelem logowania albo gdziekolwiek chcesz np. w onClientPlayerJoint dodajesz sobie setElementData(localPlayer, "hud", false) -- *hud znika* b?d? setElementData(localPlayer, "hud", true) -- *hud sie pojawia*
Podpis
KONTAKT:
GG: 60968224
Discord: Adiś.exe#3828
Użytkownik : 05.11.2016
GTAO Member : 20.02.2019
Support-Team : 25.07.2018
Support-Team : 19.01.2019
Test Mod : 08.02.2019
Wysłany: 2018-08-26, 16:20
Kulegg
Wiek: 46 Na forum: 3125 dni Posty: 283
Piwa : 20
Po zrobieniu tak w tym hudzie, zniknal on z panelu logowania ale tak?e z gry, czyli wog?le nie ma hudu.
Zrobi?em tak w hudzie:
if getElementData ( localPlayer , "hud" ) then
addEventHandler ( "onClientRender" , root , function()
dxDrawImage ( sW * 0 , sH * 0 , sW * 1 , sH * 1 , "Hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end )
[ Dodano : 2018-08-26, 16:23 ]
Ca?y skrypt hudu:
--[[
@ Resource : F - Hud
@ Author : Flov
Copyright ( c ) by @ Author 2018
]]--
---------------------------------------------------------------------------------------
local Czcionka = dxCreateFont ( "w.TTF" , 15 )
local screenW , screenH = guiGetScreenSize ()
local sx , sy = guiGetScreenSize ()
local sw , sh = guiGetScreenSize ()
local playerName = getPlayerName ( localPlayer )
local hajs = getPlayerMoney ( localPLayer )
local health = getElementHealth ( localPlayer )
local sW , sH = guiGetScreenSize ()
setElementData ( localPlayer , "hud" , true )
addEventHandler ( "onClientRender" , root , function()
dxDrawImage ( sW * 0 , sH * 0 , sW * 1 , sH * 1 , "Hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end )
---------------------------------------------------------------------------------------
addEventHandler ( "onClientRender" , getRootElement (),function()
-- "Nazwa"
dxDrawText ( "" .. playerName , ( screenW * - 0.8500 ) + 1 , ( screenH * 1.8450 ) + 1 , ( screenW * 1 ) + 1 , ( screenH * 0.0898 ) + 1 , tocolor ( 255 , 255 , 255 , 255 ), 0.9 , Czcionka , "center" , "center" , false , false , false , false , false )
-- "Hajs"
dxDrawText ( hajs .. " PLN " or "$0000000" , screenW * 0.4940 , screenH * 1.8460 , screenW * 0.9846 , screenH * 0.0898 , tocolor ( 0 , 170 , 0 , 255 ), 0.9 , Czcionka , "center" , "center" , false , false , false , false , false )
-- "Hp"
dxDrawRectangle ( screenW * 0.1625 , screenH * 0.9460 , screenW * 0.1255 , screenH * 0.0400 , tocolor ( 85 , 0 , 0 , 150 ))
dxDrawRectangle ( screenW * 0.1625 , screenH * 0.9460 , screenW * 0.1255 * getElementHealth ( localPlayer )/ 100 , screenH * 0.0400 , tocolor ( 150 , 0 , 0 , 150 )) -- 1
dxDrawText ( health .. "%" , sW * 0.212 , sH * 1.8946 , sW * 1 , sH * 0.040 , tocolor ( 255 , 255 , 255 , 255 ), 0.9 , Czcionka , "left" , "center" , false , false , false , false , false )
end )
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- "Godzina"
function godzina ()
local hours = getRealTime (). hour
local minutes = getRealTime (). minute
local seconds = getRealTime (). second
if hours < 10 then hours = "0" .. hours end
if minutes < 10 then minutes = "0" .. minutes end
if seconds < 10 then seconds = "0" .. seconds end
dxDrawText ( hours .. " : " .. minutes .. " : " .. seconds , ( screenW * 0.7860 ) + 1 , ( screenH * 1.8460 ) + 1 , ( screenW * 0.9846 ) + 1 , ( screenH * 0.0898 ) + 1 , tocolor ( 255 , 255 , 255 , 255 ), 0.9 , Czcionka , "center" , "center" , false , false , false , false , false )
end
addEventHandler ( "onClientRender" , root , godzina )
-- "Ping"
function ping ()
local screenW , screenH = guiGetScreenSize ()
local ping = getPlayerPing ( getLocalPlayer ())
dxDrawRectangle ( screenW * 0.9250 , screenH * 0.8780 , screenW * 0.800 , screenH * 0.0450 , tocolor ( 0 , 0 , 0 , 150 ))
dxDrawText ( "P i n g:" , ( screenW * 0.9250 ) + 1 , ( screenH * 1.7200 ) + 1 , ( screenW * 0.9846 ) + 1 , ( screenH * 0.0898 ) + 1 , tocolor ( 255 , 255 , 225 , 255 ), 0.9 , Czcionka , "center" , "center" , false , false , false , false , false )
dxDrawText ( ping .. " " , ( screenW * 0.9800 ) + 1 , ( screenH * 1.7200 ) + 1 , ( screenW * 0.9846 ) + 1 , ( screenH * 0.0898 ) + 1 , tocolor ( 255 , 255 , 255 , 255 ), 0.9 , Czcionka , "center" , "center" , false , false , false , false , false )
end
addEventHandler ( "onClientRender" , root , ping )
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function usun ()
setPlayerHudComponentVisible ( "ammo" , false )
setPlayerHudComponentVisible ( "armour" , false )
setPlayerHudComponentVisible ( "clock" , false )
setPlayerHudComponentVisible ( "health" , false )
setPlayerHudComponentVisible ( "breath" , false )
setPlayerHudComponentVisible ( "money" , false )
setPlayerHudComponentVisible ( "weapon" , false )
setPlayerHudComponentVisible ( "wanted" , false )
end
usun ()
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Wysłany: 2018-08-26, 17:25
NyAngel
Wiek: 22 Na forum: 3950 dni Posty: 128
Nick w MP: NyAngel
Piwa : 556
addEventHandler ( "onClientRender" , root , function()
if getElementData ( localPlayer , "hud" ) then
dxDrawImage ( sW * 0 , sH * 0 , sW * 1 , sH * 1 , "Hud.png" , 0 , 0 , 0 , tocolor ( 255 , 255 , 255 , 255 ), false )
end
end )
Tagi: hud
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: