Facebook
From Dzban, 5 Years ago, written in Lua.
Embed
Download Paste or View Raw
Hits: 334
  1. ciekawostki = {
  2. "Widzisz gracza który łamie regulamin? Wpisz komendę /report",
  3. "Pod klawiszem F2 znajdziesz Dashboard",
  4. "Klikając F4 wyświetli ci się panel zakupu konta premium",
  5.     }
  6.  
  7. local screenW, screenH = guiGetScreenSize()
  8. local sx, sy = guiGetScreenSize()
  9. local px, py = screenW/1440, screenH/900
  10. local okno = false
  11.  
  12. tekst1 = "Wchodzisz do"
  13.  
  14. local font = dxCreateFont("cz.ttf", 12)
  15.  
  16. local kropki = 0
  17.  
  18. function gui()
  19.         kropki = kropki + 1 > 60 and 0 or kropki + 1
  20.         if kropki == 1 then
  21.             l = "."
  22.         elseif kropki == 20 then
  23.             l = ".."
  24.         elseif kropki == 40 then
  25.             l = "..."
  26.         end
  27.         dxDrawImage(0, 0, sx, sy, ":np-pobieranie/grafiki/bg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  28.         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)
  29.         if muza then
  30.             local bit = getSoundFFTData(muza, 2048, 3)
  31.             for i,v in ipairs(bit) do
  32.                 rytm = math.round((v*320),0)>100 and 100 or math.round((v*320),0)
  33.                 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)
  34.             end
  35.         end        
  36.         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)
  37.         dxDrawRectangle(scale_x(1160), scale_y(20), scale_x(250), scale_y(60), tocolor(0, 0, 0, 100), false)
  38.         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)
  39. end
  40.  
  41. addEvent("Interiory:gui",true)
  42. addEventHandler("Interiory:gui", root, function(typ)
  43.     if typ == "wejscie" then
  44.         tekst1 = "Wchodzisz do"
  45.     elseif typ == "wyjscie" then
  46.         tekst1 = "Wychodzisz z"
  47.     end
  48.     muza = playSound("m"..math.random(1,3)..".mp3")
  49.     okno = true
  50.     ciekawostka = ciekawostki[math.random(#ciekawostki)]
  51.     addEventHandler("onClientRender", root, gui)
  52.     showChat(false)
  53.     setElementData(localPlayer, "hud", true)
  54.     setElementFrozen(localPlayer, true)
  55.     setTimer(function()
  56.         setElementFrozen(localPlayer, false)
  57.         setElementData(localPlayer, "hud", false)
  58.         showChat(true)
  59.         okno = false
  60.         removeEventHandler("onClientRender", root, gui)
  61.         stopSound(muza)
  62.     end, 5000, 1)
  63. end)
  64.  
  65. addEvent("interiors:obj", true)
  66. addEventHandler("interiors:obj", root, function(int,dim)
  67.     if dim == 0 then
  68.         for i,v in ipairs(getElementsByType("player")) do
  69.             setElementCollidableWith(source, v, true)
  70.         end
  71.     else
  72.         for i,v in ipairs(getElementsByType("player")) do
  73.             setElementCollidableWith(source, v, false)
  74.         end
  75.     end
  76. end)
  77.  
  78. addEvent("ghost:vehicle", true)
  79. addEventHandler("ghost:vehicle", root, function(vv)
  80.     for i,v in ipairs(getElementsByType("vehicle")) do
  81.         --if getElementData(v, "praca") or getElementData(v, "prawko") then
  82.             setElementCollidableWith(vv, v, false)
  83.         --end
  84.     end
  85. end)
  86.  
  87. addEvent("ghost:vehicleWITHplayer", true)
  88. addEventHandler("ghost:vehicleWITHplayer", root, function(value)
  89.     if value then
  90.         for i,v in ipairs(getElementsByType("vehicle")) do
  91.             setElementCollidableWith(source, v, false)
  92.         end
  93.     else
  94.         for i,v in ipairs(getElementsByType("vehicle")) do
  95.             setElementCollidableWith(source, v, true)
  96.         end
  97.     end
  98. end)
  99.  
  100.  
  101.  
  102. function math.round(number, decimals, method)
  103.     decimals = decimals or 0
  104.     local factor = 10 ^ decimals
  105.     if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
  106.     else return tonumber(("%."..decimals.."f"):format(number)) end
  107. end
  108.  
  109. function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  110.     dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
  111.     dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  112. end
  113.  
  114. function scale_x(value)
  115.     local result = (value / 1440) * sx
  116.  
  117.     return result
  118. end
  119.  
  120. function scale_y(value)
  121.     local result = (value / 900) * sy
  122.  
  123.     return result
  124. end

Replies to dupa rss

Title Name Language When
Re: dupa Dzban lua 5 Years ago.