Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Keys = {
- ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
- ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
- ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
- ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
- ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
- ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
- ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
- ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
- }
- --- action functions
- local CurrentAction = nil
- local CurrentActionMsg = ''
- local CurrentActionData = {}
- local HasAlreadyEnteredMarker = false
- local LastZone = nil
- -- Change skins
- local isMale = true
- local skin = {
- sex = 0,
- face = 0,
- skin = 0,
- beard_1 = 0,
- beard_2 = 0,
- beard_3 = 0,
- beard_4 = 0,
- hair_1 = 0,
- hair_2 = 0,
- hair_color_1 = 0,
- hair_color_2 = 0,
- tshirt_1 = 0,
- tshirt_2 = 0,
- torso_1 = 0,
- torso_2 = 0,
- decals_1 = 0,
- decals_2 = 0,
- arms = 0,
- pants_1 = 0,
- pants_2 = 0,
- shoes_1 = 0,
- shoes_2 = 0,
- mask_1 = 0,
- mask_2 = 0,
- bproof_1 = 0,
- bproof_2 = 0,
- chain_1 = 0,
- chain_2 = 0,
- helmet_1 = 0,
- helmet_2 = 0,
- glasses_1 = 0,
- glasses_2 = 0,
- }
- -- ESX
- local GUI = {}
- ESX = nil
- GUI.Time = 0
- local PlayerData = {}
- Citizen.CreateThread(function ()
- while ESX == nil do
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- Citizen.Wait(0)
- PlayerData = ESX.GetPlayerData()
- end
- end)
- RegisterNetEvent('esx:playerLoaded')
- AddEventHandler('esx:playerLoaded', function(xPlayer)
- PlayerData = xPlayer
- end)
- -- Markers
- AddEventHandler('esx_jojo_dusch:hasEnteredMarker', function (zone)
- if zone == 'Duscha' then
- CurrentAction = 'duscha'
- CurrentActionMsg = _U('dusch')
- CurrentActionData = {}
- end
- end)
- AddEventHandler('esx_jojo_dusch:hasExitedMarker', function (zone)
- CurrentAction = nil
- end)
- -- Kontroller
- Citizen.CreateThread(function ()
- while true do
- Citizen.Wait(0)
- local playerPed = GetPlayerPed(-1)
- if CurrentAction ~= nil then
- SetTextComponentFormat('STRING')
- AddTextComponentString(CurrentActionMsg)
- DisplayHelpTextFromStringLabel(0, 0, 1, -1)
- if isMale == true then
- if CurrentAction == 'duscha' then
- if IsControlPressed(0, Keys['E']) then
- DoScreenFadeOut(1000)
- Wait(1000)
- DoScreenFadeIn(1000)
- TriggerEvent('esx_status:set', 'duscha', 1000000)
- TriggerEvent('esx_jojo_dusch:duschsteam')
- TriggerEvent('esx_jojo_dusch:duschsmoke')
- CurrentActionMsg = _U('hide')
- Wait(18000)
- DoScreenFadeOut(1000)
- Wait(1000)
- DoScreenFadeIn(1000)
- if IsControlPressed(0, Keys['E']) then
- sendNotification(_U('duschar'), 'success', 18000)
- end
- end
- end
- end
- end
- end
- end)
- -- Markers
- Citizen.CreateThread(function ()
- while true do
- Wait(0)
- local coords = GetEntityCoords(GetPlayerPed(-1))
- for k,v in pairs(Config.Zones) do
- if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then
- DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, true, 2, false, false, false, false)
- end
- end
- end
- end)
- -- Enter/exit
- Citizen.CreateThread(function ()
- while true do
- Wait(0)
- local coords = GetEntityCoords(GetPlayerPed(-1))
- local isInMarker = false
- local currentZone = nil
- for k,v in pairs(Config.Zones) do
- if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x) then
- isInMarker = true
- currentZone = k
- end
- end
- if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
- HasAlreadyEnteredMarker = true
- LastZone = currentZone
- TriggerEvent('esx_jojo_dusch:hasEnteredMarker', currentZone)
- end
- if not isInMarker and HasAlreadyEnteredMarker then
- HasAlreadyEnteredMarker = false
- TriggerEvent('esx_jojo_dusch:hasExitedMarker', LastZone)
- end
- end
- end)
- -- Spelaren har ej duschat - particles
- RegisterNetEvent('esx_jojo_dusch:NoShower')
- AddEventHandler('esx_jojo_dusch:NoShower', function()
- local particleDictionary = "core"
- local particleName = "veh_respray_smoke"
- RequestNamedPtfxAsset(particleDictionary)
- while not HasNamedPtfxAssetLoaded(particleDictionary) do
- Citizen.Wait(0)
- end
- SetPtfxAssetNextCall(particleDictionary)
- bone = GetPedBoneIndex(GetPlayerPed(-1), 11816)
- effect = StartParticleFxLoopedOnPedBone(particleName, GetPlayerPed(-1), 0.0, 0.0, -0.1, 130.0, 0.0, 0.0, bone, 0.02, false, false, false);
- end)
- -- Dusch smoke
- RegisterNetEvent('esx_jojo_dusch:duschsmoke')
- AddEventHandler('esx_jojo_dusch:duschsmoke', function()
- local particleDictionary = "scr_fm_mp_missioncreator"
- local particleName = "ent_amb_shower_steam"
- RequestNamedPtfxAsset(particleDictionary)
- while not HasNamedPtfxAssetLoaded(particleDictionary) do
- Citizen.Wait(0)
- end
- SetPtfxAssetNextCall(particleDictionary)
- bone = GetPedBoneIndex(GetPlayerPed(-1), 11816)
- effect = StartParticleFxLoopedOnPedBone(particleName, GetPlayerPed(-1), 0.0, 0.0, -0.1, 90.0, 90.0, 20.0, bone, 2.0, false, false, false);
- Wait(18000)
- StopParticleFxLooped(effect, 0)
- end)
- -- Frys gubben
- Citizen.CreateThread(function()
- while true do
- Wait(0)
- if IsControlPressed(0, Keys['E']) then
- DisableControlAction(0,21,true) -- disable sprint
- DisableControlAction(0,24,true) -- disable attack
- DisableControlAction(0,25,true) -- disable aim
- DisableControlAction(0,47,true) -- disable weapon
- DisableControlAction(0,58,true) -- disable weapon
- DisableControlAction(0,32,true) -- move (w)
- DisableControlAction(0,34,true) -- move (a)
- DisableControlAction(0,33,true) -- move (s)
- DisableControlAction(0,35,true) -- move (d)
- DisableControlAction(0,73,true) -- disable handsup
- end
- end
- end)
- --notification
- function sendNotification(message, messageType, messageTimeout)
- TriggerEvent("pNotify:SendNotification", {
- text = message,
- type = messageType,
- queue = "dusha",
- timeout = messageTimeout,
- layout = "bottomCenter"
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement