Advertisement
Guest User

Untitled

a guest
Jan 13th, 2018
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. --HandCuff start
  2.  
  3. local handcuffconfig = {
  4. model = "prop_cs_cuffs_01",
  5. handcuffs = nil
  6. }
  7.  
  8.  
  9. --[[ HANDCUFF SCRIPT ]]--
  10. RegisterNetEvent("Handcuff")
  11. AddEventHandler("Handcuff", function()
  12. local lPed = GetClosestPlayer
  13. if DoesEntityExist(lPed) then
  14. if IsEntityPlayingAnim(lPed, "mp_arresting", "idle", 3) then
  15. --DetachEntity(handcuffconfig.handcuffs, 0, 0)
  16. --DeleteEntity(handcuffconfig.handcuffs)
  17. --handcuffconfig.handcuffs = nil
  18. ClearPedSecondaryTask(lPed)
  19. SetEnableHandcuffs(lPed, false)
  20. SetCurrentPedWeapon(lPed, GetHashKey("WEAPON_UNARMED"), true)
  21. else
  22. RequestAnimDict("mp_arresting")
  23. while not HasAnimDictLoaded("mp_arresting") do
  24. Citizen.Wait(100)
  25. end
  26.  
  27. --RequestModel(GetHashKey(handcuffconfig.model))
  28. --while not HasModelLoaded(GetHashKey(handcuffconfig.model)) do
  29. --Citizen.Wait(100)
  30. --end
  31.  
  32. --local plyCoords = GetEntityCoords(GetPlayerPed(PlayerId()), false)
  33. --handcuffconfig.handcuffs = CreateObject(GetHashKey(handcuffconfig.model), plyCoords.x, plyCoords.y, plyCoords.z, 1, 1, 1)
  34.  
  35. --AttachEntityToEntity(handcuffconfig.handcuffs, GetPlayerPed(PlayerId()), GetPedBoneIndex(GetPlayerPed(PlayerId()), 60309), 0.0, 0.05, 0.0, 0.0, 0.0, 80.0, 1, 0, 0, 0, 0, 1)
  36.  
  37. TaskPlayAnim(lPed, "mp_arresting", "idle", 8.0, -8, -1, 49, 0, 0, 0, 0)
  38. SetEnableHandcuffs(lPed, true)
  39. SetCurrentPedWeapon(lPed, GetHashKey("WEAPON_UNARMED"), true)
  40. end
  41. end
  42. end)
  43.  
  44. --Handcuff end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement