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

Wysłany: 2020-06-25, 13:07


AmLotte.







Wiek: 21
Na forum: 2183 dni
Posty: 134
Nick w MP: AmLotte

Piwa: 443

Respekt: 50

Wie kto? mo?e czemu nie chce dzia?a? setTimer na ko?cu?

Kod:

addEventHandler("onClientRender", root, function()
local x_1, y_1 = getCenter(1920,1080)
local hajs = getPlayerMoney(localPlayer)
local ping = getPlayerPing(localPlayer)
local health = getElementHealth(localPlayer)
if getElementData(localPlayer,"notshowhud") then return end
if not getElementData(localPlayer,"player:logged") then return end
dxDrawImage(x_1, y_1, 1920/zoom, 1080/zoom, texture_background, 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(x_1, y_1, 1920/zoom, 1080/zoom, texture_s0, 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("#e4e4e4"..przecinek(hajs).." #00cc00$", sx-352/zoom, sy-1800/zoom, 1710/zoom, 925/zoom, tocolor(255, 255, 255, 255), 0.9, LOTTUS.FONCIK[2], "center", "center", false, false, true, true, false)
dxDrawText("#e4e4e4"..math.floor(health).." #e60000HP", sx-493/zoom, sy-1865/zoom, 1710/zoom, 925/zoom, tocolor(255, 255, 255, 255), 0.65, LOTTUS.FONCIK[2], "center", "center", false, false, true, true, false)
dxDrawText("#e4e4e4"..math.floor(ping).." #0066ffPING", sx-282/zoom, sy-1865/zoom, 1710/zoom, 925/zoom, tocolor(255, 255, 255, 255), 0.65, LOTTUS.FONCIK[2], "center", "center", false, false, true, true, false)
dxDrawText("#666666LVL", sx- -90/zoom, sy-1625/zoom, 1710/zoom, 925/zoom, tocolor(255, 255, 255, 255), 0.45, LOTTUS.FONCIK[2], "center", "center", false, false, true, true, false)
setTimer( function()
dxDrawImage(x_1, y_1, 1920/zoom, 1080/zoom, texture_s1, 0, 0, 0, tocolor(255, 255, 255, 255), false)
end, 1000, 1)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-25, 15:14


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

A jaki jest sens tego timera? Co chcesz nim osi?gn??? Timer w evencie onClientRender (~60 razy na sekund?) to kiepski pomys?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-06-26, 07:55


PatryKK.

Emeryt LUA






Wiek: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5


Więcej informacji znajdziesz w Wikipedii MTA:

setTimer

Przyk?ad:
addCommandHandler("cos", function(pc)
setTimer(function(plr)
outputChatBox("cos"plr)
end5*1000ILOSC_RAZYp)
end)


+ odsy?am do poradnik?w
1. https://www.gtao.pl/kurs-...ry-vt135362.htm
2. https://www.gtao.pl/lua-k...-2-vt112144.htm

Postaw piwo autorowi tego posta
 

 
Tagi: settimer
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » setTimer Odpowiedz do tematu

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