kamilVpl
Wiek: 34 Na forum: 1037 dni Posty: 23
Piwa : 26
< Pasek>
Kod: local download = {}
local self = {}
local screenW,screenH=guiGetScreenSize()
local sw=function(val)
return screenW*val/1920
end
local sh=function(val)
return screenH*val/1080
end
local fontB = dxCreateFont('f.ttf', sw(14))
local textHeader = dxCreateFont('f.ttf', sw(23))
local textLower = dxCreateFont('f.ttf', sw(18))
function math.round(number, decimals, method)
decimals = decimals or 0
local factor = 10 ^ decimals
if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
else return tonumber(("%."..decimals.."f"):format(number)) end
end
function isEventHandlerAdded(sEventName,pElementAttachedTo,func)
if type(sEventName)=='string' and isElement(pElementAttachedTo) and type(func)=='function' then local aAttachedFunctions = getEventHandlers(sEventName,pElementAttachedTo)
if type(aAttachedFunctions)=='table' and #aAttachedFunctions > 0 then for i,v in ipairs(aAttachedFunctions) do if v==func then return true end end end
end return false
end
function sprawdzCzyPobiera()
if isTransferBoxActive() == true then
if not isEventHandlerAdded("onClientRender", root, download.render) then
addEventHandler("onClientRender", root, download.render)
showChat(false)
showPlayerHudComponent("all", false)
--stopSound(sound)
self.tick = getTickCount()
self.tick2 = getTickCount()
self.tick3 = getTickCount()
--sound = playSound("muzyka.mp3")
end
else
if isEventHandlerAdded("onClientRender", root, download.render) then
removeEventHandler("onClientRender", root, download.render)
--stopSound(sound)
self.tick = nil
self.tick2 = nil
self.tick3 = nil
showChat(true)
end
end
end
setTimer(sprawdzCzyPobiera, 1000, 0)
local texture_1 = dxCreateTexture("i/obrazek_1.png", "argb", true, "clamp")
local texture_2 = dxCreateTexture("i/obrazek_2.png", "argb", true, "clamp")
local texture_3 = dxCreateTexture("i/obrazek_3.png", "argb", true, "clamp")
local texture_4 = dxCreateTexture("i/obrazek_5.png", "argb", true, "clamp")
local texture_5 = dxCreateTexture("i/obrazek_6.png", "argb", true, "clamp")
local texture_6 = dxCreateTexture("i/obrazek_7.png", "argb", true, "clamp")
local texture_7 = dxCreateTexture("i/obrazek_8.png", "argb", true, "clamp")
texture = texture_1
download.obrazki = {
{"obrazek_1.png", texture_1},
{"obrazek_2.png", texture_2},
{"obrazek_3.png", texture_3},
{"obrazek_5.png", texture_4},
{"obrazek_6.png", texture_5},
{"obrazek_7.png", texture_6},
{"obrazek_8.png", texture_7},
}
download.obrazki_poses = {
{x=264, y=157},
{x=800, y=157},
{x=800, y=157},
{x=800, y=157},
{x=800, y=157},
{x=800, y=157},
{x=800, y=157},
}
download.infos = {
{"Forum",
{"Propozycje",
}
local random_info = 1
local random = 1
local create_texture = function(value)
texture = download.obrazki[random][2]
end
local next_image = function()
if random+1 > #download.obrazki then random = 1 create_texture(1) return end
random=random+1
create_texture(random)
end
local next_info = function()
if random_info+1 > #download.infos then random_info = 1 return end
random_info=random_info+1
end
download.render=function()
local f=interpolateBetween(0, 0, 0, 255, 0, 0, (getTickCount()-self.tick)/1000, "Linear")
local x=interpolateBetween(-100, 0, 0, 0, 0, 0, (getTickCount()-self.tick)/4000, "OutQuad")
local rot=interpolateBetween(0,0,0,360,0,0, (getTickCount()-self.tick2)/1000, "InOutQuad")
local y=interpolateBetween(0,0,0,30,0,0, (getTickCount()-self.tick3)/3000, "CosineCurve")
dxDrawImage(sw(0), sh(0), screenW, screenH, "i/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
exports['ac-guiLib']:dxCreateGradient(sw(0), sh(311-2), sw(1920), sh(2), tocolor(255, 255, 255, 228), false)
exports['ac-guiLib']:dxCreateGradient(sw(0), sh(311+458), sw(1920), sh(2), tocolor(255, 255, 255, 228), false)
dxDrawRectangle(sw(0), sh(311), sw(1920), sh(458), tocolor(27, 27, 27, 228), false)
dxDrawText(download.infos[random_info][1], sw(25), sh(328), sw(943), sh(401), tocolor(255, 255, 255, 255), 1.00, textHeader, "left", "center", false, false, false, false, false)
dxDrawText(download.infos[random_info][2], sw(25), sh(417), sw(953), sh(759), tocolor(255, 255, 255, 255), 1.00, textLower, "left", "top", false, true, false, false, false)
dxDrawImage(sw(872), sh(0+y), sw(178), sh(178), ":ac-pobieranie/i/logo.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
dxDrawImage(sw(27), sh(983), sw(64), sh(64), "i/loadin_bar.png", 220+rot, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawText("Trwa pobieranie zasobów serwera.", sw(100), sh(984), sw(322), sh(1047), tocolor(255, 255, 255, 255), 1.00, fontB, "left", "center", false, true, true, false, false)
if (getTickCount()-self.tick2) >= 1200 then
self.tick2 = getTickCount()
end
local Pos_x,Pos_y = download.obrazki_poses[random].x,download.obrazki_poses[random].y
dxDrawImage(sw(Pos_x+x), sh(Pos_y+x), sw(1920), sh(1080), texture, 0, 0, 0, tocolor(255, 255, 255, f), false)
if getTickCount()-self.tick >= 4050 then
self.tick = getTickCount()
--random_new = login.obrazki[math.random(1,#login.obrazki)][1]
next_image()
next_info()
end
end