Advertisement
Guest User

server.lua

a guest
Jan 23rd, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. function OpenHandcuffsmenu()
  2. ESX.UI.Menu.CloseAll()
  3.  
  4. ESX.UI.Menu.Open(
  5. 'default', GetCurrentResourceName(), 'handcuff_actions',
  6. {
  7. title = _U('handcuffmenu'),
  8. align = 'bottom-right',
  9. elements = {
  10. {label = _U('search'), value = 'body_search'},
  11. {label = _U('handcuff'), value = 'handcuff'},
  12. {label = _U('drag'), value = 'drag'},
  13. {label = _U('put_in_vehicle'), value = 'put_in_vehicle'},
  14. {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}
  15. }
  16. },
  17. function(data, menu)
  18.  
  19. local player, distance = ESX.Game.GetClosestPlayer()
  20.  
  21. if distance ~= -1 and distance <= 3.0 then
  22. local action = data.current.value
  23.  
  24. if action == 'body_search' then
  25. OpenStealMenu(player)
  26. elseif action == 'handcuff' then
  27. TriggerEvent('esx_handcuffs:cuffcheck', GetPlayerServerId(player))
  28. elseif action == 'drag' then
  29. TriggerServerEvent('esx_handcuffs:drag', GetPlayerServerId(player))
  30. elseif action == 'put_in_vehicle' then
  31. TriggerServerEvent('esx_handcuffs:putInVehicle', GetPlayerServerId(player))
  32. elseif action == 'out_the_vehicle' then
  33. TriggerServerEvent('esx_handcuffs:OutVehicle', GetPlayerServerId(player))
  34. end
  35.  
  36. else
  37. ESX.ShowNotification(_U('no_players_nearby'))
  38. end
  39.  
  40. end,
  41. function(data, menu)
  42. menu.close()
  43. end
  44. )
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement