Wysłany: 2021-01-07, 17:00
frigy
Wiek: 20 Na forum: 2042 dni Posty: 13
Nick w MP: frigy
Wysłany: 2021-01-08, 15:06
TheSebaPL
Mod-team
Wiek: 21 Na forum: 3098 dni Posty: 964
Piwa : 3102
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 )
Wysłany: 2021-01-08, 16:25
frigy
Wiek: 20 Na forum: 2042 dni Posty: 13
Nick w MP: frigy
Wysłany: 2021-01-08, 17:02
_jvneczek
Wiek: 22 Na forum: 4325 dni Posty: 1513
Nick w MP: _jvneczek
Piwa : 3949
Wysłany: 2021-01-08, 17:13
frigy
Wiek: 20 Na forum: 2042 dni Posty: 13
Nick w MP: frigy
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)
Wysłany: 2021-01-08, 18:09
HEATEX
Wiek: 25 Na forum: 2250 dni Posty: 109
Nick w MP: HEATEX
Piwa : 1336
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 )
Wysłany: 2021-01-08, 19:22
frigy
Wiek: 20 Na forum: 2042 dni Posty: 13
Nick w MP: frigy
Wysłany: 2021-01-08, 20:30
HEATEX
Wiek: 25 Na forum: 2250 dni Posty: 109
Nick w MP: HEATEX
Piwa : 1336
Wysłany: 2021-01-09, 02:12
TheSebaPL
Mod-team
Wiek: 21 Na forum: 3098 dni Posty: 964
Piwa : 3102
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 )
Wysłany: 2021-01-09, 03:28
frigy
Wiek: 20 Na forum: 2042 dni Posty: 13
Nick w MP: frigy
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 :
pokaza?em wy?ej
Wysłany: 2021-01-09, 16:14
TheSebaPL
Mod-team
Wiek: 21 Na forum: 3098 dni Posty: 964
Piwa : 3102
frigy , wklej kod po twoich edycjach.
Wysłany: 2021-01-09, 17:14
frigy
Wiek: 20 Na forum: 2042 dni Posty: 13
Nick w MP: frigy
"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?
Tagi: hud :: radar
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: