Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. -- HOLD WEAPON HOLSTER ANIMATION --
  2.  
  3. Citizen.CreateThread( function()
  4. while true do
  5. Citizen.Wait( 0 )
  6. local ped = PlayerPedId()
  7. if DoesEntityExist( ped ) and not IsEntityDead( ped ) and not IsPedInAnyVehicle(PlayerPedId(), true) and CheckSkin(ped) then
  8. DisableControlAction( 0, 249, true ) -- INPUT_MULTIPLAYER_INFO (n)
  9. if not IsPauseMenuActive() then
  10. loadAnimDict( "reaction@intimidation@cop@unarmed" )
  11. if IsDisabledControlJustReleased( 0, 249 ) then -- INPUT_MULTIPLAYER_INFO (n)
  12. ClearPedTasks(ped)
  13. SetEnableHandcuffs(ped, false)
  14. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  15. else
  16. if IsDisabledControlJustPressed( 0, 249 ) and CheckSkin(ped) then -- INPUT_MULTIPLAYER_INFO (n)
  17. SetEnableHandcuffs(ped, true)
  18. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  19. TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "intro", 8.0, 2.0, -1, 50, 2.0, 0, 0, 0 )
  20. end
  21. if IsEntityPlayingAnim(GetPlayerPed(PlayerId()), "reaction@intimidation@cop@unarmed", "intro", 3) then
  22. DisableActions(ped)
  23. end
  24. end
  25. end
  26. end
  27. end
  28. end )
  29.  
  30. -- HOLSTER/UNHOLSTER PISTOL --
  31.  
  32. Citizen.CreateThread(function()
  33. while true do
  34. Citizen.Wait(0)
  35. local ped = PlayerPedId()
  36. if DoesEntityExist( ped ) and not IsEntityDead( ped ) and not IsPedInAnyVehicle(PlayerPedId(), true) and CheckSkin(ped) then
  37. loadAnimDict( "rcmjosh4" )
  38. loadAnimDict( "weapons@pistol@" )
  39. if CheckWeapon(ped) then
  40. if holstered then
  41. TaskPlayAnim(ped, "rcmjosh4", "josh_leadout_cop2", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
  42. Citizen.Wait(600)
  43. ClearPedTasks(ped)
  44. holstered = false
  45. end
  46. SetPedComponentVariation(ped, 9, 0, 0, 0)
  47. elseif not CheckWeapon(ped) then
  48. if not holstered then
  49. TaskPlayAnim(ped, "weapons@pistol@", "aim_2_holster", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
  50. Citizen.Wait(500)
  51. ClearPedTasks(ped)
  52. holstered = true
  53. end
  54. SetPedComponentVariation(ped, 9, 1, 0, 0)
  55. end
  56. end
  57. end
  58. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement