Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.18 KB | None | 0 0
  1. local Keys = {
  2. ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  3. ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  4. ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  5. ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  6. ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  7. ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  8. ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  9. ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  10. }
  11.  
  12.  
  13. --- action functions
  14. local CurrentAction = nil
  15. local CurrentActionMsg = ''
  16. local CurrentActionData = {}
  17. local HasAlreadyEnteredMarker = false
  18. local LastZone = nil
  19.  
  20. -- Change skins
  21. local isMale = true
  22.  
  23. local skin = {
  24. sex = 0,
  25. face = 0,
  26. skin = 0,
  27. beard_1 = 0,
  28. beard_2 = 0,
  29. beard_3 = 0,
  30. beard_4 = 0,
  31. hair_1 = 0,
  32. hair_2 = 0,
  33. hair_color_1 = 0,
  34. hair_color_2 = 0,
  35. tshirt_1 = 0,
  36. tshirt_2 = 0,
  37. torso_1 = 0,
  38. torso_2 = 0,
  39. decals_1 = 0,
  40. decals_2 = 0,
  41. arms = 0,
  42. pants_1 = 0,
  43. pants_2 = 0,
  44. shoes_1 = 0,
  45. shoes_2 = 0,
  46. mask_1 = 0,
  47. mask_2 = 0,
  48. bproof_1 = 0,
  49. bproof_2 = 0,
  50. chain_1 = 0,
  51. chain_2 = 0,
  52. helmet_1 = 0,
  53. helmet_2 = 0,
  54. glasses_1 = 0,
  55. glasses_2 = 0,
  56. }
  57.  
  58. -- ESX
  59. local GUI = {}
  60. ESX = nil
  61. GUI.Time = 0
  62. local PlayerData = {}
  63.  
  64. Citizen.CreateThread(function ()
  65. while ESX == nil do
  66. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  67. Citizen.Wait(0)
  68. PlayerData = ESX.GetPlayerData()
  69. end
  70. end)
  71.  
  72. RegisterNetEvent('esx:playerLoaded')
  73. AddEventHandler('esx:playerLoaded', function(xPlayer)
  74. PlayerData = xPlayer
  75. end)
  76.  
  77.  
  78. -- Markers
  79. AddEventHandler('esx_jojo_dusch:hasEnteredMarker', function (zone)
  80. if zone == 'Duscha' then
  81. CurrentAction = 'duscha'
  82. CurrentActionMsg = _U('dusch')
  83. CurrentActionData = {}
  84. end
  85. end)
  86.  
  87. AddEventHandler('esx_jojo_dusch:hasExitedMarker', function (zone)
  88. CurrentAction = nil
  89. end)
  90.  
  91.  
  92. -- Kontroller
  93. Citizen.CreateThread(function ()
  94. while true do
  95. Citizen.Wait(0)
  96.  
  97. local playerPed = GetPlayerPed(-1)
  98.  
  99. if CurrentAction ~= nil then
  100. SetTextComponentFormat('STRING')
  101. AddTextComponentString(CurrentActionMsg)
  102. DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  103.  
  104.  
  105. if isMale == true then
  106. if CurrentAction == 'duscha' then
  107. if IsControlPressed(0, Keys['E']) then
  108. DoScreenFadeOut(1000)
  109. Wait(1000)
  110. DoScreenFadeIn(1000)
  111. TriggerEvent('esx_status:set', 'duscha', 1000000)
  112. TriggerEvent('esx_jojo_dusch:duschsteam')
  113. TriggerEvent('esx_jojo_dusch:duschsmoke')
  114. CurrentActionMsg = _U('hide')
  115. Wait(18000)
  116. DoScreenFadeOut(1000)
  117. Wait(1000)
  118. DoScreenFadeIn(1000)
  119.  
  120. if IsControlPressed(0, Keys['E']) then
  121. sendNotification(_U('duschar'), 'success', 18000)
  122. end
  123. end
  124. end
  125. end
  126. end
  127. end
  128. end)
  129.  
  130.  
  131. -- Markers
  132. Citizen.CreateThread(function ()
  133. while true do
  134. Wait(0)
  135.  
  136. local coords = GetEntityCoords(GetPlayerPed(-1))
  137.  
  138. for k,v in pairs(Config.Zones) do
  139. if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then
  140. 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)
  141. end
  142. end
  143. end
  144. end)
  145.  
  146. -- Enter/exit
  147. Citizen.CreateThread(function ()
  148. while true do
  149. Wait(0)
  150.  
  151. local coords = GetEntityCoords(GetPlayerPed(-1))
  152. local isInMarker = false
  153. local currentZone = nil
  154.  
  155. for k,v in pairs(Config.Zones) do
  156. if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x) then
  157. isInMarker = true
  158. currentZone = k
  159. end
  160. end
  161.  
  162. if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
  163. HasAlreadyEnteredMarker = true
  164. LastZone = currentZone
  165. TriggerEvent('esx_jojo_dusch:hasEnteredMarker', currentZone)
  166. end
  167.  
  168. if not isInMarker and HasAlreadyEnteredMarker then
  169. HasAlreadyEnteredMarker = false
  170. TriggerEvent('esx_jojo_dusch:hasExitedMarker', LastZone)
  171. end
  172. end
  173. end)
  174.  
  175. -- Spelaren har ej duschat - particles
  176. RegisterNetEvent('esx_jojo_dusch:NoShower')
  177. AddEventHandler('esx_jojo_dusch:NoShower', function()
  178. local particleDictionary = "core"
  179. local particleName = "veh_respray_smoke"
  180.  
  181. RequestNamedPtfxAsset(particleDictionary)
  182. while not HasNamedPtfxAssetLoaded(particleDictionary) do
  183. Citizen.Wait(0)
  184. end
  185.  
  186. SetPtfxAssetNextCall(particleDictionary)
  187. bone = GetPedBoneIndex(GetPlayerPed(-1), 11816)
  188.  
  189. effect = StartParticleFxLoopedOnPedBone(particleName, GetPlayerPed(-1), 0.0, 0.0, -0.1, 130.0, 0.0, 0.0, bone, 0.02, false, false, false);
  190.  
  191. end)
  192.  
  193. -- Dusch smoke
  194. RegisterNetEvent('esx_jojo_dusch:duschsmoke')
  195. AddEventHandler('esx_jojo_dusch:duschsmoke', function()
  196. local particleDictionary = "scr_fm_mp_missioncreator"
  197. local particleName = "ent_amb_shower_steam"
  198.  
  199. RequestNamedPtfxAsset(particleDictionary)
  200. while not HasNamedPtfxAssetLoaded(particleDictionary) do
  201. Citizen.Wait(0)
  202. end
  203.  
  204. SetPtfxAssetNextCall(particleDictionary)
  205. bone = GetPedBoneIndex(GetPlayerPed(-1), 11816)
  206.  
  207. effect = StartParticleFxLoopedOnPedBone(particleName, GetPlayerPed(-1), 0.0, 0.0, -0.1, 90.0, 90.0, 20.0, bone, 2.0, false, false, false);
  208. Wait(18000)
  209. StopParticleFxLooped(effect, 0)
  210. end)
  211.  
  212. -- Frys gubben
  213. Citizen.CreateThread(function()
  214. while true do
  215. Wait(0)
  216. if IsControlPressed(0, Keys['E']) then
  217. DisableControlAction(0,21,true) -- disable sprint
  218. DisableControlAction(0,24,true) -- disable attack
  219. DisableControlAction(0,25,true) -- disable aim
  220. DisableControlAction(0,47,true) -- disable weapon
  221. DisableControlAction(0,58,true) -- disable weapon
  222. DisableControlAction(0,32,true) -- move (w)
  223. DisableControlAction(0,34,true) -- move (a)
  224. DisableControlAction(0,33,true) -- move (s)
  225. DisableControlAction(0,35,true) -- move (d)
  226. DisableControlAction(0,73,true) -- disable handsup
  227. end
  228. end
  229. end)
  230.  
  231. --notification
  232. function sendNotification(message, messageType, messageTimeout)
  233. TriggerEvent("pNotify:SendNotification", {
  234. text = message,
  235. type = messageType,
  236. queue = "dusha",
  237. timeout = messageTimeout,
  238. layout = "bottomCenter"
  239. })
  240. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement