Advertisement
Guest User

Untitled

a guest
Mar 17th, 2017
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. local cuffed = false -- store wether we are handcuffed or not
  2.  
  3. RegisterNetEvent("mHandcuff")
  4. AddEventHandler("mHandcuff", function()
  5.   if DoesEntityExist(GetPlayerPed(-1))
  6.     RequestAnimDict("mp_arresting")
  7.  
  8.     while not HasAnimDictLoaded("mp_arresting")
  9.       Citizen.Wait(0)
  10.     end
  11.  
  12.     if cuffed then
  13.       ClearPedSecondaryTask(GetPlayerPed(-1))
  14.       SetEnableHandcuffs(GetPlayerPed(-1), false)
  15.       cuffed = false
  16.     else
  17.       ClearPedSecondaryTask(GetPlayerPed(-1))
  18.       TaskPlayAnim(GetPlayerPed(-1), "mp_arresting", "idle", 8.0, -8, -1, 49, 0, 0, 0, 0)
  19.       SetEnableHandcuffs(GetPlayerPed(-1), true)
  20.       cuffed = true
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement