Facebook
From Dzban, 5 Years ago, written in Lua.
This paste is a reply to dupa from Dzban - go back
Embed
Viewing differences between dupa and Re: dupa
ciekawostki = {
"Widzisz         {"Widzisz gracza który łamie regulamin? Wpisz komendę /report",
"Pod 
/report"},
        {"Pod 
klawiszem F2 znajdziesz Dashboard",
"Klikając 
Dashboard"},
        {"Klikając 
F4 wyświetli ci się panel zakupu konta premium", 
    
premium"}, 
}

local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()
local px, py = screenW/1440, screenH/900
local okno = false

tekst1 = "Wchodzisz do"
 
local font = dxCreateFont("cz.ttf", 12)
 
local kropki = 0

function gui()
        kropki = kropki + 1 > 60 and 0 or kropki + 1
        if kropki == 1 then
            l = "."
        elseif kropki == 20 then
            l = ".."
        elseif kropki == 40 then
            l = "..."
        end
        dxDrawImage(0, 0, sx, sy, ":np-pobieranie/grafiki/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(scale_x(499), scale_y(25), scale_x(442), scale_y(270), ":np-pobieranie/grafiki/logo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        if muza then
            local bit = getSoundFFTData(muza, 2048, 3)
            for i,v in ipairs(bit) do
                rytm = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
                dxDrawImage(scale_x(586), scale_y(-27), scale_x(270), scale_y(270), ":np-pobieranie/grafiki/podswietlenie.png", 0, 0, 0, tocolor(26, 177, 133, rytm), false)
            end
        end        
        shadowText("CIEKAWOSTKA\n\n"..ciekawostka[1]..""), scale_x(498), scale_y(293), scale_x(941), scale_y(803), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
        dxDrawRectangle(scale_x(1160), scale_y(20), scale_x(250), scale_y(60), tocolor(0, 0, 0, 100), false)
        shadowText(tekst1.." interioru"..l, scale_x(1160), scale_y(20), scale_x(1410), scale_y(80), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
end

addEvent("Interiory:gui",true)
addEventHandler("Interiory:gui", root, function(typ)
    if typ == "wejscie" then
        tekst1 = "Wchodzisz do"
    elseif typ == "wyjscie" then
        tekst1 = "Wychodzisz z"
    end
    muza = playSound("m"..math.random(1,3)..".mp3")
    okno = true
    ciekawostka = ciekawostki[math.random(#ciekawostki)]
    addEventHandler("onClientRender", root, gui)
    showChat(false)
    setElementData(localPlayer, "hud", true)
    setElementFrozen(localPlayer, true)
    setTimer(function()
        setElementFrozen(localPlayer, false)
        setElementData(localPlayer, "hud", false)
        showChat(true)
        okno = false
        removeEventHandler("onClientRender", root, gui)
        stopSound(muza)
    end, 5000, 1)
end)
 
addEvent("interiors:obj", true)
addEventHandler("interiors:obj", root, function(int,dim)
    if dim == 0 then
        for i,v in ipairs(getElementsByType("player")) do
            setElementCollidableWith(source, v, true)
        end
    else
        for i,v in ipairs(getElementsByType("player")) do
            setElementCollidableWith(source, v, false)
        end
    end
end)
 
addEvent("ghost:vehicle", true)
addEventHandler("ghost:vehicle", root, function(vv)
    for i,v in ipairs(getElementsByType("vehicle")) do
        --if getElementData(v, "praca") or getElementData(v, "prawko") then
            setElementCollidableWith(vv, v, false)
        --end
    end
end)
 
addEvent("ghost:vehicleWITHplayer", true)
addEventHandler("ghost:vehicleWITHplayer", root, function(value)
    if value then
        for i,v in ipairs(getElementsByType("vehicle")) do
            setElementCollidableWith(source, v, false)
        end
    else
        for i,v in ipairs(getElementsByType("vehicle")) do
            setElementCollidableWith(source, v, true)
        end
    end
end)
 
 
 
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 shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
    dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
    dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
end
 
function scale_x(value)
    local result = (value / 1440) * sx
 
    return result
end
 
function scale_y(value)
    local result = (value / 900) * sy
 
    return result
end