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

Wysłany: 2018-09-16, 14:32


Query

SyndicateMTA






Wiek: 24
Na forum: 3213 dni
Posty: 319
Nick w MP: Query

Piwa: 5238

Respekt: 141
Respekt: 141

Mam ma?y problem gdy? jak si? najadam to HP mi spada i dedam
local sx,sy = guiGetScreenSize()
local baseX = 1920
local zoom = 1.0
local minZoom = 2 
if sx < baseX then 
    zoom = math.min(minZoom, baseX/sx)
end

local glod = nil
local f = dxCreateFont("f.ttf", 14)
local f2 = dxCreateFont("f.ttf", 15)

local background = dxCreateTexture("i/hud_background.png", "argb", true, "clamp")

local background_x, background_y, background_w, background_h = 1552/zoom, 10/zoom, 358/zoom, 118/zoom
local rectangle1_x, rectangle1_y, rectangle1_w, rectangle1_h = 1857/zoom, 20/zoom, 8/zoom, 83/zoom
local rectangle2_x, rectangle2_y, rectangle2_w, rectangle2_h = 1875/zoom, 20/zoom, 8/zoom, 83/zoom
local rectangle3_x, rectangle3_y, rectangle3_w, rectangle3_h = 1893/zoom, 20/zoom, 8/zoom, 83/zoom
local money_x, money_y, money_w, money_h = 1641/zoom, 53/zoom, 1748/zoom, 76/zoom
local rp_x, rp_y, rp_w, rp_h = 1552/zoom, 91/zoom, 1628/zoom, 118/zoom
local nick_x, nick_y, nick_w, nick_h = 1641/zoom, 20/zoom, 1748/zoom, 43/zoom
local data_x, data_y, data_w, data_h = 1759/zoom, 21/zoom, 1834/zoom, 43/zoom
local time_x, time_y, time_w, time_h = 1759/zoom, 54/zoom, 1834/zoom, 76/zoom

-- # system glodu # --

local glod = nil

function glodny()
    local glod = getElementData( localPlayer, "najedzenie" )
    if glod then
          if glod == 0 then return end
            setElementData( localPlayer, "najedzenie" - 1 )
    end
end
setTimer(glodny,"5000",0)

-- # hud # --

addEventHandler("onClientRender",getRootElement(),function()
    local money = getElementData(localPlayer, "pieniadze")
    local full = 1
       local hp = getElementHealth(localPlayer)
       local armour = getPlayerArmor(localPlayer)
    local rp = getElementData(localPlayer, "punkty") or 0
    local time = getRealTime()
    local hours = time.hour
    local minutes = time.minute
    local day = time.monthday
    local months = time.month + 1
    local year = time.year + 1900
    local nick = getPlayerName(localPlayer)
    local stan_glodu = getElementData(localPlayer, "najedzenie")
    dxDrawImage(background_x, background_y, background_w, background_h, background, 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawRectangle(rectangle1_x, rectangle1_y, rectangle1_w, 83/zoom*hp/100, tocolor(203, 61, 61, 255), false)
    dxDrawRectangle(rectangle2_x, rectangle2_y, rectangle2_w, 83/zoom*armour/100, tocolor(4, 134, 255, 255), false)
    dxDrawRectangle(rectangle3_x, rectangle3_y, rectangle3_w, 83/zoom*stan_glodu/100, tocolor(255, 156, 60, 255), false)
    dxDrawText("#096809$#cccccc"..money.."", money_x, money_y, money_w, money_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(""..rp.." rp", rp_x, rp_y, rp_w, rp_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(nick, nick_x, nick_y, nick_w, nick_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(""..hours..":"..minutes, time_x, time_y, time_w, time_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(""..day.."."..months.."."..year.."", data_x, data_y, data_w, data_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
end)

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



addEventHandler("onClientResourceStop", resourceRoot, function()
    if(isElement(hud_background)) then
    destroyElement(hud_background)
    end
end)


[ Dodano: 2018-09-16, 14:37 ]
a jak si? najadam to g?od stoi w miejscu..

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 16:12


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Sprobuj:


local sx,sy = guiGetScreenSize()
local baseX = 1920
local zoom = 1.0
local minZoom = 2 
if sx < baseX then 
    zoom = math.min(minZoom, baseX/sx)
end

local glod = nil
local f = dxCreateFont("f.ttf", 14)
local f2 = dxCreateFont("f.ttf", 15)

local background = dxCreateTexture("i/hud_background.png", "argb", true, "clamp")

local background_x, background_y, background_w, background_h = 1552/zoom, 10/zoom, 358/zoom, 118/zoom
local rectangle1_x, rectangle1_y, rectangle1_w, rectangle1_h = 1857/zoom, 20/zoom, 8/zoom, 83/zoom
local rectangle2_x, rectangle2_y, rectangle2_w, rectangle2_h = 1875/zoom, 20/zoom, 8/zoom, 83/zoom
local rectangle3_x, rectangle3_y, rectangle3_w, rectangle3_h = 1893/zoom, 20/zoom, 8/zoom, 83/zoom
local money_x, money_y, money_w, money_h = 1641/zoom, 53/zoom, 1748/zoom, 76/zoom
local rp_x, rp_y, rp_w, rp_h = 1552/zoom, 91/zoom, 1628/zoom, 118/zoom
local nick_x, nick_y, nick_w, nick_h = 1641/zoom, 20/zoom, 1748/zoom, 43/zoom
local data_x, data_y, data_w, data_h = 1759/zoom, 21/zoom, 1834/zoom, 43/zoom
local time_x, time_y, time_w, time_h = 1759/zoom, 54/zoom, 1834/zoom, 76/zoom

-- # system glodu # --

local glod = nil

function glodny()
    local glod = getElementData( localPlayer, "najedzenie" ) or 0
    if glod then
          if glod == 0 then return end
            setElementData( localPlayer, "najedzenie", glod - 1 )
    end
end
setTimer(glodny,5000,0)

-- # hud # --

addEventHandler("onClientRender",getRootElement(),function()
    local money = getElementData(localPlayer, "pieniadze")
    local full = 1
       local hp = getElementHealth(localPlayer)
       local armour = getPlayerArmor(localPlayer)
    local rp = getElementData(localPlayer, "punkty") or 0
    local time = getRealTime()
    local hours = time.hour
    local minutes = time.minute
    local day = time.monthday
    local months = time.month + 1
    local year = time.year + 1900
    local nick = getPlayerName(localPlayer)
    local stan_glodu = getElementData(localPlayer, "najedzenie")
    dxDrawImage(background_x, background_y, background_w, background_h, background, 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawRectangle(rectangle1_x, rectangle1_y, rectangle1_w, 83/zoom*hp/100, tocolor(203, 61, 61, 255), false)
    dxDrawRectangle(rectangle2_x, rectangle2_y, rectangle2_w, 83/zoom*armour/100, tocolor(4, 134, 255, 255), false)
    dxDrawRectangle(rectangle3_x, rectangle3_y, rectangle3_w, 83/zoom*stan_glodu/100, tocolor(255, 156, 60, 255), false)
    dxDrawText("#096809$#cccccc"..money.."", money_x, money_y, money_w, money_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(""..rp.." rp", rp_x, rp_y, rp_w, rp_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(nick, nick_x, nick_y, nick_w, nick_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(""..hours..":"..minutes, time_x, time_y, time_w, time_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
    dxDrawText(""..day.."."..months.."."..year.."", data_x, data_y, data_w, data_h, tocolor(255, 255, 255, 255), 1, f2, "center", "center",false,false,false,true,true)
end)

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



addEventHandler("onClientResourceStop", resourceRoot, function()
    if(isElement(hud_background)) then
    destroyElement(hud_background)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 16:37


Query

SyndicateMTA






Wiek: 24
Na forum: 3213 dni
Posty: 319
Nick w MP: Query

Piwa: 5238

Respekt: 141
Respekt: 141

nadal to samo

[ Dodano: 2018-09-16, 16:40 ]
w dodatku jest ogromny spadek fps ..

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 17:19


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wy?lij kod, kt?ry zabija gracza. Tutaj go nie ma.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-24, 10:50


_jvneczek







Wiek: 22
Na forum: 4467 dni
Posty: 1509
Nick w MP: _jvneczek

Piwa: 3960

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

Mam ma?y problem gdy? jak si? najadam to HP mi spada i dedam
Coo?
a jak si? najadam to g?od stoi w miejscu..
Zdecyduj si?...
Jak mamy ci pom?c jak nie mo?esz dok?adnie opisa? swojego problemu?
Tzn ?e jak si? najadasz, to g??d stoi w miejscu czy ci hp spada i dedasz? XD
Opisz dok?adniej sw?j problem.

Podpis

Support Team: 04.10.2020 - 01.09.2020
Test Moderator: 03.05.2021 - 01.09.2021
Moderator: 01.09.2021 - 23.10.2021

Postaw piwo autorowi tego posta
 

 
Tagi: głód
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Głód, HP 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