Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 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. ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  11. }
  12.  
  13. local GUI = {}
  14. ESX = nil
  15. GUI.Time = 0
  16. local PlayerData = {}
  17.  
  18. Citizen.CreateThread(function()
  19. while ESX == nil do
  20. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  21. Citizen.Wait(0)
  22. end
  23. end)
  24.  
  25. RegisterNetEvent('esx:playerLoaded')
  26. AddEventHandler('esx:playerLoaded', function(xPlayer)
  27. PlayerData = xPlayer
  28. end)
  29.  
  30. RegisterNetEvent('esx:setJob')
  31. AddEventHandler('esx:setJob', function(job)
  32. PlayerData.job = job
  33. end)
  34.  
  35. function OpenDynamicMenu()
  36.  
  37. ESX.UI.Menu.CloseAll()
  38.  
  39. ESX.UI.Menu.Open(
  40. 'default', GetCurrentResourceName(), 'dynamic_actions',
  41. {
  42. title = 'Personmeny',
  43. align = 'top-left',
  44. elements = {
  45. {label = ('Sätt på buntband'), value = 'cuff'},
  46. {label = ('Ögonbindel'), value = 'blindfold_interaction'},
  47. {label = ('ID'), value = 'citizen_interaction'},
  48. },
  49. },
  50. function(data, menu)
  51.  
  52. if data.current.value == 'blindfold' then
  53. local player, distance = ESX.Game.GetClosestPlayer()
  54.  
  55. if distance ~= -1 and distance <= 3.0 then
  56. TriggerServerEvent('jsfour-blindfold', GetPlayerServerId(player))
  57. else
  58. ESX.ShowNotification('Ingen i närheten')
  59. end
  60. end
  61.  
  62. if data.current.value == 'cuff' then
  63. local player, distance = ESX.Game.GetClosestPlayer()
  64. if distance ~= -1 and distance <= 3.0 then
  65. TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player))
  66. else
  67. ESX.ShowNotification('Ingen i närheten')
  68. end
  69. end
  70.  
  71.  
  72. if data.current.value == 'citizen_interaction' then
  73.  
  74. ESX.UI.Menu.Open(
  75. 'default', GetCurrentResourceName(), 'citizen_interaction',
  76. {
  77. title = 'IDMeny',
  78. align = 'top-left',
  79. elements = {
  80. {label = 'Se ID kort', value = 'seeid'},
  81. {label = 'Visa ditt ID kort', value = 'showid'},
  82. },
  83. },
  84. function(data2, menu2)
  85.  
  86. if data2.current.value == 'showid' then
  87. TriggerServerEvent('gcIdentity:showIdentity', GetPlayerServerId(player))
  88. end
  89.  
  90. if data2.current.value == 'seeid' then
  91. TriggerServerEvent('gcIdentity:openMeIdentity', GetPlayerServerId(player))
  92. end
  93.  
  94. end,
  95. function(data2, menu2)
  96. menu2.close()
  97. end
  98. )
  99.  
  100. if data.current.value == 'blindfold_interaction' then
  101.  
  102. ESX.UI.Menu.Open(
  103. 'default', GetCurrentResourceName(), 'blindfold_interaction',
  104. {
  105. title = 'Ögonbindelmeny',
  106. align = 'top-left',
  107. elements = {
  108. {label = 'Sätt på ögonbindel', value = 'blindfold'},
  109. {label = 'Ta av ögonbindel', value = 'remblindfold'},
  110. },
  111. },
  112. function(data3, menu3)
  113.  
  114. if data3.current.value == 'blindfold' then
  115. local player, distance = ESX.Game.GetClosestPlayer()
  116.  
  117. if distance ~= -1 and distance <= 3.0 then
  118. TriggerServerEvent('jsfour-blindfold', GetPlayerServerId(player))
  119. else
  120. ESX.ShowNotification('Ingen i närheten')
  121. end
  122. end
  123.  
  124. if data3.current.value == 'remblindfold' then
  125. local player, distance = ESX.Game.GetClosestPlayer()
  126.  
  127. if distance ~= -1 and distance <= 3.0 then
  128. TriggerServerEvent('jsfour-blindfold', GetPlayerServerId(player))
  129. else
  130. ESX.ShowNotification('Ingen i närheten')
  131. end
  132. end
  133.  
  134. end,
  135. function(data3, menu3)
  136. menu3.close()
  137. end
  138. )
  139.  
  140. end
  141.  
  142. end
  143. end,
  144. function(data, menu)
  145. menu.close()
  146. end
  147. )
  148. end
  149.  
  150. -- knapp
  151. Citizen.CreateThread(function()
  152. while true do
  153. Wait(0)
  154. if IsControlPressed(0, Keys["PAGEDOWN"]) then
  155. OpenDynamicMenu()
  156. end
  157. end
  158. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement