Advertisement
Guest User

Untitled

a guest
May 25th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.22 KB | None | 0 0
  1. --[[
  2. Autor: Malentas
  3. ]]
  4.  
  5. local sx, sy = guiGetScreenSize()
  6. local okno1 = false
  7. local ulepszenia = false
  8.  
  9. local pracodawca = createPed(27, 2076.60, -2045.03, 13.59, 180)
  10. setElementData(pracodawca, "name", "Pracodawca")
  11. setElementDimension(pracodawca, 0)
  12. setElementFrozen(pracodawca, true)
  13. local rozpoczecie = createMarker(2076.85, -2047.22, 13.59-.95, "cylinder", 1, 255, 255, 255)
  14. setElementData(rozpoczecie, "praca", true)
  15. setElementDimension(rozpoczecie, 0)
  16.  
  17.  
  18. addEventHandler("onClientMarkerHit", rozpoczecie, function(gracz)
  19. if gracz ~= localPlayer then return end
  20. if getPedOccupiedVehicle(localPlayer) then return end
  21. if getElementData(localPlayer, "punkty") < 95 then exports["np-notyfikacje"]:noti("Nie posiadasz 95 punktów reputacji!", "error") return end
  22. if getElementData(localPlayer, "pracuje") then
  23. if getElementData(localPlayer, "pracuje") ~= "smieciarki" then exports["np-notyfikacje"]:noti("Posiadasz inną aktywną prace!", "error") return end
  24. end
  25. addEventHandler("onClientRender", root, guistart)
  26. okno1 = true
  27. showCursor(true)
  28. triggerServerEvent("pokazTopke:smieciarki:source", localPlayer)
  29. end)
  30.  
  31. local font = dxCreateFont("cz.ttf", 10)
  32. local font2 = dxCreateFont("cz.ttf", 12)
  33.  
  34. local font = dxCreateFont("cz.ttf", 10)
  35. local font2 = dxCreateFont("cz.ttf", 12)
  36.  
  37. local pracownicy = { }
  38.  
  39. local listaulepszen = {
  40. {"Sprint", "Dzięki temu ulepszeniu możesz biegać z koszem", 300, "dolar.png"},
  41. {"Szybsze ładowanie", "Dzięki temu ulepszeniu będziesz szybciej ładował śmieci", 500, "dolar.png"},
  42. {"Zarobek +5%", "Dzięki temu ulepszeniu zarabiasz więcej o 5%", 700, "dolar.png"},
  43. {"Pojemniejsza Śmieciarka", "Dzięki temu ulepszeniu twoja smieciarka zmiesci więcej koszy", 500, "dolar.png"},
  44. }
  45.  
  46.  
  47. function guistart()
  48. dxDrawImage(scale_x(402), scale_y(251), scale_x(637), scale_y(399), ":np-gui/grafiki/tlo.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  49. if ulepszenia == false then
  50. local punkty = getElementData(localPlayer, "spunkty") or 0
  51. local zlecenia = getElementData(localPlayer, "szlecenia") or 0
  52. shadowText("Praca zbieracza smieci", scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  53. --shadowText("Wymagania:\nBRAK", scale_x(401), scale_y(295), scale_x(719), scale_y(449), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  54. shadowText("Wykonane zlecenia: "..zlecenia.."\nPunkty: "..punkty.."", scale_x(402), scale_y(510), scale_x(719), scale_y(646), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  55. shadowText("Top pracownicy:", scale_x(719), scale_y(295), scale_x(1036), scale_y(329), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  56. dxDrawImage(scale_x(415), scale_y(310), scale_x(304), scale_y(175), ":np-magazynier/grafiki/bg2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  57. shadowText("Wymagania: Kategoria C\n25 Punktów reputacji", scale_x(415), scale_y(500), scale_x(719), scale_y(548), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  58. if mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) then
  59. dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  60. else
  61. dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  62. end
  63. if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) then
  64. dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  65. else
  66. dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  67. end
  68. if getElementData(localPlayer, "pracuje") == "smieciarki" then
  69. shadowText("Zakończ prace", scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  70. else
  71. shadowText("Rozpocznij prace", scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  72. end
  73. shadowText("Ulepszenia", scale_x(888), scale_y(592), scale_x(1028), scale_y(637), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  74. dxDrawImage(scale_x(1010), scale_y(261), scale_x(16), scale_y(16), ":guieditor/images/cross.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  75. shadowText("Nickname:", scale_x(729), scale_y(329), scale_x(880), scale_y(363), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
  76. shadowText("Wykonane zlecenia:", scale_x(877), scale_y(329), scale_x(1028), scale_y(363), tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
  77.  
  78. for i, v in ipairs(pracownicy) do
  79. local dodatekY = (scale_y(37))*(i-1)
  80. local dodatekY2 = (scale_y(74))*(i-1)
  81.  
  82. dxDrawRectangle(scale_x(729), scale_y(363) + dodatekY, scale_x(299), scale_y(35), tocolor(0, 0, 0, 120), false)
  83. shadowText(v.nick, scale_x(729), scale_y(364) + dodatekY2, scale_x(877), scale_y(398), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  84. shadowText(v.liczba, scale_x(880), scale_y(364) + dodatekY2, scale_x(1028), scale_y(398), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  85. end
  86. else
  87. local punkty = getElementData(localPlayer, "spunkty") or 0
  88. shadowText("Kupno ulepszen", scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  89. dxDrawImage(scale_x(1011), scale_y(262), scale_x(16), scale_y(16), ":np-gui/grafiki/cofnij.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  90. dxDrawText("Posiadasz: "..punkty.." punktów", scale_x(402), scale_y(582), scale_x(1037), scale_y(648), tocolor(0, 255, 0, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  91. for i, v in ipairs(listaulepszen) do
  92. local dodatekY = (scale_y(72))*(i-1)
  93. local dodatekY2 = (scale_y(144))*(i-1)
  94.  
  95. dxDrawRectangle(scale_x(417), scale_y(297)+dodatekY, scale_x(610), scale_y(70), tocolor(0, 0, 0, 120), false)
  96. dxDrawImage(scale_x(432), scale_y(307)+dodatekY, scale_x(50), scale_y(50), ":np-magazynier/grafiki/"..v[4].."", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  97. shadowText(v[1], scale_x(501), scale_y(297)+dodatekY2, scale_x(874), scale_y(332), tocolor(255, 255, 255, 255), 1.00, font2, "left", "center", false, false, false, false, false)
  98. shadowText(v[2], scale_x(501), scale_y(332)+dodatekY2, scale_x(874), scale_y(367), tocolor(255, 255, 255, 255), 1.00, font, "left", "center", false, false, false, false, false)
  99. if mysz(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38)) then
  100. dxDrawImage(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38), ":np-gui/grafiki/button_on.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  101. else
  102. dxDrawImage(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38), ":np-gui/grafiki/button_off.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
  103. end
  104. shadowText("Zakup", scale_x(904), scale_y(312)+dodatekY2, scale_x(1017), scale_y(350), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  105. shadowText("Cena: "..v[3].."p", scale_x(781), scale_y(297)+dodatekY2, scale_x(894), scale_y(335), tocolor(255, 255, 255, 255), 1.00, font2, "center", "center", false, false, false, false, false)
  106. end
  107. end
  108. end
  109.  
  110. addEventHandler("onClientClick", root, function(btn, state)
  111. if btn == "left" and state == "down" then
  112. if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
  113. if getElementData(localPlayer, "pracuje") == "smieciarki" then
  114. zakonczprace()
  115. else
  116. rozpocznijprace()
  117. end
  118. elseif mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
  119. ulepszenia = true
  120. elseif mysz(scale_x(1010), scale_y(261), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == false then
  121. removeEventHandler("onClientRender", root, guistart)
  122. okno1 = false
  123. showCursor(false)
  124. elseif mysz(scale_x(1011), scale_y(262), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == true then
  125. ulepszenia = false
  126. end
  127. for i, v in ipairs(listaulepszen) do
  128. local dodatekY = (scale_y(72))*(i-1)
  129. if mysz(scale_x(904), scale_y(312)+dodatekY, scale_x(113), scale_y(38)) and okno1 == true and ulepszenia == true then
  130. local punkty = getElementData(localPlayer, "spunkty") or 0
  131. if punkty < tonumber(v[3]) then exports["np-notyfikacje"]:noti("Posiadasz za mało punktów by zakupić to ulepszenie", "error") return end
  132. if v[1] == "Szybsze ładowanie" then
  133. if getElementData(localPlayer, "smieciarki:ulepszenie2") == 1 then exports["np-notyfikacje"]:noti("Posiadasz już to ulepszenie", "error") return end
  134. setElementData(localPlayer, "smieciarki:ulepszenie2", 1)
  135. elseif v[1] == "Sprint" then
  136. if getElementData(localPlayer, "smieciarki:ulepszenie1") == 1 then exports["np-notyfikacje"]:noti("Posiadasz już to ulepszenie", "error") return end
  137. setElementData(localPlayer, "smieciarki:ulepszenie1", 1)
  138. elseif v[1] == "Zarobek +5%" then
  139. if getElementData(localPlayer, "smieciarki:ulepszenie3") == 1 then exports["np-notyfikacje"]:noti("Posiadasz już to ulepszenie", "error") return end
  140. setElementData(localPlayer, "smieciarki:ulepszenie3", 1)
  141. elseif v[1] == "Pojemniejsza Śmieciarka" then
  142. if getElementData(localPlayer, "smieciarki:ulepszenie4") == 1 then exports["np-notyfikacje"]:noti("Posiadasz już to ulepszenie", "error") return end
  143. setElementData(localPlayer, "smieciarki:ulepszenie4", 1)
  144. end
  145. exports["np-notyfikacje"]:noti("Zakupujesz ulepszenie: "..v[1])
  146. setElementData(localPlayer, "spunkty", punkty-tonumber(v[3]))
  147. end
  148. end
  149. end
  150. end)
  151.  
  152. addEvent("pokazTopke:smieciarki:client", true)
  153. addEventHandler("pokazTopke:smieciarki:client", root, function(tabelka)
  154. pracownicy = tabelka
  155. end)
  156.  
  157. --praca
  158.  
  159. local kosz = {}
  160. local kmarker = {}
  161. local kblip = {}
  162. local liczbakoszy = 5
  163. local max = 20
  164. local czas = 4000
  165.  
  166. --Jefferson
  167. local miejsce1 = {
  168. {2134.10, -1375.30, 23.98},
  169. {2190.74, -1375.72, 23.99},
  170. {2138.45, -1406.00, 23.99},
  171. {2138.42, -1411.33, 23.99},
  172. {2138.24, -1452.13, 23.98},
  173. }
  174.  
  175. --Ganton
  176. local miejsce2 = {
  177. {2498.26, -1686.70, 13.48},
  178. {2505.73, -1654.07, 13.59},
  179. {2490.30, -1647.08, 14.08},
  180. {2468.72, -1648.26, 13.47},
  181. {2471.70, -1684.67, 13.51},
  182. }
  183.  
  184. --Idlewood
  185. local miejsce3 = {
  186. {2067.43, -1733.55, 13.88},
  187. {2065.64, -1701.91, 14.15},
  188. {2072.29, -1653.71, 13.55},
  189. {2013.18, -1653.42, 13.55},
  190. {2012.33, -1629.07, 13.55},
  191. }
  192.  
  193. --Glen Park
  194. local miejsce4 = {
  195. {1937.65, -1126.89, 25.42},
  196. {1903.61, -1116.77, 25.66},
  197. {1939.73, -1062.33, 24.42},
  198. {2025.53, -1056.79, 24.69},
  199. {1858.05, -1159.61, 23.86},
  200. }
  201.  
  202. --Market
  203. local miejsce5 = {
  204. {1184.90, -1257.63, 15.18},
  205. {1185.32, -1257.91, 18.90},
  206. {1181.94, -1230.21, 18.55},
  207. {1185.18, -1230.07, 22.14},
  208. {1134.85, -1211.10, 18.55},
  209. }
  210.  
  211. --Marina
  212. local miejsce6 = {
  213. {819.46, -1495.79, 13.59},
  214. {867.32, -1509.56, 13.55},
  215. {843.90, -1481.20, 13.60},
  216. {785.13, -1460.96, 13.55},
  217. {811.44, -1553.44, 13.59},
  218. }
  219.  
  220. --Richman
  221. local miejsce7 = {
  222. {298.88, -1335.26, 53.44},
  223. {253.61, -1364.64, 53.11},
  224. {250.39, -1271.32, 73.84},
  225. {254.48, -1219.24, 75.31},
  226. {280.82, -1259.10, 73.92},
  227. }
  228.  
  229. --Las Colinas
  230. local miejsce8 = {
  231. {2528.09, -1036.69, 69.58},
  232. {2501.15, -1062.82, 70.16},
  233. {2488.55, -1013.44, 65.40},
  234. {2629.20, -1071.08, 69.62},
  235. {2556.71, -956.12, 82.73},
  236. }
  237.  
  238. function rozpocznijprace()
  239. if getElementData(localPlayer, "prawko_c") ~= 1 then exports["np-notyfikacje"]:noti("Nie posiadasz prawa jazdy kat. c", "error") return end
  240. setElementData(localPlayer, "pracuje", "smieciarki")
  241. triggerServerEvent("skin:praca", localPlayer, 260)
  242. triggerServerEvent("dajSmieciarke:smieciarki", localPlayer)
  243. removeEventHandler("onClientRender", root, guistart)
  244. okno1 = false
  245. showCursor(false)
  246. stowrzKosze()
  247. wysypisko = createMarker(2080.57, -2000.48, 12.65, "cylinder", 4.5, 0, 255, 0)
  248. bwysypisko = createBlipAttachedTo(wysypisko, 11)
  249. setElementData(localPlayer, "liczbakoszy", 0)
  250. addEventHandler("onClientMarkerHit", wysypisko, function(gracz)
  251. if gracz ~= localPlayer then return end
  252. local ile = getElementData(localPlayer, "liczbakoszy")
  253. if ile <= 1 then exports["np-notyfikacje"]:noti("Aby wyładować smieciarke musisz załadować więcej niż 1 kosz!", "error") return end
  254. local zarobek = 45*ile
  255. if getElementData(localPlayer, "premium") then
  256. zarobek = zarobek+(zarobek*0.2)
  257. end
  258. local nagroda = math.random(0,1)
  259. if getElementData(localPlayer, "premium") then
  260. nagroda = nagroda+(nagroda*2)
  261. end
  262. if getElementData(localPlayer, "smieciarki:ulepszenie3") == 1 then
  263. zarobek = zarobek+(zarobek*0.05)
  264. end
  265. setElementData(localPlayer, "pieniadze", getElementData(localPlayer, "pieniadze")+zarobek)
  266. setElementData(localPlayer, "punkty", getElementData(localPlayer, "punkty")+nagroda)
  267. exports["np-notyfikacje"]:noti("Wyładowałeś smieciarke zarabiasz: "..zarobek.." PLN")
  268. setElementData(localPlayer, "liczbakoszy", 0)
  269. setElementData(getPedOccupiedVehicle(localPlayer), "nametag", "")
  270. end)
  271. end
  272.  
  273. function stowrzKosze()
  274. local los = math.random(1, 8)
  275. if los == 1 then
  276. trasa = miejsce1
  277. elseif los == 2 then
  278. trasa = miejsce2
  279. elseif los == 3 then
  280. trasa = miejsce3
  281. elseif los == 4 then
  282. trasa = miejsce4
  283. elseif los == 5 then
  284. trasa = miejsce5
  285. elseif los == 6 then
  286. trasa = miejsce6
  287. elseif los == 7 then
  288. trasa = miejsce7
  289. elseif los == 8 then
  290. trasa = miejsce8
  291. end
  292. liczbakoszy = 5
  293. for i, v in ipairs(trasa) do
  294. kmarker[i] = createMarker(v[1], v[2], v[3], "corona", 1.2, 0,0,0,0)
  295. kosz[i] = createObject(1339, v[1], v[2], v[3]-0.35)
  296. kblip[i] = createBlipAttachedTo(kosz[i], 41)
  297. setElementData(kmarker[i], "kosz", kosz[i])
  298. setElementData(kmarker[i], "blip", kblip[i])
  299. setElementCollisionsEnabled(kosz[i], false)
  300. addEventHandler("onClientMarkerHit", kmarker[i], function(gracz)
  301. if gracz ~= localPlayer then return end
  302. if getPedOccupiedVehicle(localPlayer) then return end
  303. if getElementData(localPlayer, "kosz") then return end
  304. --destroyElement(getElementData(source, "kosz"))
  305. attachElements(getElementData(source, "kosz"), localPlayer, 0, 0.7, -0.4, 0, 0, 180)
  306. setElementData(localPlayer, "kosz", getElementData(source, "kosz"))
  307. destroyElement(getElementData(source, "blip"))
  308. destroyElement(source)
  309. if getElementData(localPlayer, "smieciarki:ulepszenie1") == 1 then
  310. toggleControl("walk", true)
  311. setControlState(localPlayer, "walk", false)
  312. else
  313. toggleControl("walk", false)
  314. setControlState(localPlayer, "walk", true)
  315. end
  316. setPedWalkingStyle(localPlayer, 66)
  317. end)
  318. end
  319. end
  320.  
  321. addEventHandler("onClientVehicleExit", root, function(gracz, seat)
  322. if gracz ~= localPlayer then return end
  323. if getElementData(localPlayer, "pracuje") == "smieciarki" then
  324. local x,y,z = getElementPosition(source)
  325. pmarker = createMarker(x,y,z, "corona", 1, 0,0,0,0)
  326. setElementData(pmarker, "pojazd", source)
  327. attachElements(pmarker, source, 0.121, -4.047, -0.641)
  328. addEventHandler("onClientMarkerHit", pmarker, function(gracz)
  329. if gracz ~= localPlayer then return end
  330. if getElementData(localPlayer, "kosz") then
  331. local ile = getElementData(localPlayer, "liczbakoszy") or 0
  332. if getElementData(localPlayer, "smieciarki:ulepszenie4") == 1 then
  333. max = 30
  334. else
  335. max = 20
  336. end
  337. if ile == max then exports["np-notyfikacje"]:noti("Twoja Śmieciarka ma pełny zbiornik. Jedź na wysypisko aby ją wyładować.") return end
  338. exports["np-notyfikacje"]:noti("Trwa wyładowywanie kosza...")
  339. setElementFrozen(localPlayer, true)
  340. if getElementData(localPlayer, "smieciarki:ulepszenie1") == 1 then
  341. czas = 2000
  342. else
  343. czas = 4000
  344. end
  345. setTimer(function()
  346. local ile = getElementData(localPlayer, "liczbakoszy") or 0
  347. setElementData(localPlayer, "liczbakoszy", ile+1)
  348. setElementFrozen(localPlayer, false)
  349. exports["np-notyfikacje"]:noti("Kosz został wyładowany")
  350. destroyElement(getElementData(localPlayer, "kosz"))
  351. local x,y,z = getElementPosition(pmarker)
  352. local rx,ry,rz = getElementRotation(getElementData(pmarker, "pojazd"))
  353. toggleControl("walk", true)
  354. setControlState(localPlayer, "walk", false)
  355. setPedWalkingStyle(localPlayer, 0)
  356. setElementData(localPlayer, "kosz", false)
  357. liczbakoszy = liczbakoszy-1
  358. local pkt = getElementData(localPlayer, "spunkty") or 0
  359. setElementData(localPlayer, "spunkty", pkt+math.random(0, 2))
  360. for i, v in ipairs(getElementsByType("vehicle")) do
  361. if getElementData(v, "kierowca:smieciarki") and getElementData(v, "kierowca:smieciarki") == getElementData(localPlayer, "dbid") then
  362. setElementData(v, "nametag", "Zapełnienie "..getElementData(localPlayer, "liczbakoszy").."/"..max)
  363. end
  364. end
  365. if liczbakoszy == 0 then
  366. stowrzKosze()
  367. triggerServerEvent("daj:szlecenia", localPlayer, localPlayer)
  368. end
  369. end, czas, 1)
  370. end
  371. end)
  372. end
  373. end)
  374.  
  375. addEventHandler("onClientVehicleEnter", root, function(gracz, seat)
  376. if gracz ~= localPlayer then return end
  377. if getElementData(localPlayer, "pracuje") == "smieciarki" then
  378. if isElement(pmarker) then
  379. destroyElement(pmarker)
  380. end
  381. end
  382. end)
  383.  
  384.  
  385. function zakonczprace()
  386. setElementData(localPlayer, "pracuje", false)
  387. triggerServerEvent("skin:praca", localPlayer, getElementData(localPlayer, "skin"))
  388. triggerServerEvent("usunSmieciarke:smieciarki", localPlayer)
  389. setElementData(localPlayer, "liczbakoszy", 0)
  390. for i, v in ipairs(kmarker) do
  391. if isElement(v) then
  392. destroyElement(v)
  393. end
  394. end
  395. for i, v in ipairs(kblip) do
  396. if isElement(v) then
  397. destroyElement(v)
  398. end
  399. end
  400. for i, v in ipairs(kosz) do
  401. if isElement(v) then
  402. destroyElement(v)
  403. end
  404. end
  405. if isElement(pmarker) then
  406. destroyElement(pmarker)
  407. end
  408. if isElement(wysypisko) then
  409. destroyElement(wysypisko)
  410. end
  411. if isElement(bwysypisko) then
  412. destroyElement(bwysypisko)
  413. end
  414. end
  415.  
  416.  
  417. --opcje
  418.  
  419. function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  420. dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
  421. dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
  422. end
  423.  
  424. function mysz(psx,psy,pssx,pssy,abx,aby)
  425. if not isCursorShowing() then return end
  426. cx,cy=getCursorPosition()
  427. cx,cy=cx*sx,cy*sy
  428. if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
  429. return true,cx,cy
  430. else
  431. return false
  432. end
  433. end
  434.  
  435. function scale_x(value)
  436. local result = (value / 1440) * sx
  437.  
  438. return result
  439. end
  440.  
  441. function scale_y(value)
  442. local result = (value / 900) * sy
  443.  
  444. return result
  445. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement