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, 11:51


Query

SyndicateMTA






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

Piwa: 5257

Respekt: 141
Respekt: 141

po w??czeniu hudu wywala mas? b??d?w. db3 :
linijka :
function glodny()
    local glod getElementDatalocalPlayer"najedzenie" )
    if glod then
          if glod == 0 then return end
            setElementDatalocalPlayer"najedzenie" )
    end
end
setTimer(glodny,"5000",0)


Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 11:52


nanKy







Wiek: 22
Na forum: 3865 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 11:54


Query

SyndicateMTA






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

Piwa: 5257

Respekt: 141
Respekt: 141

Po zrestartowaniu hudu ci?gle dedam

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 11:58


_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

darecky02, bo masz 0 % To co si? dziwisz :P

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
 

 
Wysłany: 2018-09-16, 11:59


Query

SyndicateMTA






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

Piwa: 5257

Respekt: 141
Respekt: 141

Thinks, nawet je?li nakarmie siebie do 100% to po chwili nagle do zera.

[ Dodano: 2018-09-16, 12:10 ]
I ?eby hud mi sie pojawi? musz? klikn?? f2, a jak znowu klikne to znika..

Podpis
Postaw piwo autorowi tego posta
 

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


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Sprawd?:
function glodny()
    local glod = (getElementDatalocalPlayer"najedzenie" ) or 0)
    if glod and glod 0 then
            setElementDatalocalPlayer"najedzenie",glod-1)
    end
end
setTimer(glodny,5000,0)


Postaw piwo autorowi tego posta
 

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


Query

SyndicateMTA






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

Piwa: 5257

Respekt: 141
Respekt: 141

Nie wywala b??d?w lecz nie nadaje mi paska g?odu..

Podpis
Postaw piwo autorowi tego posta
 

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


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Nie rozumiem. Jakiego paska g?odu?

Postaw piwo autorowi tego posta
 

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


Query

SyndicateMTA






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

Piwa: 5257

Respekt: 141
Respekt: 141

Po zjedzeniu nie zape?nia si? pasek najedzenia

Podpis
Postaw piwo autorowi tego posta
 

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


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Mo?e podasz kod?

Postaw piwo autorowi tego posta
 

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


Query

SyndicateMTA






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

Piwa: 5257

Respekt: 141
Respekt: 141

local sx,sy guiGetScreenSize()
local baseX 1920
local zoom 1.0
local minZoom if sx baseX then 
    zoom math.min(minZoombaseX/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_xbackground_ybackground_wbackground_h 1552/zoom10/zoom358/zoom118/zoom
local rectangle1_xrectangle1_yrectangle1_wrectangle1_h 1857/zoom20/zoom8/zoom83/zoom
local rectangle2_xrectangle2_yrectangle2_wrectangle2_h 1875/zoom20/zoom8/zoom83/zoom
local rectangle3_xrectangle3_yrectangle3_wrectangle3_h 1893/zoom20/zoom8/zoom83/zoom
local money_xmoney_ymoney_wmoney_h 1641/zoom53/zoom1748/zoom76/zoom
local rp_xrp_yrp_wrp_h 1552/zoom91/zoom1628/zoom118/zoom
local nick_xnick_ynick_wnick_h 1641/zoom20/zoom1748/zoom43/zoom
local data_xdata_ydata_wdata_h 1759/zoom21/zoom1834/zoom43/zoom
local time_xtime_ytime_wtime_h 1759/zoom54/zoom1834/zoom76/zoom

-- # system glodu # --

local glod nil

function glodny()
    local glod getElementDatalocalPlayer"najedzenie" )
    if glod then
          if glod == 0 then return end
            setElementDatalocalPlayer"najedzenie" )
    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_xbackground_ybackground_wbackground_hbackground000tocolor(255255255255), false)
    dxDrawRectangle(rectangle1_xrectangle1_yrectangle1_w83/zoom*hp/100tocolor(2036161255), false)
    dxDrawRectangle(rectangle2_xrectangle2_yrectangle2_w83/zoom*armour/100tocolor(4134255255), false)
    dxDrawRectangle(rectangle3_xrectangle3_yrectangle3_w83/zoom*stan_glodu/100tocolor(25515660255), false)
    dxDrawText("#096809$#cccccc"..money..""money_xmoney_ymoney_wmoney_htocolor(255255255255), 1f2"center""center",false,false,false,true,true)
    dxDrawText(""..rp.." rp"rp_xrp_yrp_wrp_htocolor(255255255255), 1f2"center""center",false,false,false,true,true)
    dxDrawText(nicknick_xnick_ynick_wnick_htocolor(255255255255), 1f2"center""center",false,false,false,true,true)
    dxDrawText(""..hours..":"..minutestime_xtime_ytime_wtime_htocolor(255255255255), 1f2"center""center",false,false,false,true,true)
    dxDrawText(""..day.."."..months.."."..year..""data_xdata_ydata_wdata_htocolor(255255255255), 1f2"center""center",false,false,false,true,true)
end)

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

addEventHandler("onClientResourceStart"resourceRoot,
    function()
    for kschowaj in ipairs(ukryj) do
        showPlayerHudComponent(schowajfalse)
        
    end
   


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


Podpis
Postaw piwo autorowi tego posta
 

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


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Mam pytanie - w og?le sprawdzi?e? zmodyfikowany kod, kt?ry wys?a?em Ci?
function glodny()
    local glod = (getElementDatalocalPlayer"najedzenie" ) or 0)
    if glod and glod 0 then
            setElementDatalocalPlayer"najedzenie",glod-1)
    end
end
setTimer(glodny,5000,0)


A w kodzie masz inny:
function glodny()
    local glod getElementDatalocalPlayer"najedzenie" )
    if glod then
          if glod == 0 then return end
            setElementDatalocalPlayer"najedzenie" )
    end
end
setTimer(glodny,"5000",0)


Cytat:

Po zjedzeniu nie zape?nia si? pasek najedzenia

Podaj kod, kt?rym dodajesz najedzenie do aktualnego najedzenia.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-09-16, 21:49


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

dlaczego if glod == 0 ma byc true? (if glod tutaj glod to bool a nie int) a w polaczeniu z AND nie bedzei dzialac poprawnie. albo w ifie sprawdzajcie sama date albo poprawnie ja zapiszcie

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Tagi: string
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