Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ESX = nil
- local PlayerData = {}
- --test
- local holdingBag = false
- local usingBag = false
- local bagModel = "prop_ld_suitcase_01"
- local baganimDict = "missheistdocksprep1hold_cellphone"
- local baganimName = "hold_cellphone"
- local bag_net = nil
- local UI = {
- x = 0.000 ,
- y = -0.001 ,
- }
- local Keys = {
- ["ESC"] = 322, ["BACKSPACE"] = 177, ["E"] = 38, ["ENTER"] = 18, ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173
- }
- local blip2 = nil
- local blip3 = nil
- local blip4 = nil
- local blip5 = nil
- local blip6 = nil
- local blip7 = nil
- local blip8 = nil
- --test
- local pracuje = false
- --- WĄTKI ---
- --Citizen.CreateThread(function()
- --
- -- Citizen.Trace('whitebreak_badacz: Start')
- --
- -- while ESX == nil do
- -- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- -- Citizen.Wait(0)
- -- end
- --
- --
- -- PlayerData = ESX.GetPlayerData()
- --
- -- while ESX.GetPlayerData().job == nil and ESX.GetPlayerData().job.name == 'badacz' do
- -- Citizen.Wait(500)
- -- end
- --
- --
- --end)
- Citizen.CreateThread(function()
- while ESX == nil do
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- Citizen.Wait(0)
- end
- Citizen.Wait(5000)
- PlayerData = ESX.GetPlayerData()
- end)
- Citizen.CreateThread(function()
- RequestModel(GetHashKey("s_m_m_scientist_01"))
- while not HasModelLoaded(GetHashKey("s_m_m_scientist_01")) do
- Wait(1)
- end
- local Ped = CreatePed(1, 1092080539, 3541.3, 3667.96, 28.12 - 0.99, 136.05, false, false)
- FreezeEntityPosition(Ped, true)
- SetEntityInvincible(Ped, true)
- SetBlockingOfNonTemporaryEvents(Ped, true)
- Wait(200)
- TaskStartScenarioInPlace(Ped, 'CODE_HUMAN_MEDIC_TIME_OF_DEATH')
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(1)
- local player = GetPlayerPed(-1)
- if GetDistanceBetweenCoords(GetEntityCoords(player, true), Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z, true) < 10 then
- 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)
- end
- if GetDistanceBetweenCoords(GetEntityCoords(player, true), Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z, true) < 1.0 then
- --Tekst3d(Config.badaniastart.x, Config.badaniastart.y, Config.badaniastart.z, ('~w~Kliknij [~g~E~w~] aby otworzyć przebieralnie'), 0.1)
- HelpText("Naciśnij ~INPUT_CONTEXT~, aby otworzyć przebieralnię")
- if IsControlJustReleased(1, 51) then
- MenuPrzebieralnia()
- end
- end
- end
- end)
- local blips = {
- {title="Humane Labs", colour=26, id=51, x = 3559.958, y = 3674.409, z = 28.12189},
- }
- Citizen.CreateThread(function()
- for _, info in pairs(blips) do
- info.blip = AddBlipForCoord(info.x, info.y, info.z)
- SetBlipSprite(info.blip, info.id)
- SetBlipDisplay(info.blip, 4)
- SetBlipScale(info.blip, 0.9)
- SetBlipColour(info.blip, info.colour)
- SetBlipAsShortRange(info.blip, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString(info.title)
- EndTextCommandSetBlipName(info.blip)
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Wait(5)
- local coords = GetEntityCoords(PlayerPedId())
- if (GetDistanceBetweenCoords(coords, 3599.23, 3669.48, 33.87, true) < 40) and pracuje == true then
- 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)
- end
- if(GetDistanceBetweenCoords(coords, 3599.23, 3669.48, 33.87, true) < 1.0) and pracuje == true then
- HelpText('~g~[E] ~w~Wyciągniecie pojazdu')
- if IsControlJustReleased(0, Keys['E']) then
- if pracuje == true then
- local veh = "Rebel2"
- local x,y,z = GetEntityCoords(PlayerPedId())
- vehiclehash = GetHashKey(veh)
- RequestModel(vehiclehash)
- local spawned = CreateVehicle(vehiclehash, 3599.23, 3669.48, 33.87, 74.61, 1, 0)
- SetPedIntoVehicle(PlayerPedId(), spawned, -1)
- local liczba = math.random(1000,9999)
- SetVehicleNumberPlateText(spawned,'LABS'.. liczba)
- ESX.ShowNotification('~g~Pobrano ~w~auto z garażu')
- else
- ESX.ShowNotification('~r~Musisz się przebrać!')
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Wait(5)
- local coords = GetEntityCoords(PlayerPedId())
- if (GetDistanceBetweenCoords(coords, 3598.72, 3660.74, 33.87, true) < 40) and pracuje == true then
- 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)
- end
- if(GetDistanceBetweenCoords(coords, 3598.72, 3660.74, 33.87, true) < 1.0) and pracuje == true then
- HelpText('~g~[E] ~w~Schowanie pojazdu')
- if IsControlJustReleased(0, Keys['E']) then
- if pracuje == true then
- if IsPedInAnyVehicle(PlayerPedId(), false) then
- local vehicle = GetVehiclePedIsIn(PlayerPedId(), false)
- local hash = GetEntityModel(vehicle)
- if DoesEntityExist(vehicle) then
- if hash == GetHashKey('Rebel2') then
- ESX.ShowNotification("~r~Chowawnie auta do garażu...")
- Citizen.Wait(3000)
- ESX.ShowNotification('~r~Oddano auto do garażu')
- DeleteVehicle(vehicle)
- else
- ESX.ShowNotification('~r~Zły pojazd!')
- end
- end
- else
- ESX.ShowNotification('~r~Musisz być w pracy lub być w odpowiednim pojeździe!')
- end
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- local zbieranie1 = false
- local zbieranie2 = false
- local zbieranie3 = false
- local zbieranie4 = false
- while true do
- Citizen.Wait(1)
- local ped = PlayerPedId()
- local koordy = GetEntityCoords(ped)
- if pracuje then
- if not IsEntityDead( ped ) and zbieranie1 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, true ) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, true ) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~, aby zbierać próbki wody.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzwode")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie1 = true
- blokada = false
- end
- end
- end
- end
- if not IsEntityDead( ped ) and zbieranie2 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z, true ) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z, true ) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki wody.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzwode")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie2 = true
- blokada = false
- end
- end
- end
- end
- if not IsEntityDead( ped ) and zbieranie3 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z, true ) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z, true ) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki wody.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzwode")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie3 = true
- blokada = false
- end
- end
- end
- end
- if not IsEntityDead( ped ) and zbieranie4 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, true ) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, true ) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki wody.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzwode")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie4 = true
- blokada = false
- end
- end
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- local zbieranie1 = false
- local zbieranie2 = false
- local zbieranie3 = false
- local zbieranie4 = false
- while true do
- local ped = PlayerPedId()
- local koordy = GetEntityCoords(ped)
- Citizen.Wait(0)
- if pracuje then
- if not IsEntityDead( ped ) and zbieranie1 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, true ) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, true ) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie1 = true
- blokada = false
- end
- end
- end
- end
- if not IsEntityDead(ped) and zbieranie2 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, true) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, true) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie2 = true
- blokada = false
- end
- end
- end
- end
- if not IsEntityDead(ped) and zbieranie3 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, true) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, true) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie3 = true
- blokada = false
- end
- end
- end
- end
- if not IsEntityDead(ped) and zbieranie4 == false then
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, true) < 50 then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, true) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby zbierać próbki drewna.")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(100)
- TriggerServerEvent("whitebreak_badacz:zbierzdrewno")
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- zbieranie4 = true
- blokada = false
- end
- end
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- local ped = GetPlayerPed(-1)
- local koordy = GetEntityCoords(ped, true)
- if not IsEntityDead(ped) then
- if GetDistanceBetweenCoords(koordy, Config.analiza.x, Config.analiza.y, Config.analiza.z, true) < 15 and pracuje == true then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.analiza.x, Config.analiza.y, Config.analiza.z, true) < 1.0 and pracuje == true then
- HelpText("Naciśnij ~INPUT_CONTEXT~ aby poddać próbki ~b~analizie")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(200)
- TriggerServerEvent('whitebreak_badacz:analiza')
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- blokada = false
- end
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- local ped = GetPlayerPed(-1)
- local koordy = GetEntityCoords(ped, true)
- if not IsEntityDead(ped) then
- if GetDistanceBetweenCoords(koordy, Config.raport.x, Config.raport.y, Config.raport.z, true) < 10 and pracuje == true then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.raport.x, Config.raport.y, Config.raport.z, true) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~, aby wydrukować raport dla szefa")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(200)
- TriggerServerEvent('whitebreak_badacz:raport')
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- blokada = false
- end
- end
- end
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- local ped = GetPlayerPed(-1)
- local koordy = GetEntityCoords(ped, true)
- if not IsEntityDead(ped) then
- if GetDistanceBetweenCoords(koordy, Config.podajraport.x, Config.podajraport.y, Config.podajraport.z, true) < 10 and pracuje == true then
- 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)
- if GetDistanceBetweenCoords(koordy, Config.podajraport.x, Config.podajraport.y, Config.podajraport.z, true) < 1.0 then
- HelpText("Naciśnij ~INPUT_CONTEXT~, aby podać raport szefowi")
- if IsControlJustReleased(1, 51) then
- Citizen.Wait(200)
- TriggerServerEvent('whitebreak_badacz:podajraport')
- blokada = true
- blokada_przycisk()
- Citizen.Wait(15500)
- blokada = false
- end
- end
- end
- end
- end
- end)
- --- EVENTY ---
- RegisterNetEvent('esx:playerLoaded')
- AddEventHandler('esx:playerLoaded', function(xPlayer)
- PlayerData = xPlayer
- end)
- RegisterNetEvent('esx:setJob')
- AddEventHandler('esx:setJob', function(job)
- PlayerData.job = job
- end)
- RegisterNetEvent('whitebreak_badacz:zbieranie')
- AddEventHandler('whitebreak_badacz:zbieranie', function()
- Zbieranie()
- end)
- RegisterNetEvent('whitebreak_badacz:analiza')
- AddEventHandler('whitebreak_badacz:analiza', function()
- Analiza()
- end)
- RegisterNetEvent('whitebreak_badacz:zaduzo')
- AddEventHandler('whitebreak_badacz:zaduzo', function()
- HelpText("Posiadasz maksymalną ilość próbek w swoim ekwipunku!")
- end)
- RegisterNetEvent('whitebreak_badacz:maanalize')
- AddEventHandler('whitebreak_badacz:maanalize', function()
- HelpText("Posiadasz już analizę na pendrive!")
- end)
- RegisterNetEvent('whitebreak_badacz:maraport')
- AddEventHandler('whitebreak_badacz:maraport', function()
- HelpText("Masz już jeden raport przy sobie!")
- end)
- RegisterNetEvent('whitebreak_badacz:niemaanalizy')
- AddEventHandler('whitebreak_badacz:niemaanalizy', function()
- HelpText("Nie masz pendrive z analizą!")
- end)
- RegisterNetEvent('whitebreak_badacz:niemaraportu')
- AddEventHandler('whitebreak_badacz:niemaraportu', function()
- HelpText("Nie masz raportu!")
- end)
- RegisterNetEvent('whitebreak_badacz:raport')
- AddEventHandler('whitebreak_badacz:raport', function()
- Raport()
- end)
- RegisterNetEvent('whitebreak_badacz:podajraport')
- AddEventHandler('whitebreak_badacz:podajraport', function()
- PodajRaport()
- end)
- RegisterNetEvent('whitebreak_badacz:niemaprobek')
- AddEventHandler('whitebreak_badacz:niemaprobek', function()
- HelpText("Nie masz próbek do analizy")
- end)
- RegisterNetEvent('whitebreak_badacz:timer')
- AddEventHandler('whitebreak_badacz:timer', function()
- local timer = 0
- local ped = PlayerPedId()
- Citizen.CreateThread(function()
- while timer > -1 do
- Citizen.Wait(140)
- if timer > -1 then
- timer = timer + 1
- end
- if timer == 100 then
- break
- end
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if GetDistanceBetweenCoords( Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d(Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d(Config.badaniawoda2.x, Config.badaniawoda2.y, Config.badaniawoda2.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d(Config.badaniawoda3.x, Config.badaniawoda3.y, Config.badaniawoda3.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d(Config.badaniawoda4.x, Config.badaniawoda4.y, Config.badaniawoda4.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d( Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d( Config.badaniadrzewo2.x, Config.badaniadrzewo2.y, Config.badaniadrzewo2.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d( Config.badaniadrzewo3.x, Config.badaniadrzewo3.y, Config.badaniadrzewo3.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d( Config.badaniadrzewo4.x, Config.badaniadrzewo4.y, Config.badaniadrzewo4.z + 0.8, ('~w~Trwa zbieranie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.analiza.x, Config.analiza.y, Config.analiza.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d( Config.analiza.x, Config.analiza.y, Config.analiza.z + 0.8, ('~w~Trwa analizowanie próbek ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- if GetDistanceBetweenCoords( Config.raport.x, Config.raport.y, Config.raport.z, GetEntityCoords((ped))) < 3.0 then
- Tekst3d( Config.raport.x, Config.raport.y, Config.raport.z + 0.8, ('~w~Trwa drukowanie raportu ~g~' .. timer .. '%'), 0.6)
- end
- if timer == 100 then
- break
- end
- end
- end)
- end)
- -- test eventy
- RegisterNetEvent("Bag:ToggleBag")
- AddEventHandler("Bag:ToggleBag", function()
- if not holdingBag then
- RequestModel(GetHashKey(bagModel))
- while not HasModelLoaded(GetHashKey(bagModel)) do
- Citizen.Wait(100)
- end
- while not HasAnimDictLoaded(baganimDict) do
- RequestAnimDict(baganimDict)
- Citizen.Wait(100)
- end
- local plyCoords = GetOffsetFromEntityInWorldCoords(GetPlayerPed(PlayerId()), 0.0, 0.0, -5.0)
- local bagspawned = CreateObject(GetHashKey(bagModel), plyCoords.x, plyCoords.y, plyCoords.z, 1, 1, 1)
- Citizen.Wait(1000)
- local netid = ObjToNet(bagspawned)
- SetNetworkIdExistsOnAllMachines(netid, true)
- --NetworkSetNetworkIdDynamic(netid, true)
- SetNetworkIdCanMigrate(netid, false)
- AttachEntityToEntity(bagspawned, GetPlayerPed(PlayerId()), GetPedBoneIndex(GetPlayerPed(PlayerId()), 57005), 0.15, 0, 0, 0, 270.0, 60.0, true, true, false, true, 1, true)
- TaskPlayAnim(GetPlayerPed(PlayerId()), 1.0, -1, -1, 50, 0, 0, 0, 0) -- 50 = 32 + 16 + 2
- TaskPlayAnim(GetPlayerPed(PlayerId()), baganimDict, baganimName, 1.0, -1, -1, 50, 0, 0, 0, 0)
- bag_net = netid
- holdingBag = true
- else
- ClearPedSecondaryTask(GetPlayerPed(PlayerId()))
- DetachEntity(NetToObj(bag_net), 1, 1)
- DeleteEntity(NetToObj(bag_net))
- bag_net = nil
- holdingBag = false
- usingBag = false
- end
- end)
- Citizen.CreateThread(function()
- while true do
- Citizen.Wait(0)
- if holdingBag then
- while not HasAnimDictLoaded(baganimDict) do
- RequestAnimDict(baganimDict)
- Citizen.Wait(100)
- end
- DisablePlayerFiring(PlayerId(), true)
- DisableControlAction(0,25,true) -- disable aim
- DisableControlAction(0, 44, true) -- INPUT_COVER
- --DisableControlAction(0,37,true) -- INPUT_SELECT_WEAPON
- SetCurrentPedWeapon(GetPlayerPed(-1), GetHashKey("WEAPON_UNARMED"), true)
- end
- end
- end)
- function Notification(message)
- SetNotificationTextEntry("STRING")
- AddTextComponentString(message)
- DrawNotification(0, 1)
- end
- function DisplayNotification(string)
- SetTextComponentFormat("STRING")
- AddTextComponentString(string)
- DisplayHelpTextFromStringLabel(0, 0, 1, -1)
- end
- --- FUNKCJE ---
- function Zbieranie()
- local ped = PlayerPedId()
- Citizen.CreateThread(function()
- RequestAnimDict("amb@medic@standing@kneel@idle_a")
- Citizen.Wait(100)
- TaskPlayAnim((ped), 'amb@medic@standing@kneel@idle_a', 'idle_a', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
- Citizen.Wait(7000)
- TaskPlayAnim((ped), 'amb@medic@standing@kneel@idle_a', 'idle_a', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
- end)
- end
- function HelpText(text)
- SetTextComponentFormat("STRING")
- AddTextComponentString(text)
- DisplayHelpTextFromStringLabel(0, 0, 0, -1)
- end
- function blokada_przycisk()
- Citizen.CreateThread(function()
- while blokada do
- Citizen.Wait(1)
- DisableControlAction(0, 73, true) -- x
- DisableControlAction(0, 105, true) -- x
- DisableControlAction(0, 120, true) -- x
- DisableControlAction(0, 154, true) -- x
- DisableControlAction(0, 186, true) -- x
- DisableControlAction(0, 252, true) -- x
- DisableControlAction(0, 323, true) -- x
- DisableControlAction(0, 337, true) -- x
- DisableControlAction(0, 354, true) -- x
- DisableControlAction(0, 357, true) -- x
- DisableControlAction(0, 20, true) -- z
- DisableControlAction(0, 48, true) -- z
- DisableControlAction(0, 32, true) -- w
- DisableControlAction(0, 33, true) -- s
- DisableControlAction(0, 34, true) -- a
- DisableControlAction(0, 35, true) -- d
- end
- end)
- end
- function Analiza()
- local ped = PlayerPedId()
- Citizen.CreateThread(function()
- Citizen.Wait(1000)
- TriggerServerEvent('InteractSound_SV:PlayOnSource', 'klawiatura', 0.2)
- RequestAnimDict("missah_2_ext_altleadinout")
- Citizen.Wait(100)
- TaskPlayAnim((ped), 'missah_2_ext_altleadinout', 'hack_loop', 8.0, 8.0, 15000, 2, 0, 0, 0, 0)
- Citizen.Wait(2000)
- end)
- end
- function StworzBlipa()
- if PlayerData.job ~= nil and PlayerData.job.name == "badacz" and pracuje then
- blip2 = AddBlipForCoord(Config.badaniawoda1.x, Config.badaniawoda1.y, Config.badaniawoda1.z)
- SetBlipSprite(blip2, 499)
- SetBlipColour(blip2, 26)
- SetBlipAsShortRange(blip2, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Zbieranie próbek wody")
- EndTextCommandSetBlipName(blip2)
- blip3 = AddBlipForCoord(Config.badaniadrzewo1.x, Config.badaniadrzewo1.y, Config.badaniadrzewo1.z)
- SetBlipSprite(blip3, 499)
- SetBlipColour(blip3, 26)
- SetBlipAsShortRange(blip3, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Zbieranie próbek drewna")
- EndTextCommandSetBlipName(blip3)
- blip4 = AddBlipForCoord(Config.analiza.x, Config.analiza.y, Config.analiza.z)
- SetBlipSprite(blip4, 499)
- SetBlipColour(blip4, 26)
- SetBlipAsShortRange(blip4, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Analiza próbek")
- EndTextCommandSetBlipName(blip4)
- blip5 = AddBlipForCoord(Config.raport.x, Config.raport.y, Config.raport.z)
- SetBlipSprite(blip5, 499)
- SetBlipColour(blip5, 26)
- SetBlipAsShortRange(blip5, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Drukowanie raportu")
- EndTextCommandSetBlipName(blip5)
- blip6 = AddBlipForCoord(Config.szefu.x, Config.szefu.y, Config.szefu.z)
- SetBlipSprite(blip6, 480)
- SetBlipColour(blip6, 26)
- SetBlipAsShortRange(blip6, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Oddanie raportu")
- EndTextCommandSetBlipName(blip6)
- blip7 = AddBlipForCoord(Config.garazschowaj.x, Config.garazschowaj.y, Config.garazschowaj.z)
- SetBlipSprite(blip7, 85)
- SetBlipColour(blip7, 26)
- SetBlipAsShortRange(blip7, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Schowanie pojazdu")
- EndTextCommandSetBlipName(blip7)
- blip8 = AddBlipForCoord(Config.garazwyciagnij.x, Config.garazwyciagnij.y, Config.garazwyciagnij.z)
- SetBlipSprite(blip8, 85)
- SetBlipColour(blip8, 26)
- SetBlipAsShortRange(blip8, true)
- BeginTextCommandSetBlipName("STRING")
- AddTextComponentString("Wyciągniecie pojazdu")
- EndTextCommandSetBlipName(blip8)
- else
- if blip2 ~= nil then
- RemoveBlip(blip2)
- blip2 = nil
- end
- if blip3 ~= nil then
- RemoveBlip(blip3)
- blip3 = nil
- end
- if blip3 ~= nil then
- RemoveBlip(blip3)
- blip3 = nil
- end
- if blip4 ~= nil then
- RemoveBlip(blip4)
- blip4 = nil
- end
- if blip5 ~= nil then
- RemoveBlip(blip5)
- blip5 = nil
- end
- if blip6 ~= nil then
- RemoveBlip(blip6)
- blip6 = nil
- end
- if blip7 ~= nil then
- RemoveBlip(blip7)
- blip7 = nil
- end
- if blip8 ~= nil then
- RemoveBlip(blip8)
- blip8 = nil
- end
- end
- end
- function Raport()
- local ped = PlayerPedId()
- Citizen.CreateThread(function()
- TriggerServerEvent('InteractSound_SV:PlayOnSource', 'usb', 0.2)
- Citizen.Wait(1000)
- TriggerServerEvent('InteractSound_SV:PlayOnSource', 'druk', 0.2)
- RequestAnimDict("amb@prop_human_bum_shopping_cart@male@idle_a")
- Citizen.Wait(100)
- TaskPlayAnim(PlayerPedId(), 'amb@prop_human_bum_shopping_cart@male@idle_a', 'idle_a', 8.0, -8.0, -1, 2, 0, false, false, false)
- Citizen.Wait(13000)
- ClearPedTasks(ped)
- end)
- end
- function PodajRaport()
- local ped = PlayerPedId()
- RequestModel(-925658112)
- while not HasModelLoaded(-925658112) do
- Citizen.Wait(100)
- end
- Citizen.CreateThread(function()
- teczka = CreateObject(-925658112, GetEntityCoords(GetPlayerPed(-1), true), true, true, true)
- 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)
- Citizen.Wait(1000)
- RequestAnimDict("mp_common")
- Citizen.Wait(100)
- TaskPlayAnim(PlayerPedId(), 'mp_common', 'givetake1_b', 8.0, -8.0, -1, 2, 0, false, false, false)
- Citizen.Wait(3000)
- ClearPedTasks(ped)
- DetachEntity(teczka)
- DeleteEntity(teczka)
- end)
- end
- function Tekst3d(x, y, z, text)
- local onScreen,_x,_y=World3dToScreen2d(x,y,z)
- local px,py,pz=table.unpack(GetGameplayCamCoords())
- SetTextFont(0)
- SetTextProportional(1)
- SetTextScale(0.0, 0.35)
- SetTextColour(255, 255, 255, 255)
- SetTextDropshadow(0, 0, 0, 0, 55)
- SetTextEdge(2, 0, 0, 0, 150)
- SetTextDropShadow()
- SetTextOutline()
- SetTextEntry("STRING")
- SetTextCentre(1)
- AddTextComponentString(text)
- DrawText(_x,_y)
- end
- function MenuPrzebieralnia()
- ESX.UI.Menu.CloseAll()
- ESX.UI.Menu.Open(
- 'default', GetCurrentResourceName(), 'cloakroom',
- {
- title = 'Szatnia badacza',
- align = 'center',
- elements = {
- {label = 'Ubranie robocze', value = 'job_wear'},
- {label = 'Ubranie cywilne', value = 'citizen_wear'}
- }
- },
- function(data, menu)
- local ped = PlayerPedId()
- if data.current.value == 'citizen_wear' then
- TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 4.5, 'ubieranie', 0.2)
- RequestAnimDict("move_m@_idles@shake_off")
- Citizen.Wait(100)
- TaskPlayAnim((ped), 'move_m@_idles@shake_off', 'shakeoff_1', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
- blokada = true
- blokada_przycisk()
- Wait(3000)
- ClearPedTasks(GetPlayerPed(-1))
- blokada = false
- pracuje = false
- StworzBlipa()
- ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
- TriggerEvent('skinchanger:loadSkin', skin)
- end)
- end
- if data.current.value == 'job_wear' then
- TriggerServerEvent('InteractSound_SV:PlayWithinDistance', 4.5, 'ubieranie', 0.2)
- RequestAnimDict("move_m@_idles@shake_off")
- Citizen.Wait(100)
- TaskPlayAnim((ped), 'move_m@_idles@shake_off', 'shakeoff_1', 8.0, 8.0, -1, 40, 0, 0, 0, 0)
- blokada = true
- blokada_przycisk()
- Wait(3000)
- ClearPedTasks(GetPlayerPed(-1))
- blokada = false
- pracuje = true
- StworzBlipa()
- ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
- if skin.sex == 0 then
- TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
- else
- TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
- end
- end)
- end
- menu.close()
- end,
- function(data, menu)
- menu.close()
- end
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement