Advertisement
Guest User

123

a guest
May 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. local sx, sy = guiGetScreenSize()
  2. local font = dxCreateFont("cz.ttf", 15)
  3. local przebiera = false
  4. local aktualnySkin = 1
  5. local rodzaj = 1
  6.  
  7. local wisniackie = {0, 1, 2}
  8. local prestiz = {7, 9, 10}
  9. local lump = {11, 12, 13, 4, 3, 2, 1, 7, 6, 19, 21, 22, 23, 28, 29, 30, 37, 38, 36, 47, 53, 60, 65, 68, 69, 94, 98, 101, 180, 184, 188, 195, 211, 222, 225, 226, 223, 245, 250, 259, 297, }
  10.  
  11. local przebieralnie = {
  12. -- marker, ped, rotp, int, dim, typ(1-3), cameramatrix
  13. {207.08, -129.50, 1003.51, 199.80, -126.70, 1003.52, 131, 3, 0, 3, 198.04209899902, -128.55949401855, 1004.9876098633, 198.66702270508, -127.90451812744, 1004.5627441406},
  14. {2291.58, -1715.72, 17.67, 2286.23, -1716.86, 17.67, 270, 0, 1, 3, 2289.5336914063, -1716.9119873047, 18.923700332642, 2288.5798339844, -1716.9051513672, 18.623567581177},
  15. }
  16.  
  17.  
  18. for i, v in ipairs(przebieralnie) do
  19. marker = createMarker(v[1], v[2], v[3]-.95, "cylinder", 1, 255, 255, 255)
  20. --setElementData(marker, "pedx", v[4])
  21. --setElementData(marker, "pedy", v[5])
  22. --setElementData(marker, "pedz", v[6])
  23. setElementData(marker, "pedxyz", v[4]..","..v[5]..","..v[6])
  24. setElementData(marker, "pedr", v[7])
  25. setElementData(marker, "int", v[8])
  26. setElementData(marker, "dim", v[9])
  27. setElementData(marker, "typ", v[10])
  28. setElementData(marker, "camxyz", v[11]..","..v[12]..","..v[13]..","..v[14]..","..v[15]..","..v[16]) -- dodać
  29. setElementInterior(marker, v[8])
  30. setElementDimension(marker, v[9])
  31. addEventHandler("onClientMarkerHit", marker, function(gracz)
  32. if gracz ~= localPlayer then return end
  33. local kordy = split(getElementData(source, "pedxyz"), ",")
  34. local cam = split(getElementData(source, "camxyz"), ",")
  35. ped = createPed(0, kordy[1], kordy[2], kordy[3], getElementData(source, "pedr"))
  36. setElementDimension(ped, getElementData(source, "dim"))
  37. setElementInterior(ped, getElementData(source, "int"))
  38. setCameraMatrix(cam[1], cam[2], cam[3], cam[4], cam[5], cam[6])
  39. addEventHandler("onClientRender", root, gui)
  40. przebiera = true
  41. rodzaj = getElementData(source, "typ")
  42. setElementFrozen(localPlayer, true)
  43. setElementData(localPlayer, "hud", true)
  44. showChat(false)
  45. triggerEvent("radar:onClientHudComponent", localPlayer, "radar", false)
  46. end)
  47. end
  48.  
  49. function gui()
  50. dxDrawText("Backspace - opuszczenie przebieralni\nStrzalka w prawo - nastepny skin\nStrzalka w lewo - wczesniejszy skin\nEnter - akceptacja wyboru", scale_x(37), scale_y(32), scale_x(529), scale_y(289), tocolor(0, 0, 0, 255), 1.00, font, "left", "top", false, false, false, false, false)
  51. dxDrawText("#1ab185Backspace#ffffff - opuszczenie przebieralni\n#1ab185Strzalka w prawo#ffffff - nastepny skin\n#1ab185Strzalka w lewo#ffffff - wczesniejszy skin\n#1ab185Enter#ffffff - akceptacja wyboru", scale_x(36), scale_y(31), scale_x(528), scale_y(288), tocolor(255, 255, 255, 255), 1.00, font, "left", "top", false, false, false, true, false)
  52. end
  53.  
  54. bindKey("enter", "down", function()
  55. if przebiera == false then return end
  56. exports["np-notyfikacje"]:noti("Zmieniono skin.")
  57. triggerServerEvent("zapiszSkin:przebieralnia", resourceRoot, localPlayer, getElementModel(ped))
  58. destroyElement(ped)
  59. aktualnySkin = 1
  60. przebiera = false
  61. setElementFrozen(localPlayer, false)
  62. setCameraTarget(localPlayer)
  63. removeEventHandler("onClientRender", root, gui)
  64. setElementData(localPlayer, "hud", false)
  65. showChat(true)
  66. triggerEvent("radar:onClientHudComponent", localPlayer, "radar", true)
  67. end)
  68.  
  69. bindKey("backspace", "down", function()
  70. if przebiera == false then return end
  71. exports["np-notyfikacje"]:noti("Opuszczono przebieralnie.")
  72. destroyElement(ped)
  73. aktualnySkin = 1
  74. przebiera = false
  75. setElementFrozen(localPlayer, false)
  76. setCameraTarget(localPlayer)
  77. removeEventHandler("onClientRender", root, gui)
  78. setElementData(localPlayer, "hud", false)
  79. showChat(true)
  80. triggerEvent("radar:onClientHudComponent", localPlayer, "radar", true)
  81. end)
  82.  
  83. bindKey("arrow_l", "both", function(k, s)
  84. if s ~= "down" then return end
  85. if przebiera == false then return end
  86. if aktualnySkin == 1 then return end
  87. aktualnySkin = aktualnySkin-1
  88. if rodzaj == 1 then
  89. setElementModel(ped, wisniackie[aktualnySkin])
  90. elseif rodzaj == 2 then
  91. setElementModel(ped, prestiz[aktualnySkin])
  92. elseif rodzaj == 3 then
  93. setElementModel(ped, lump[aktualnySkin])
  94. end
  95. end)
  96.  
  97. bindKey("arrow_r", "both", function(k, s)
  98. if s ~= "down" then return end
  99. if przebiera == false then return end
  100. if rodzaj == 1 and aktualnySkin < #wiesniackie then
  101. aktualnySkin = aktualnySkin+1
  102. setElementModel(ped, wisniackie[aktualnySkin])
  103. elseif rodzaj == 2 and aktualnySkin < #prestiz then
  104. aktualnySkin = aktualnySkin+1
  105. setElementModel(ped, prestiz[aktualnySkin])
  106. elseif rodzaj == 3 and aktualnySkin < #lump then
  107. aktualnySkin = aktualnySkin+1
  108. setElementModel(ped, lump[aktualnySkin])
  109. end
  110. end)
  111.  
  112. function scale_x(value)
  113. local result = (value / 1440) * sx
  114.  
  115. return result
  116. end
  117.  
  118. function scale_y(value)
  119. local result = (value / 900) * sy
  120.  
  121. return result
  122. end
  123.  
  124. function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  125. dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
  126. dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  127. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement