Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.80 KB | None | 0 0
  1. ESX = nil
  2. local PlayerData = {}
  3. --test
  4. local holdingBag = false
  5. local usingBag = false
  6. local bagModel = "prop_ld_suitcase_01"
  7. local baganimDict = "missheistdocksprep1hold_cellphone"
  8. local baganimName = "hold_cellphone"
  9. local bag_net = nil
  10. local UI = {
  11. x = 0.000 ,
  12. y = -0.001 ,
  13. }
  14.  
  15. local Keys = {
  16. ["ESC"] = 322, ["BACKSPACE"] = 177, ["E"] = 38, ["ENTER"] = 18, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173
  17. }
  18.  
  19. local blip2 = nil
  20. local blip3 = nil
  21. local blip4 = nil
  22. local blip5 = nil
  23. local blip6 = nil
  24. local blip7 = nil
  25. local blip8 = nil
  26.  
  27. --test
  28.  
  29. local pracuje = false
  30.  
  31. --- WĄTKI ---
  32.  
  33. --Citizen.CreateThread(function()
  34. --
  35. -- Citizen.Trace('whitebreak_badacz: Start')
  36. --
  37. -- while ESX == nil do
  38. -- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  39. -- Citizen.Wait(0)
  40. -- end
  41. --
  42. --
  43. -- PlayerData = ESX.GetPlayerData()
  44. --
  45. -- while ESX.GetPlayerData().job == nil and ESX.GetPlayerData().job.name == 'badacz' do
  46. -- Citizen.Wait(500)
  47. -- end
  48. --
  49. --
  50. --end)
  51.  
  52. Citizen.CreateThread(function()
  53. while ESX == nil do
  54. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  55. Citizen.Wait(0)
  56. end
  57.  
  58. Citizen.Wait(5000)
  59. PlayerData = ESX.GetPlayerData()
  60. end)
  61.  
  62. Citizen.CreateThread(function()
  63.  
  64. RequestModel(GetHashKey("s_m_m_scientist_01"))
  65. while not HasModelLoaded(GetHashKey("s_m_m_scientist_01")) do
  66. Wait(1)
  67. end
  68.  
  69. local Ped = CreatePed(1, 1092080539, 3541.3, 3667.96, 28.12 - 0.99, 136.05, false, false)
  70. FreezeEntityPosition(Ped, true)
  71. SetEntityInvincible(Ped, true)
  72. SetBlockingOfNonTemporaryEvents(Ped, true)
  73. Wait(200)
  74. TaskStartScenarioInPlace(Ped, 'CODE_HUMAN_MEDIC_TIME_OF_DEATH')
  75. end)
  76.  
  77. Citizen.CreateThread(function()
  78. while true do
  79. Citizen.Wait(1)
  80.  
  81. local player = GetPlayerPed(-1)
  82. if GetDistanceBetweenCoords(GetEntityCoords(player, true), Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z, true) < 10 then
  83. DrawMarker(0, Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z + 1.25, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.4, 0.4, 0.4, 33, 196, 185, 100, false, true, 2, false, false, false, false)
  84. end
  85.  
  86. if GetDistanceBetweenCoords(GetEntityCoords(player, true), Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z, true) < 1.0 then
  87. --Tekst3d(Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z, ('~w~Kliknij [~g~E~w~] aby otworzyć przebieralnie'), 0.1)
  88. HelpText("Naciśnij ~INPUT_CONTEXT~, aby otworzyć przebieralnię")
  89. if IsControlJustReleased(1, 51) then
  90. MenuPrzebieralnia()
  91. end
  92. end
  93.  
  94. end
  95.  
  96. end)
  97.  
  98. local blips = {
  99. {title="Humane Labs", colour=26, id=51, x = 3559.958, y = 3674.409, z = 28.12189},
  100. }
  101.  
  102. Citizen.CreateThread(function()
  103.  
  104. for _, info in pairs(blips) do
  105. info.blip = AddBlipForCoord(info.x, info.y, info.z)
  106. SetBlipSprite(info.blip, info.id)
  107. SetBlipDisplay(info.blip, 4)
  108. SetBlipScale(info.blip, 0.9)
  109. SetBlipColour(info.blip, info.colour)
  110. SetBlipAsShortRange(info.blip, true)
  111. BeginTextCommandSetBlipName("STRING")
  112. AddTextComponentString(info.title)
  113. EndTextCommandSetBlipName(info.blip)
  114. end
  115. end)
  116.  
  117. Citizen.CreateThread(function()
  118. while true do
  119. Wait(5)
  120. local coords = GetEntityCoords(PlayerPedId())
  121. if (GetDistanceBetweenCoords(coords, 3599.23, 3669.48, 33.87, true) < 40) and pracuje == true then
  122. DrawMarker(0, 3599.23, 3669.48, 33.87+0.2, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 33, 196, 185, 155, 0, 0, 2, 0, 0, 0, 0)
  123. end
  124. if(GetDistanceBetweenCoords(coords, 3599.23, 3669.48, 33.87, true) < 1.0) and pracuje == true then
  125. HelpText('~g~[E] ~w~Wyciągniecie pojazdu')
  126. if IsControlJustReleased(0, Keys['E']) then
  127. if pracuje == true then
  128. local veh = "Rebel2"
  129. local x,y,z = GetEntityCoords(PlayerPedId())
  130. vehiclehash = GetHashKey(veh)
  131. RequestModel(vehiclehash)
  132. local spawned = CreateVehicle(vehiclehash, 3599.23, 3669.48, 33.87, 74.61, 1, 0)
  133. SetPedIntoVehicle(PlayerPedId(), spawned, -1)
  134. local liczba = math.random(1000,9999)
  135. SetVehicleNumberPlateText(spawned,'LABS'.. liczba)
  136. ESX.ShowNotification('~g~Pobrano ~w~auto z garażu')
  137. else
  138. ESX.ShowNotification('~r~Musisz się przebrać!')
  139. end
  140. end
  141. end
  142. end
  143. end)
  144.  
  145. Citizen.CreateThread(function()
  146. while true do
  147. Wait(5)
  148. local coords = GetEntityCoords(PlayerPedId())
  149. if (GetDistanceBetweenCoords(coords, 3598.72, 3660.74, 33.87, true) < 40) and pracuje == true then
  150. DrawMarker(0, 3598.72, 3660.74, 33.87+0.2, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 33, 196, 185, 155, 0, 0, 2, 0, 0, 0, 0)
  151. end
  152. if(GetDistanceBetweenCoords(coords, 3598.72, 3660.74, 33.87, true) < 1.0) and pracuje == true then
  153. HelpText('~g~[E] ~w~Schowanie pojazdu')
  154. if IsControlJustReleased(0, Keys['E']) then
  155. if pracuje == true then
  156. if IsPedInAnyVehicle(PlayerPedId(), false) then
  157. local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
  158. local hash = GetEntityModel(vehicle)
  159. if DoesEntityExist(vehicle) then
  160. if hash == GetHashKey('Rebel2') then
  161. ESX.ShowNotification("~r~Chowawnie auta do garażu...")
  162. Citizen.Wait(3000)
  163. ESX.ShowNotification('~r~Oddano auto do garażu')
  164. DeleteVehicle(vehicle)
  165. else
  166. ESX.ShowNotification('~r~Zły pojazd!')
  167. end
  168. end
  169. else
  170. ESX.ShowNotification('~r~Musisz być w pracy lub być w odpowiednim pojeździe!')
  171. end
  172. end
  173. end
  174. end
  175. end
  176. end)
  177.  
  178.  
  179.  
  180. Citizen.CreateThread(function()
  181.  
  182. local zbieranie1 = false
  183. local zbieranie2 = false
  184. local zbieranie3 = false
  185. local zbieranie4 = false
  186.  
  187. while true do
  188. Citizen.Wait(1)
  189.  
  190. local ped = PlayerPedId()
  191. local koordy = GetEntityCoords(ped)
  192.  
  193. if pracuje then
  194.  
  195. if not IsEntityDead( ped ) and zbieranie1 == false then
  196. if GetDistanceBetweenCoords(koordy, Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, true ) < 50 then
  197. DrawMarker(0, Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 33, 196, 185, 155, 0, 0, 2, 0, 0, 0, 0)
  198. if GetDistanceBetweenCoords(koordy, Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, true ) < 1.0 then
  199. HelpText("Naciśnij ~INPUT_CONTEXT~, aby zbierać próbki wody.")
  200. if IsControlJustReleased(1, 51) then
  201. Citizen.Wait(100)
  202. TriggerServerEvent("whitebreak_badacz:zbierzwode")
  203. blokada = true
  204. blokada_przycisk()
  205. Citizen.Wait(15500)
  206. zbieranie1 = true
  207. blokada = false
  208. end
  209. end
  210. end
  211. end
  212.  
  213. if not IsEntityDead( ped ) and zbieranie2 == false then
  214. if GetDistanceBetweenCoords(koordy, Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z, true ) < 50 then
  215. DrawMarker(0, Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z+0.2, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 33, 196, 185, 155, 0, 0, 2, 0, 0, 0, 0)
  216. if GetDistanceBetweenCoords(koordy, Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z, true ) < 1.0 then
  217. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki wody.")
  218. if IsControlJustReleased(1, 51) then
  219. Citizen.Wait(100)
  220. TriggerServerEvent("whitebreak_badacz:zbierzwode")
  221. blokada = true
  222. blokada_przycisk()
  223. Citizen.Wait(15500)
  224. zbieranie2 = true
  225. blokada = false
  226. end
  227. end
  228. end
  229. end
  230.  
  231. if not IsEntityDead( ped ) and zbieranie3 == false then
  232. if GetDistanceBetweenCoords(koordy, Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z, true ) < 50 then
  233. DrawMarker(0, Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z+0.4, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 33, 196, 185, 155, 0, 0, 2, 0, 0, 0, 0)
  234. if GetDistanceBetweenCoords(koordy, Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z, true ) < 1.0 then
  235. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki wody.")
  236. if IsControlJustReleased(1, 51) then
  237. Citizen.Wait(100)
  238. TriggerServerEvent("whitebreak_badacz:zbierzwode")
  239. blokada = true
  240. blokada_przycisk()
  241. Citizen.Wait(15500)
  242. zbieranie3 = true
  243. blokada = false
  244. end
  245. end
  246. end
  247. end
  248.  
  249. if not IsEntityDead( ped ) and zbieranie4 == false then
  250. if GetDistanceBetweenCoords(koordy, Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, true ) < 50 then
  251. DrawMarker(0, Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 33, 196, 185, 155, 0, 0, 2, 0, 0, 0, 0)
  252. if GetDistanceBetweenCoords(koordy, Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, true ) < 1.0 then
  253. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki wody.")
  254. if IsControlJustReleased(1, 51) then
  255. Citizen.Wait(100)
  256. TriggerServerEvent("whitebreak_badacz:zbierzwode")
  257. blokada = true
  258. blokada_przycisk()
  259. Citizen.Wait(15500)
  260. zbieranie4 = true
  261. blokada = false
  262. end
  263. end
  264. end
  265. end
  266. end
  267. end
  268. end)
  269.  
  270. Citizen.CreateThread(function()
  271. local zbieranie1 = false
  272. local zbieranie2 = false
  273. local zbieranie3 = false
  274. local zbieranie4 = false
  275. while true do
  276.  
  277. local ped = PlayerPedId()
  278. local koordy = GetEntityCoords(ped)
  279.  
  280. Citizen.Wait(0)
  281. if pracuje then
  282.  
  283. if not IsEntityDead( ped ) and zbieranie1 == false then
  284. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, true ) < 50 then
  285. DrawMarker(0, Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 5, 99, 0, 155, 0, 0, 2, 0, 0, 0, 0)
  286. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, true ) < 1.0 then
  287. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
  288. if IsControlJustReleased(1, 51) then
  289. Citizen.Wait(100)
  290. TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
  291. blokada = true
  292. blokada_przycisk()
  293. Citizen.Wait(15500)
  294. zbieranie1 = true
  295. blokada = false
  296. end
  297. end
  298. end
  299. end
  300.  
  301. if not IsEntityDead(ped) and zbieranie2 == false then
  302. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, true) < 50 then
  303. DrawMarker(0, Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 5, 99, 0, 155, 0, 0, 2, 0, 0, 0, 0)
  304. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, true) < 1.0 then
  305. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
  306. if IsControlJustReleased(1, 51) then
  307. Citizen.Wait(100)
  308. TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
  309. blokada = true
  310. blokada_przycisk()
  311. Citizen.Wait(15500)
  312. zbieranie2 = true
  313. blokada = false
  314. end
  315. end
  316. end
  317. end
  318.  
  319. if not IsEntityDead(ped) and zbieranie3 == false then
  320. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, true) < 50 then
  321. DrawMarker(0, Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 5, 99, 0, 155, 0, 0, 2, 0, 0, 0, 0)
  322. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, true) < 1.0 then
  323. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
  324. if IsControlJustReleased(1, 51) then
  325. Citizen.Wait(100)
  326. TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
  327. blokada = true
  328. blokada_przycisk()
  329. Citizen.Wait(15500)
  330. zbieranie3 = true
  331. blokada = false
  332. end
  333. end
  334. end
  335. end
  336.  
  337. if not IsEntityDead(ped) and zbieranie4 == false then
  338. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, true) < 50 then
  339. DrawMarker(0, Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, 0, 0, 0, 0, 0, 0, 1.0, 1.0, 1.0, 5, 99, 0, 155, 0, 0, 2, 0, 0, 0, 0)
  340. if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, true) < 1.0 then
  341. HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
  342. if IsControlJustReleased(1, 51) then
  343. Citizen.Wait(100)
  344. TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
  345. blokada = true
  346. blokada_przycisk()
  347. Citizen.Wait(15500)
  348. zbieranie4 = true
  349. blokada = false
  350. end
  351. end
  352. end
  353. end
  354. end
  355. end
  356. end)
  357.  
  358. Citizen.CreateThread(function()
  359. while true do
  360. Citizen.Wait(0)
  361. local ped = GetPlayerPed(-1)
  362. local koordy = GetEntityCoords(ped, true)
  363. if not IsEntityDead(ped) then
  364. if GetDistanceBetweenCoords(koordy, Config.analiza.x, Config.analiza.y, Config.analiza.z, true) < 15 and pracuje == true then
  365. DrawMarker(0, Config.analiza.x, Config.analiza.y, Config.analiza.z + 1.25, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.4, 0.4, 0.4, 33, 196, 185, 100, false, true, 2, false, false, false, false)
  366. if GetDistanceBetweenCoords(koordy, Config.analiza.x, Config.analiza.y, Config.analiza.z, true) < 1.0 and pracuje == true then
  367. HelpText("Naciśnij ~INPUT_CONTEXT~ aby poddać próbki ~b~analizie")
  368. if IsControlJustReleased(1, 51) then
  369. Citizen.Wait(200)
  370. TriggerServerEvent('whitebreak_badacz:analiza')
  371. blokada = true
  372. blokada_przycisk()
  373. Citizen.Wait(15500)
  374. blokada = false
  375. end
  376. end
  377. end
  378. end
  379. end
  380.  
  381. end)
  382.  
  383. Citizen.CreateThread(function()
  384. while true do
  385. Citizen.Wait(0)
  386. local ped = GetPlayerPed(-1)
  387. local koordy = GetEntityCoords(ped, true)
  388.  
  389. if not IsEntityDead(ped) then
  390. if GetDistanceBetweenCoords(koordy, Config.raport.x, Config.raport.y, Config.raport.z, true) < 10 and pracuje == true then
  391. DrawMarker(0, Config.raport.x, Config.raport.y, Config.raport.z + 1.25, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.4, 0.4, 0.4, 33, 196, 185, 100, false, true, 2, false, false, false, false)
  392. if GetDistanceBetweenCoords(koordy, Config.raport.x, Config.raport.y, Config.raport.z, true) < 1.0 then
  393. HelpText("Naciśnij ~INPUT_CONTEXT~, aby wydrukować raport dla szefa")
  394. if IsControlJustReleased(1, 51) then
  395. Citizen.Wait(200)
  396. TriggerServerEvent('whitebreak_badacz:raport')
  397. blokada = true
  398. blokada_przycisk()
  399. Citizen.Wait(15500)
  400. blokada = false
  401. end
  402. end
  403. end
  404. end
  405.  
  406. end
  407.  
  408. end)
  409.  
  410. Citizen.CreateThread(function()
  411. while true do
  412. Citizen.Wait(0)
  413. local ped = GetPlayerPed(-1)
  414. local koordy = GetEntityCoords(ped, true)
  415.  
  416. if not IsEntityDead(ped) then
  417. if GetDistanceBetweenCoords(koordy, Config.podajraport.x, Config.podajraport.y, Config.podajraport.z, true) < 10 and pracuje == true then
  418. DrawMarker(0, Config.podajraport.x, Config.podajraport.y, Config.podajraport.z + 1.25, 0.0, 0.0, 0.0, 0, 0.0, 0.0, 0.4, 0.4, 0.4, 33, 196, 185, 100, false, true, 2, false, false, false, false)
  419. if GetDistanceBetweenCoords(koordy, Config.podajraport.x, Config.podajraport.y, Config.podajraport.z, true) < 1.0 then
  420. HelpText("Naciśnij ~INPUT_CONTEXT~, aby podać raport szefowi")
  421. if IsControlJustReleased(1, 51) then
  422. Citizen.Wait(200)
  423. TriggerServerEvent('whitebreak_badacz:podajraport')
  424. blokada = true
  425. blokada_przycisk()
  426. Citizen.Wait(15500)
  427. blokada = false
  428.  
  429. end
  430. end
  431. end
  432. end
  433.  
  434. end
  435.  
  436. end)
  437.  
  438. --- EVENTY ---
  439. RegisterNetEvent('esx:playerLoaded')
  440. AddEventHandler('esx:playerLoaded', function(xPlayer)
  441. PlayerData = xPlayer
  442. end)
  443.  
  444. RegisterNetEvent('esx:setJob')
  445. AddEventHandler('esx:setJob', function(job)
  446. PlayerData.job = job
  447. end)
  448.  
  449. RegisterNetEvent('whitebreak_badacz:zbieranie')
  450. AddEventHandler('whitebreak_badacz:zbieranie', function()
  451. Zbieranie()
  452. end)
  453.  
  454. RegisterNetEvent('whitebreak_badacz:analiza')
  455. AddEventHandler('whitebreak_badacz:analiza', function()
  456. Analiza()
  457. end)
  458.  
  459. RegisterNetEvent('whitebreak_badacz:zaduzo')
  460. AddEventHandler('whitebreak_badacz:zaduzo', function()
  461. HelpText("Posiadasz maksymalną ilość próbek w swoim ekwipunku!")
  462.  
  463. end)
  464.  
  465. RegisterNetEvent('whitebreak_badacz:maanalize')
  466. AddEventHandler('whitebreak_badacz:maanalize', function()
  467. HelpText("Posiadasz już analizę na pendrive!")
  468.  
  469. end)
  470.  
  471. RegisterNetEvent('whitebreak_badacz:maraport')
  472. AddEventHandler('whitebreak_badacz:maraport', function()
  473. HelpText("Masz już jeden raport przy sobie!")
  474. end)
  475.  
  476. RegisterNetEvent('whitebreak_badacz:niemaanalizy')
  477. AddEventHandler('whitebreak_badacz:niemaanalizy', function()
  478. HelpText("Nie masz pendrive z analizą!")
  479. end)
  480.  
  481. RegisterNetEvent('whitebreak_badacz:niemaraportu')
  482. AddEventHandler('whitebreak_badacz:niemaraportu', function()
  483. HelpText("Nie masz raportu!")
  484. end)
  485.  
  486. RegisterNetEvent('whitebreak_badacz:raport')
  487. AddEventHandler('whitebreak_badacz:raport', function()
  488. Raport()
  489. end)
  490.  
  491. RegisterNetEvent('whitebreak_badacz:podajraport')
  492. AddEventHandler('whitebreak_badacz:podajraport', function()
  493. PodajRaport()
  494. end)
  495.  
  496. RegisterNetEvent('whitebreak_badacz:niemaprobek')
  497. AddEventHandler('whitebreak_badacz:niemaprobek', function()
  498. HelpText("Nie masz próbek do analizy")
  499. end)
  500.  
  501. RegisterNetEvent('whitebreak_badacz:timer')
  502. AddEventHandler('whitebreak_badacz:timer', function()
  503. local timer = 0
  504. local ped = PlayerPedId()
  505.  
  506. Citizen.CreateThread(function()
  507. while timer > -1 do
  508. Citizen.Wait(140)
  509.  
  510. if timer > -1 then
  511. timer = timer + 1
  512. end
  513. if timer == 100 then
  514. break
  515. end
  516. end
  517. end)
  518.  
  519. Citizen.CreateThread(function()
  520. while true do
  521.  
  522. Citizen.Wait(0)
  523. if GetDistanceBetweenCoords( Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, GetEntityCoords((ped))) < 3.0 then
  524. Tekst3d(Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  525. end
  526. if timer == 100 then
  527. break
  528. end
  529. if GetDistanceBetweenCoords( Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z, GetEntityCoords((ped))) < 3.0 then
  530. Tekst3d(Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  531. end
  532. if timer == 100 then
  533. break
  534. end
  535. if GetDistanceBetweenCoords( Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z, GetEntityCoords((ped))) < 3.0 then
  536. Tekst3d(Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  537. end
  538. if timer == 100 then
  539. break
  540. end
  541. if GetDistanceBetweenCoords( Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, GetEntityCoords((ped))) < 3.0 then
  542. Tekst3d(Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  543. end
  544. if timer == 100 then
  545. break
  546. end
  547. if GetDistanceBetweenCoords( Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, GetEntityCoords((ped))) < 3.0 then
  548. Tekst3d( Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  549. end
  550. if timer == 100 then
  551. break
  552. end
  553. if GetDistanceBetweenCoords( Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, GetEntityCoords((ped))) < 3.0 then
  554. Tekst3d( Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  555. end
  556. if timer == 100 then
  557. break
  558. end
  559. if GetDistanceBetweenCoords( Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, GetEntityCoords((ped))) < 3.0 then
  560. Tekst3d( Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  561. end
  562. if timer == 100 then
  563. break
  564. end
  565. if GetDistanceBetweenCoords( Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, GetEntityCoords((ped))) < 3.0 then
  566. Tekst3d( Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
  567. end
  568. if timer == 100 then
  569. break
  570. end
  571. if GetDistanceBetweenCoords( Config.analiza.x, Config.analiza.y, Config.analiza.z, GetEntityCoords((ped))) < 3.0 then
  572. Tekst3d( Config.analiza.x, Config.analiza.y, Config.analiza.z + 0.8, ('~w~Trwa analizowanie próbek ~g~' .. timer .. '%'), 0.6)
  573. end
  574. if timer == 100 then
  575. break
  576. end
  577. if GetDistanceBetweenCoords( Config.raport.x, Config.raport.y, Config.raport.z, GetEntityCoords((ped))) < 3.0 then
  578. Tekst3d( Config.raport.x, Config.raport.y, Config.raport.z + 0.8, ('~w~Trwa drukowanie raportu ~g~' .. timer .. '%'), 0.6)
  579. end
  580. if timer == 100 then
  581. break
  582. end
  583. end
  584. end)
  585. end)
  586.  
  587. -- test eventy
  588.  
  589. RegisterNetEvent("Bag:ToggleBag")
  590. AddEventHandler("Bag:ToggleBag", function()
  591. if not holdingBag then
  592. RequestModel(GetHashKey(bagModel))
  593. while not HasModelLoaded(GetHashKey(bagModel)) do
  594. Citizen.Wait(100)
  595. end
  596.  
  597. while not HasAnimDictLoaded(baganimDict) do
  598. RequestAnimDict(baganimDict)
  599. Citizen.Wait(100)
  600. end
  601.  
  602. local plyCoords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(PlayerId()), 0.0, 0.0, -5.0)
  603. local bagspawned = CreateObject(GetHashKey(bagModel), plyCoords.x, plyCoords.y, plyCoords.z, 1, 1, 1)
  604. Citizen.Wait(1000)
  605. local netid = ObjToNet(bagspawned)
  606. SetNetworkIdExistsOnAllMachines(netid, true)
  607. --NetworkSetNetworkIdDynamic(netid, true)
  608. SetNetworkIdCanMigrate(netid, false)
  609. AttachEntityToEntity(bagspawned, GetPlayerPed(PlayerId()), GetPedBoneIndex(GetPlayerPed(PlayerId()), 57005), 0.15, 0, 0, 0, 270.0, 60.0, true, true, false, true, 1, true)
  610. TaskPlayAnim(GetPlayerPed(PlayerId()), 1.0, -1, -1, 50, 0, 0, 0, 0) -- 50 = 32 + 16 + 2
  611. TaskPlayAnim(GetPlayerPed(PlayerId()), baganimDict, baganimName, 1.0, -1, -1, 50, 0, 0, 0, 0)
  612. bag_net = netid
  613. holdingBag = true
  614. else
  615. ClearPedSecondaryTask(GetPlayerPed(PlayerId()))
  616. DetachEntity(NetToObj(bag_net), 1, 1)
  617. DeleteEntity(NetToObj(bag_net))
  618. bag_net = nil
  619. holdingBag = false
  620. usingBag = false
  621. end
  622. end)
  623.  
  624.  
  625. Citizen.CreateThread(function()
  626. while true do
  627. Citizen.Wait(0)
  628. if holdingBag then
  629. while not HasAnimDictLoaded(baganimDict) do
  630. RequestAnimDict(baganimDict)
  631. Citizen.Wait(100)
  632. end
  633. DisablePlayerFiring(PlayerId(), true)
  634. DisableControlAction(0,25,true) -- disable aim
  635. DisableControlAction(0, 44, true) -- INPUT_COVER
  636. --DisableControlAction(0,37,true) -- INPUT_SELECT_WEAPON
  637. SetCurrentPedWeapon(GetPlayerPed(-1), GetHashKey("WEAPON_UNARMED"), true)
  638. end
  639. end
  640. end)
  641.  
  642. function Notification(message)
  643. SetNotificationTextEntry("STRING")
  644. AddTextComponentString(message)
  645. DrawNotification(0, 1)
  646. end
  647.  
  648. function DisplayNotification(string)
  649. SetTextComponentFormat("STRING")
  650. AddTextComponentString(string)
  651. DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  652. end
  653.  
  654. --- FUNKCJE ---
  655.  
  656. function Zbieranie()
  657. local ped = PlayerPedId()
  658.  
  659. Citizen.CreateThread(function()
  660. RequestAnimDict("amb@medic@standing@kneel@idle_a")
  661. Citizen.Wait(100)
  662. TaskPlayAnim((ped), 'amb@medic@standing@kneel@idle_a', 'idle_a', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
  663. Citizen.Wait(7000)
  664. TaskPlayAnim((ped), 'amb@medic@standing@kneel@idle_a', 'idle_a', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
  665. end)
  666. end
  667.  
  668. function HelpText(text)
  669. SetTextComponentFormat("STRING")
  670. AddTextComponentString(text)
  671. DisplayHelpTextFromStringLabel(0, 0, 0, -1)
  672. end
  673.  
  674. function blokada_przycisk()
  675. Citizen.CreateThread(function()
  676. while blokada do
  677. Citizen.Wait(1)
  678. DisableControlAction(0, 73, true) -- x
  679. DisableControlAction(0, 105, true) -- x
  680. DisableControlAction(0, 120, true) -- x
  681. DisableControlAction(0, 154, true) -- x
  682. DisableControlAction(0, 186, true) -- x
  683. DisableControlAction(0, 252, true) -- x
  684. DisableControlAction(0, 323, true) -- x
  685. DisableControlAction(0, 337, true) -- x
  686. DisableControlAction(0, 354, true) -- x
  687. DisableControlAction(0, 357, true) -- x
  688. DisableControlAction(0, 20, true) -- z
  689. DisableControlAction(0, 48, true) -- z
  690. DisableControlAction(0, 32, true) -- w
  691. DisableControlAction(0, 33, true) -- s
  692. DisableControlAction(0, 34, true) -- a
  693. DisableControlAction(0, 35, true) -- d
  694. end
  695. end)
  696. end
  697.  
  698. function Analiza()
  699. local ped = PlayerPedId()
  700.  
  701. Citizen.CreateThread(function()
  702. Citizen.Wait(1000)
  703. TriggerServerEvent('InteractSound_SV:PlayOnSource', 'klawiatura', 0.2)
  704. RequestAnimDict("missah_2_ext_altleadinout")
  705. Citizen.Wait(100)
  706. TaskPlayAnim((ped), 'missah_2_ext_altleadinout', 'hack_loop', 8.0, 8.0, 15000, 2, 0, 0, 0, 0)
  707. Citizen.Wait(2000)
  708. end)
  709. end
  710.  
  711. function StworzBlipa()
  712.  
  713. if PlayerData.job ~= nil and PlayerData.job.name == "badacz" and pracuje then
  714.  
  715. blip2 = AddBlipForCoord(Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z)
  716. SetBlipSprite(blip2, 499)
  717. SetBlipColour(blip2, 26)
  718. SetBlipAsShortRange(blip2, true)
  719. BeginTextCommandSetBlipName("STRING")
  720. AddTextComponentString("Zbieranie próbek wody")
  721. EndTextCommandSetBlipName(blip2)
  722.  
  723.  
  724. blip3 = AddBlipForCoord(Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z)
  725. SetBlipSprite(blip3, 499)
  726. SetBlipColour(blip3, 26)
  727. SetBlipAsShortRange(blip3, true)
  728. BeginTextCommandSetBlipName("STRING")
  729. AddTextComponentString("Zbieranie próbek drewna")
  730. EndTextCommandSetBlipName(blip3)
  731.  
  732.  
  733. blip4 = AddBlipForCoord(Config.analiza.x, Config.analiza.y, Config.analiza.z)
  734. SetBlipSprite(blip4, 499)
  735. SetBlipColour(blip4, 26)
  736. SetBlipAsShortRange(blip4, true)
  737. BeginTextCommandSetBlipName("STRING")
  738. AddTextComponentString("Analiza próbek")
  739. EndTextCommandSetBlipName(blip4)
  740.  
  741.  
  742. blip5 = AddBlipForCoord(Config.raport.x, Config.raport.y, Config.raport.z)
  743. SetBlipSprite(blip5, 499)
  744. SetBlipColour(blip5, 26)
  745. SetBlipAsShortRange(blip5, true)
  746. BeginTextCommandSetBlipName("STRING")
  747. AddTextComponentString("Drukowanie raportu")
  748. EndTextCommandSetBlipName(blip5)
  749.  
  750.  
  751. blip6 = AddBlipForCoord(Config.szefu.x, Config.szefu.y, Config.szefu.z)
  752. SetBlipSprite(blip6, 480)
  753. SetBlipColour(blip6, 26)
  754. SetBlipAsShortRange(blip6, true)
  755. BeginTextCommandSetBlipName("STRING")
  756. AddTextComponentString("Oddanie raportu")
  757. EndTextCommandSetBlipName(blip6)
  758.  
  759. blip7 = AddBlipForCoord(Config.garazschowaj.x, Config.garazschowaj.y, Config.garazschowaj.z)
  760. SetBlipSprite(blip7, 85)
  761. SetBlipColour(blip7, 26)
  762. SetBlipAsShortRange(blip7, true)
  763. BeginTextCommandSetBlipName("STRING")
  764. AddTextComponentString("Schowanie pojazdu")
  765. EndTextCommandSetBlipName(blip7)
  766.  
  767. blip8 = AddBlipForCoord(Config.garazwyciagnij.x, Config.garazwyciagnij.y, Config.garazwyciagnij.z)
  768. SetBlipSprite(blip8, 85)
  769. SetBlipColour(blip8, 26)
  770. SetBlipAsShortRange(blip8, true)
  771. BeginTextCommandSetBlipName("STRING")
  772. AddTextComponentString("Wyciągniecie pojazdu")
  773. EndTextCommandSetBlipName(blip8)
  774. else
  775.  
  776. if blip2 ~= nil then
  777. RemoveBlip(blip2)
  778. blip2 = nil
  779. end
  780.  
  781. if blip3 ~= nil then
  782. RemoveBlip(blip3)
  783. blip3 = nil
  784. end
  785.  
  786. if blip3 ~= nil then
  787. RemoveBlip(blip3)
  788. blip3 = nil
  789. end
  790.  
  791. if blip4 ~= nil then
  792. RemoveBlip(blip4)
  793. blip4 = nil
  794. end
  795.  
  796. if blip5 ~= nil then
  797. RemoveBlip(blip5)
  798. blip5 = nil
  799. end
  800.  
  801. if blip6 ~= nil then
  802. RemoveBlip(blip6)
  803. blip6 = nil
  804. end
  805.  
  806. if blip7 ~= nil then
  807. RemoveBlip(blip7)
  808. blip7 = nil
  809. end
  810.  
  811. if blip8 ~= nil then
  812. RemoveBlip(blip8)
  813. blip8 = nil
  814. end
  815. end
  816. end
  817.  
  818. function Raport()
  819. local ped = PlayerPedId()
  820.  
  821. Citizen.CreateThread(function()
  822. TriggerServerEvent('InteractSound_SV:PlayOnSource', 'usb', 0.2)
  823. Citizen.Wait(1000)
  824. TriggerServerEvent('InteractSound_SV:PlayOnSource', 'druk', 0.2)
  825. RequestAnimDict("amb@prop_human_bum_shopping_cart@male@idle_a")
  826. Citizen.Wait(100)
  827. TaskPlayAnim(PlayerPedId(), 'amb@prop_human_bum_shopping_cart@male@idle_a', 'idle_a', 8.0, -8.0, -1, 2, 0, false, false, false)
  828. Citizen.Wait(13000)
  829. ClearPedTasks(ped)
  830. end)
  831. end
  832.  
  833. function PodajRaport()
  834. local ped = PlayerPedId()
  835. RequestModel(-925658112)
  836. while not HasModelLoaded(-925658112) do
  837. Citizen.Wait(100)
  838. end
  839.  
  840. Citizen.CreateThread(function()
  841. teczka = CreateObject(-925658112, GetEntityCoords(GetPlayerPed(-1), true), true, true, true)
  842. AttachEntityToEntity(teczka, GetPlayerPed(-1), GetPedBoneIndex(GetPlayerPed(-1), 57005), 0.2, 0.1, 0.0, 130.0, 20.0, 0.0, true, true, false, true, 1, true)
  843. Citizen.Wait(1000)
  844. RequestAnimDict("mp_common")
  845. Citizen.Wait(100)
  846. TaskPlayAnim(PlayerPedId(), 'mp_common', 'givetake1_b', 8.0, -8.0, -1, 2, 0, false, false, false)
  847. Citizen.Wait(3000)
  848. ClearPedTasks(ped)
  849. DetachEntity(teczka)
  850. DeleteEntity(teczka)
  851. end)
  852. end
  853. function Tekst3d(x, y, z, text)
  854. local onScreen,_x,_y=World3dToScreen2d(x,y,z)
  855. local px,py,pz=table.unpack(GetGameplayCamCoords())
  856. SetTextFont(0)
  857. SetTextProportional(1)
  858. SetTextScale(0.0, 0.35)
  859. SetTextColour(255, 255, 255, 255)
  860. SetTextDropshadow(0, 0, 0, 0, 55)
  861. SetTextEdge(2, 0, 0, 0, 150)
  862. SetTextDropShadow()
  863. SetTextOutline()
  864. SetTextEntry("STRING")
  865. SetTextCentre(1)
  866. AddTextComponentString(text)
  867. DrawText(_x,_y)
  868. end
  869.  
  870. function MenuPrzebieralnia()
  871. ESX.UI.Menu.CloseAll()
  872.  
  873. ESX.UI.Menu.Open(
  874. 'default', GetCurrentResourceName(), 'cloakroom',
  875. {
  876. title = 'Szatnia badacza',
  877. align = 'center',
  878. elements = {
  879. {label = 'Ubranie robocze', value = 'job_wear'},
  880. {label = 'Ubranie cywilne', value = 'citizen_wear'}
  881. }
  882. },
  883. function(data, menu)
  884. local ped = PlayerPedId()
  885. if data.current.value == 'citizen_wear' then
  886. TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 4.5, 'ubieranie', 0.2)
  887. RequestAnimDict("move_m@_idles@shake_off")
  888. Citizen.Wait(100)
  889. TaskPlayAnim((ped), 'move_m@_idles@shake_off', 'shakeoff_1', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
  890. blokada = true
  891. blokada_przycisk()
  892. Wait(3000)
  893. ClearPedTasks(GetPlayerPed(-1))
  894. blokada = false
  895. pracuje = false
  896. StworzBlipa()
  897.  
  898. ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
  899. TriggerEvent('skinchanger:loadSkin', skin)
  900. end)
  901. end
  902. if data.current.value == 'job_wear' then
  903. TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 4.5, 'ubieranie', 0.2)
  904. RequestAnimDict("move_m@_idles@shake_off")
  905. Citizen.Wait(100)
  906. TaskPlayAnim((ped), 'move_m@_idles@shake_off', 'shakeoff_1', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
  907. blokada = true
  908. blokada_przycisk()
  909. Wait(3000)
  910. ClearPedTasks(GetPlayerPed(-1))
  911. blokada = false
  912. pracuje = true
  913. StworzBlipa()
  914.  
  915. ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
  916. if skin.sex == 0 then
  917. TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
  918. else
  919. TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
  920. end
  921.  
  922. end)
  923. end
  924. menu.close()
  925. end,
  926. function(data, menu)
  927. menu.close()
  928. end
  929. )
  930. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement