Advertisement
izakj

Untitled

May 20th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.10 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, ["UP"] = 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 ESX = nil
  14.  
  15. Citizen.CreateThread(function()
  16. while ESX == nil do
  17. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  18. Citizen.Wait(0)
  19. end
  20. end)
  21.  
  22. function openMenu()
  23. ESX.UI.Menu.CloseAll()
  24.  
  25. ESX.UI.Menu.Open(
  26. 'default', GetCurrentResourceName(), 'toilet_menu',
  27. {
  28. title = 'Civil meny',
  29. elements = {
  30. {label = 'Kolla på ditt legg', value = 'check'},
  31. {label = 'Visa ditt legg', value = 'show'},
  32. {label = 'Applicera heltäckande mask', value = 'blindfold'},
  33. {label = ('Sök'), value = 'body_search'},
  34. {label = 'Buntband', value = 'handcuff'},
  35. {label = ('Eskortera'), value = 'drag'},
  36. {label = 'Kissa', value = 'pee'},
  37. {label = 'Bajsa', value = 'poop'},
  38. }
  39. },
  40. function(data, menu)
  41. if data.current.value == 'pee' then
  42. TriggerEvent('pee')
  43. elseif data.current.value == 'poop' then
  44. TriggerEvent('poop')
  45. elseif data.current.value == 'blindfold' then
  46. local player, distance = ESX.Game.GetClosestPlayer()
  47. if distance ~= -1 and distance <= 3.0 then
  48. ESX.TriggerServerCallback('jsfour-blindfold:itemCheck', function( hasItem )
  49. TriggerServerEvent('jsfour-blindfold', GetPlayerServerId(player), hasItem)
  50. end)
  51. else
  52. ESX.ShowNotification('Ingen i närheten')
  53. end
  54. elseif data.current.value == 'check' then
  55. TriggerServerEvent('jsfour-legitimation:open', GetPlayerServerId(PlayerId()), GetPlayerServerId(PlayerId()))
  56. elseif data.current.value == 'show' then
  57. local player, distance = ESX.Game.GetClosestPlayer()
  58. if distance ~= -1 and distance <= 3.0 then
  59. TriggerServerEvent('jsfour-legitimation:open', GetPlayerServerId(PlayerId()), GetPlayerServerId(player))
  60. else
  61. ESX.ShowNotification('Ingen i närheten')
  62. end
  63. elseif data.current.value == 'handcuff' then
  64. local player, distance = ESX.Game.GetClosestPlayer()
  65. if distance ~= -1 and distance <= 3.0 then
  66. TriggerServerEvent('esx_policejob:handcuff', GetPlayerServerId(player))
  67. else
  68. ESX.ShowNotification('Ingen i närheten')
  69. end
  70. elseif data.current.value == 'body_search' then
  71. local player, distance = ESX.Game.GetClosestPlayer()
  72. if distance ~= -1 and distance <= 3.0 then
  73. if IsEntityPlayingAnim(Player,'random@mugging3','handsup_standing_base') then
  74. TriggerEvent('izakj:openmenu',player)
  75. else
  76. ESX.ShowNotification('Ingen i närheten')
  77. end
  78. end
  79. elseif data.current.value == 'drag' then
  80. local player, distance = ESX.Game.GetClosestPlayer()
  81. if distance ~= -1 and distance <= 3.0 then
  82. TriggerServerEvent('esx_policejob:drag', GetPlayerServerId(player))
  83. else
  84. ESX.ShowNotification('Ingen i närheten')
  85. end
  86. end
  87. end,
  88. function(data, menu)
  89. menu.close()
  90. end
  91. )
  92. end
  93.  
  94. Citizen.CreateThread(function()
  95. while true do
  96. Wait(10)
  97. if IsControlJustReleased(0, Keys['K']) then
  98. openMenu()
  99. end
  100. end
  101. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement