Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function OpenHandcuffsmenu()
- ESX.UI.Menu.CloseAll()
- ESX.UI.Menu.Open(
- 'default', GetCurrentResourceName(), 'handcuff_actions',
- {
- title = _U('handcuffmenu'),
- align = 'bottom-right',
- elements = {
- {label = _U('search'), value = 'body_search'},
- {label = _U('handcuff'), value = 'handcuff'},
- {label = _U('drag'), value = 'drag'},
- {label = _U('put_in_vehicle'), value = 'put_in_vehicle'},
- {label = _U('out_the_vehicle'), value = 'out_the_vehicle'}
- }
- },
- function(data, menu)
- local player, distance = ESX.Game.GetClosestPlayer()
- if distance ~= -1 and distance <= 3.0 then
- local action = data.current.value
- if action == 'body_search' then
- OpenStealMenu(player)
- elseif action == 'handcuff' then
- TriggerEvent('esx_handcuffs:cuffcheck', GetPlayerServerId(player))
- elseif action == 'drag' then
- TriggerServerEvent('esx_handcuffs:drag', GetPlayerServerId(player))
- elseif action == 'put_in_vehicle' then
- TriggerServerEvent('esx_handcuffs:putInVehicle', GetPlayerServerId(player))
- elseif action == 'out_the_vehicle' then
- TriggerServerEvent('esx_handcuffs:OutVehicle', GetPlayerServerId(player))
- end
- else
- ESX.ShowNotification(_U('no_players_nearby'))
- end
- end,
- function(data, menu)
- menu.close()
- end
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement