Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. --[[
  2. Autor: DylemaT929 <dylemat9292@gmail.com>
  3. Zakaz usuwania autora. Nie masz prawa u�ywa� skryptu bez mojej zgody!
  4. (c) 2017 <dylemat9292@gmail.com>. Wszelkie prawa zastrze�one
  5. ]]
  6.  
  7.  
  8. local screenW, screenH = guiGetScreenSize()
  9. local sx, sy = guiGetScreenSize()
  10. local pieniadze = 0
  11. local font = dxCreateFont(":pseudol-nametagi/f/droid-sans.ttf", 12)
  12.  
  13. function kursorek(psx,psy,pssx,pssy,abx,aby)
  14. if not isCursorShowing() then return end
  15. cx,cy=getCursorPosition()
  16. cx,cy=cx*sx,cy*sy
  17. if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
  18. return true,cx,cy
  19. else
  20. return false
  21. end
  22. end
  23.  
  24. function roundedRectangle(x, y, w, h, color)
  25. dxDrawRectangle(x, y, w, h, color, false)
  26. dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  27. dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  28. dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  29. dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
  30. end
  31.  
  32. local pasek = guiCreateEdit(0.46, 0.53, 0.18, 0.04, "", true)
  33. guiSetVisible(pasek, false)
  34.  
  35. function pokazBankomat()
  36. dxDrawImage(screenW * 0.2500, screenH * 0.2000, screenW * 0.6031, screenH * 0.6639, ":qg-bankomaty/bankomaty.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  37. dxDrawImage(screenW * 0.5050, screenH * 0.6200, screenW * 0.0938, screenH * 0.0454, ":qg-bankomaty/zamknij.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  38. dxDrawImage(screenW * 0.3900, screenH * 0.6200, screenW * 0.0938, screenH * 0.0454, ":qg-bankomaty/wyplac.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  39. dxDrawImage(screenW * 0.6200, screenH * 0.6200, screenW * 0.0938, screenH * 0.0454, ":qg-bankomaty/wplac.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  40.  
  41. dxDrawText("SALDO KONTA:\n"..pieniadze.." PLN", screenW * 0.1400, screenH * 0.4700, screenW * 0.9641, screenH * 0.4991, tocolor(255, 255, 255, 255), 1, font, "center", "center", false, false, false, false, false)
  42. end
  43.  
  44. addEventHandler("onClientClick", root, function(btn, state)
  45. if btn == "left" and state == "down" and guiGetVisible(pasek) == true then
  46. local txt = guiGetText(pasek)
  47. if kursorek(screenW * 0.6200, screenH * 0.6200, screenW * 0.0938, screenH * 0.0454) and guiGetVisible(pasek) then
  48. triggerServerEvent("bank:dodaj", localPlayer, txt)
  49. local snd=playSound("hajs.mp3")
  50. guiSetVisible(pasek, false)
  51. removeEventHandler("onClientRender", root, pokazBankomat)
  52. showCursor(false)
  53. elseif kursorek(screenW * 0.3900, screenH * 0.6200, screenW * 0.0938, screenH * 0.0454) and guiGetVisible(pasek) then
  54. triggerServerEvent("bank:oddaj", localPlayer, txt)
  55. local snd=playSound("hajs.mp3")
  56. guiSetVisible(pasek, false)
  57. removeEventHandler("onClientRender", root, pokazBankomat)
  58. showCursor(false)
  59. elseif kursorek(screenW * 0.5050, screenH * 0.6200, screenW * 0.0938, screenH * 0.0454) and guiGetVisible(pasek) then
  60. guiSetVisible(pasek, false)
  61. removeEventHandler("onClientRender", root, pokazBankomat)
  62. showCursor(false)
  63. end
  64. end
  65. end)
  66.  
  67. addEvent("stworz:bankOkno", true)
  68. addEventHandler("stworz:bankOkno", root, function()
  69. guiSetText(pasek, "")
  70. guiSetVisible(pasek, true)
  71. guiSetInputMode("no_binds_when_editing")
  72. addEventHandler("onClientRender", root, pokazBankomat)
  73. showCursor(true)
  74. end)
  75.  
  76. addEvent("wczytaj:bankOkno", true)
  77. addEventHandler("wczytaj:bankOkno", root, function(money)
  78. pieniadze = money
  79. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement