Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- modules/police.lua
- RegisterServerEvent('handcuff:checkjob')
- AddEventHandler('handcuff:checkjob', function()
- local source = source
- local user_id = vRP.getUserId(source)
- if vRP.hasPermission(user_id,"police.handcuff") then
- TriggerClientEvent('cuff', source)
- end
- end)
- RegisterServerEvent('handcuff:cuffHim')
- AddEventHandler('handcuff:cuffHim', function()
- local source = source
- local user_id = vRP.getUserId({source})
- vRPclient.getNearestPlayer(source,{1.5},function(cplayer)
- if cplayer ~= nil then
- vRPclient.isHandcuffed(cplayer,{}, function(handcuffed)
- print(handcuffed)
- if handcuffed then
- print("off")
- vRPclient.toggleHandcuff(cplayer,{})
- TriggerClientEvent("pNotify:SendNotification", source,{text = {"Personen fik l�snet sine h�ndjern."}, type = "info", queue = "global", timeout = 3000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- else
- print("arrest")
- vRPclient.getArrested(cplayer,{})
- vRPclient.arrestAnim(source,{}, function(done)
- while not done do
- Wait(100)
- end
- print("done")
- vRPclient.toggleHandcuff(cplayer,{})
- TriggerClientEvent("pNotify:SendNotification", source,{text = {"Personen blev sat i h�ndjern."}, type = "info", queue = "global", timeout = 3000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- end)
- end
- end)
- else
- TriggerClientEvent("pNotify:SendNotification", source,{text = {lang.common.no_player_near()}, type = "error", queue = "global", timeout = 4000, layout = "centerLeft",animation = {open = "gta_effects_fade_in", close = "gta_effects_fade_out"}})
- end
- end)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement