Advertisement
Guest User

Untitled

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