Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2021-01-07, 17:00


frigy







Wiek: 20
Na forum: 2042 dni
Posty: 13
Nick w MP: frigy



Respekt: 50

Siemka, mam taki problem. Mianowicie gdy w??czam hud jak i radar z jednej paczki i wszystko dzia?a, pokazuj? si? itp, natomiast gdy wychodz? i wchodz? na serwer hud znika radar zostaje + pokazuje si? deafultowy radar. Dodam ?e w debugscriptcie ?aden b??d nie wyskakuje ;/.

SS bez hudu: https://media.discordapp.net/attachments/796771317637447742/796771873404747816/f85907cc-3a0f-4b83-a63c-626dc4576ac2.png?width=1202&height=676

SS z hudem: https://media.discordapp.net/attachments/796771317637447742/796771890835750922/4ce8348f-6880-42bc-b04c-474419b3ed02.png?width=1202&height=676

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 15:06


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

frigy,
komponenty={
  {"ammo","armour","clock","money","weapon","wanted","health"}
}

addEventHandler("onClientPlayerSpawn"root, function()
  for i=1,#komponenty[1] do
    setPlayerHudComponentVisible(komponenty[1][i],false)
  end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 16:25


frigy







Wiek: 20
Na forum: 2042 dni
Posty: 13
Nick w MP: frigy



Respekt: 50

Dzi?kuj?, lecz chyba co? zepsu?em. Deafultowy hud si? nie pojawia lecz ten co chcia?em wgra? te? si? nie pojawia po reconnectcie.
ss: https://media.discordapp.net/attachments/788806674999672843/797123680295321610/unknown.png?width=1202&height=676

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 17:02


_jvneczek







Wiek: 22
Na forum: 4325 dni
Posty: 1513
Nick w MP: _jvneczek

Piwa: 3949

Respekt: 337,5
Respekt: 337,5Respekt: 337,5Respekt: 337,5

Zdj?cie nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 17:13


frigy







Wiek: 20
Na forum: 2042 dni
Posty: 13
Nick w MP: frigy



Respekt: 50

https://imgur.com/bf9s6YJ to ju? powinno dzia?a?

[ Dodano: 2021-01-08, 17:30 ]
Kod:

local sx,sy = guiGetScreenSize();

local zoom = 1
local fh = 2048
if sx < fh then
zoom = math.min(2,fh/sx)
end

local hud = {};

hud.tick = false;
hud.health = getElementHealth(localPlayer);
hud.oldHealth = 0;
hud.money = getPlayerMoney(localPlayer);
hud.oldMoney = 0;

local textures = {};

textures['avatar'] = dxCreateTexture('images/avatar.png','argb',true,'clamp');
textures['pasek'] = dxCreateTexture('images/pasek.png','argb',true,'clamp');
textures['pasekp'] = dxCreateTexture('images/pasek2.png','argb',true,'clamp');

local font = false;

text=function(text,x,y,w,h,color,scale,alX)
return dxDrawText(text,x,y,w+x,h+y,color,1,font,alX or 'center','center',false,false,false,false,false);
end

hud.render=function()

local alpha = interpolateBetween(0,0,0,255,0,0,(getTickCount()-hud.tick)/300,'OutQuad');

local health = interpolateBetween(hud.oldHealth,0,0,hud.health,0,0,(getTickCount()-hud.healthTick)/1000,'OutQuad');

dxDrawImage(sx-550/zoom,30/zoom,150/zoom,150/zoom,textures['avatar'],0,0,0,tocolor(255,255,255,alpha));
dxDrawImage(sx-380/zoom,60/zoom,336/zoom,34/zoom,textures['pasekp'],0,0,0,tocolor(255,255,255,alpha));
dxDrawImageSection(sx-380/zoom,60/zoom,(336 * (health/100) )/zoom,34/zoom,sx-380/zoom,60/zoom,(336 * (health/100) )/zoom,34/zoom,textures['pasek'],0,0,0,tocolor(255,255,255,alpha));

local money = interpolateBetween(hud.oldMoney,0,0,hud.money,0,0,(getTickCount()-hud.moneyTick)/1500,'Linear');
local moneyReverse = interpolateBetween(math.abs((hud.oldMoney-hud.money)),0,0,0,0,0,(getTickCount()-hud.moneyTick)/1500,'Linear');

text(math.floor(money)..'$',sx-380/zoom,100/zoom,336/zoom,34/zoom,tocolor(255,255,255,alpha),3/zoom,'left');
if (getTickCount()-hud.moneyTick) <= 2000 then

local znak = hud.oldMoney > hud.money and '-' or '+';

text(znak..' '..math.floor(moneyReverse)..'$',sx-380/zoom,150/zoom,336/zoom,34/zoom,tocolor(255,255,255,alpha),3/zoom,'left');
end

end

setPlayerHudComponentVisible('all',false);

hud.init = function()

hud.tick = getTickCount();
hud.moneyTick = getTickCount();
hud.healthTick = getTickCount();
hud.health = getElementHealth(localPlayer);
hud.oldHealth = 0;
hud.money = getPlayerMoney(localPlayer);
hud.oldMoney = 0;

addEventHandler('onClientRender',root,hud.render);

end

hud.onChange = function(type,oldValue,newValue)

if type == 'money' then
hud.moneyTick = getTickCount();
hud.oldMoney = oldValue;
hud.money = newValue;
elseif type == 'health' then
hud.healthTick = getTickCount();
hud.oldHealth = oldValue;
hud.health = newValue;
end

end

addEvent('init:hud',true)
addEventHandler('init:hud',root,function()
hud.init();
font = exports['lrpg-dxGui']:dxGetFont('normal')
end)

-- oldMoneyEvent

local oldMoney = getPlayerMoney();
local oldHealth = getElementHealth(localPlayer);

function renderMoney()
newMoney = getPlayerMoney();
if ( tonumber(newMoney) ~= tonumber(oldMoney) ) then
triggerEvent("onClientMoneyChange",localPlayer,oldMoney,newMoney);
oldMoney = newMoney;
end
newHealth = getElementHealth(localPlayer);
if ( tonumber(newHealth) ~= tonumber(oldHealth) ) then
triggerEvent("onClientHealthChange",localPlayer,oldHealth,newHealth);
oldHealth = newHealth;
end
end
addEventHandler("onClientRender",root,renderMoney)

addEvent("onClientMoneyChange",true)
addEventHandler("onClientMoneyChange",root,
function (old, new)
local znak = old > new and 'Zabrano z ' or 'Dodano do ';
outputConsole('[INFO] '..znak..'portfela '..math.abs((old-new))..''..'$');
hud.onChange('money',old,new);
end)

addEvent("onClientHealthChange",true)
addEventHandler("onClientHealthChange",root,
function (old, new)
hud.onChange('health',old,new);
end)

addEventHandler('onClientResourceStart',resourceRoot,function()
if getElementData(localPlayer,'player:logged') then
hud.init();
font = exports['lrpg-dxGui']:dxGetFont('normal')
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 18:09


HEATEX







Wiek: 25
Na forum: 2250 dni
Posty: 109
Nick w MP: HEATEX

Piwa: 1336

Respekt: 50

Ostrzeżeń: 20%
w skrypcie logowania wejdz w skrypt c_zone.lua nastepnie wcisnij CTRL + F i wpisz closeZones gdy masz tam stopSound to po tym wklej to

    showPlayerHudComponent("all",false)
    showPlayerHudComponent("radar",false)
    showPlayerHudComponent("crosshair",true)
    showPlayerHudComponent("weapon",false)
    showPlayerHudComponent("health",false)
    showPlayerHudComponent("breath",false)
    showPlayerHudComponent("clock",false)
    showPlayerHudComponent("ammo",false)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 19:22


frigy







Wiek: 20
Na forum: 2042 dni
Posty: 13
Nick w MP: frigy



Respekt: 50

nadal nie dzia?a ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-08, 20:30


HEATEX







Wiek: 25
Na forum: 2250 dni
Posty: 109
Nick w MP: HEATEX

Piwa: 1336

Respekt: 50

Ostrzeżeń: 20%
pokaz kod huda

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-09, 02:12


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

HEATEX, wklei?e? dobrze ten kod co ci wstawi?em wy?ej ?

komponenty={
  {"ammo","armour","clock","money","weapon","wanted","health"}
}

addEventHandler("onClientPlayerSpawn"root, function()
  for i=1,#komponenty[1] do
    setPlayerHudComponentVisible(komponenty[1][i],false)
  end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-09, 03:28


frigy







Wiek: 20
Na forum: 2042 dni
Posty: 13
Nick w MP: frigy



Respekt: 50

chyba, lecz nie wiem ;/ zamiast tego
Kod:

setPlayerHudComponentVisible('all',false);
wkleilem to co mi wyslales ;3

[ Dodano: 2021-01-09, 13:38 ]
"HEATEX" napisał/a:

pokaz kod huda

pokaza?em wy?ej

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-09, 16:14


TheSebaPL

Mod-team






Wiek: 21
Na forum: 3098 dni
Posty: 964

Piwa: 3102

Respekt: 640,5
Respekt: 640,5Respekt: 640,5

frigy, wklej kod po twoich edycjach.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-01-09, 17:14


frigy







Wiek: 20
Na forum: 2042 dni
Posty: 13
Nick w MP: frigy



Respekt: 50

"TheSebaPL" napisał/a:

frigy, wklej kod po twoich edycjach.

Kod:

local sx,sy = guiGetScreenSize();

local zoom = 1
local fh = 2048
if sx < fh then
zoom = math.min(2,fh/sx)
end

local hud = {};

hud.tick = false;
hud.health = getElementHealth(localPlayer);
hud.oldHealth = 0;
hud.money = getPlayerMoney(localPlayer);
hud.oldMoney = 0;

local textures = {};

textures['avatar'] = dxCreateTexture('images/avatar.png','argb',true,'clamp');
textures['pasek'] = dxCreateTexture('images/pasek.png','argb',true,'clamp');
textures['pasekp'] = dxCreateTexture('images/pasek2.png','argb',true,'clamp');

local font = false;

text=function(text,x,y,w,h,color,scale,alX)
return dxDrawText(text,x,y,w+x,h+y,color,1,font,alX or 'center','center',false,false,false,false,false);
end

hud.render=function()

local alpha = interpolateBetween(0,0,0,255,0,0,(getTickCount()-hud.tick)/300,'OutQuad');

local health = interpolateBetween(hud.oldHealth,0,0,hud.health,0,0,(getTickCount()-hud.healthTick)/1000,'OutQuad');

dxDrawImage(sx-550/zoom,30/zoom,150/zoom,150/zoom,textures['avatar'],0,0,0,tocolor(255,255,255,alpha));
dxDrawImage(sx-380/zoom,60/zoom,336/zoom,34/zoom,textures['pasekp'],0,0,0,tocolor(255,255,255,alpha));
dxDrawImageSection(sx-380/zoom,60/zoom,(336 * (health/100) )/zoom,34/zoom,sx-380/zoom,60/zoom,(336 * (health/100) )/zoom,34/zoom,textures['pasek'],0,0,0,tocolor(255,255,255,alpha));

local money = interpolateBetween(hud.oldMoney,0,0,hud.money,0,0,(getTickCount()-hud.moneyTick)/1500,'Linear');
local moneyReverse = interpolateBetween(math.abs((hud.oldMoney-hud.money)),0,0,0,0,0,(getTickCount()-hud.moneyTick)/1500,'Linear');

text(math.floor(money)..'$',sx-380/zoom,100/zoom,336/zoom,34/zoom,tocolor(255,255,255,alpha),3/zoom,'left');
if (getTickCount()-hud.moneyTick) <= 2000 then

local znak = hud.oldMoney > hud.money and '-' or '+';

text(znak..' '..math.floor(moneyReverse)..'$',sx-380/zoom,150/zoom,336/zoom,34/zoom,tocolor(255,255,255,alpha),3/zoom,'left');
end

end

komponenty={
{"ammo","armour","clock","money","weapon","wanted","health"}
}

addEventHandler("onClientPlayerSpawn", root, function()
for i=1,#komponenty[1] do
setPlayerHudComponentVisible(komponenty[1][i],false)
end
end)

hud.init = function()

hud.tick = getTickCount();
hud.moneyTick = getTickCount();
hud.healthTick = getTickCount();
hud.health = getElementHealth(localPlayer);
hud.oldHealth = 0;
hud.money = getPlayerMoney(localPlayer);
hud.oldMoney = 0;

addEventHandler('onClientRender',root,hud.render);

end

hud.onChange = function(type,oldValue,newValue)

if type == 'money' then
hud.moneyTick = getTickCount();
hud.oldMoney = oldValue;
hud.money = newValue;
elseif type == 'health' then
hud.healthTick = getTickCount();
hud.oldHealth = oldValue;
hud.health = newValue;
end

end

addEvent('init:hud',true)
addEventHandler('init:hud',root,function()
hud.init();
font = exports['lrpg-dxGui']:dxGetFont('normal')
end)

-- oldMoneyEvent

local oldMoney = getPlayerMoney();
local oldHealth = getElementHealth(localPlayer);

function renderMoney()
newMoney = getPlayerMoney();
if ( tonumber(newMoney) ~= tonumber(oldMoney) ) then
triggerEvent("onClientMoneyChange",localPlayer,oldMoney,newMoney);
oldMoney = newMoney;
end
newHealth = getElementHealth(localPlayer);
if ( tonumber(newHealth) ~= tonumber(oldHealth) ) then
triggerEvent("onClientHealthChange",localPlayer,oldHealth,newHealth);
oldHealth = newHealth;
end
end
addEventHandler("onClientRender",root,renderMoney)

addEvent("onClientMoneyChange",true)
addEventHandler("onClientMoneyChange",root,
function (old, new)
local znak = old > new and 'Zabrano z ' or 'Dodano do ';
outputConsole('[INFO] '..znak..'portfela '..math.abs((old-new))..''..'$');
hud.onChange('money',old,new);
end)

addEvent("onClientHealthChange",true)
addEventHandler("onClientHealthChange",root,
function (old, new)
hud.onChange('health',old,new);
end)

addEventHandler('onClientResourceStart',resourceRoot,function()
if getElementData(localPlayer,'player:logged') then
hud.init();
font = exports['lrpg-dxGui']:dxGetFont('normal')
end
end)


[ Dodano: 2021-01-11, 12:56 ]
i jak?

Postaw piwo autorowi tego posta
 

 
Tagi: hud :: radar
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku