Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 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. ESX = nil
  14. local GUI = {}
  15. local isDead = false
  16. GUI.Time = 0
  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. function OpenCivilianActionsMenu()
  26.  
  27. ESX.UI.Menu.CloseAll()
  28.  
  29. ESX.UI.Menu.Open(
  30. 'default', GetCurrentResourceName(), 'id_card_menu',
  31. {
  32. title = 'Personmeny',
  33. align = 'top-left',
  34. elements = {
  35. {label = 'Bajsa', value = 'poop'},
  36. {label = 'Kissa', value = 'pee'},
  37. {label = 'Mina ID-Handlingar', value = 'check'},
  38. {label = 'Ge ID-Handlingar till närmsta personen', value = 'show'},
  39. {label = 'Ta På/Av ögonbindel på närmsta personen', value = 'blindfold'},
  40. },
  41. },
  42.  
  43. function(data, menu)
  44.  
  45. if data.current.value == 'uncuff' then
  46. TriggerEvent('esx_handcuffs:unlockingcuffs')
  47. end
  48.  
  49. if data.current.value == 'poop' then
  50. TriggerEvent('poop')
  51. end
  52.  
  53. if data.current.value == 'pee' then
  54. TriggerEvent('pee')
  55. end
  56.  
  57. if data.current.value == 'blindfold' then
  58. local player, distance = ESX.Game.GetClosestPlayer()
  59.  
  60. if distance ~= -1 and distance <= 3.0 then
  61. ESX.TriggerServerCallback('jsfour-blindfold:itemCheck', function( hasItem )
  62. TriggerServerEvent('jsfour-blindfold', GetPlayerServerId(player), hasItem)
  63. end)
  64. else
  65. ESX.ShowNotification('Ingen i närheten')
  66. end
  67. end
  68.  
  69. if data.current.value == 'check' then
  70. TriggerServerEvent('jsfour-legitimation:open', GetPlayerServerId(PlayerId()), GetPlayerServerId(PlayerId()))
  71. elseif data.current.value == 'show' then
  72. local player, distance = ESX.Game.GetClosestPlayer()
  73.  
  74. if distance ~= -1 and distance <= 3.0 then
  75. TriggerServerEvent('jsfour-legitimation:open', GetPlayerServerId(PlayerId()), GetPlayerServerId(player))
  76. else
  77. ESX.ShowNotification('Ingen i närheten')
  78. end
  79. end
  80. end,
  81. function(data, menu)
  82. menu.close()
  83. end
  84. )
  85.  
  86. end
  87.  
  88.  
  89.  
  90. -- Key Controls
  91. Citizen.CreateThread(function()
  92. while true do
  93. Citizen.Wait(0)
  94.  
  95. if IsControlJustReleased(0, Keys['F5']) then
  96. OpenCivilianActionsMenu()
  97. end
  98.  
  99. end
  100. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement