Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1.  
  2. --- DO NOT EDIT THIS --
  3. local holstered = true
  4. local blocked = false
  5. local PlayerData = {}
  6. ------------------------
  7.  
  8.  
  9.  
  10.  
  11. Citizen.CreateThread(function()
  12. while true do
  13. Citizen.Wait(0)
  14. loadAnimDict("rcmjosh4")
  15. loadAnimDict("weapons@pistol@")
  16. loadAnimDict("reaction@intimidation@cop@unarmed")
  17. local ped = PlayerPedId()
  18. if not IsPedInAnyVehicle(ped, false) then
  19. if DoesEntityExist( ped ) and not IsEntityDead( ped ) and GetVehiclePedIsTryingToEnter(ped) == 0 and not IsPedInParachuteFreeFall (ped) then
  20. if CheckWeapon(ped) then
  21. --if IsPedArmed(ped, 4) then
  22. if holstered then
  23. blocked = true
  24. TaskPlayAnim(ped, "reaction@intimidation@cop@unarmed", "intro", 8.0, 2.0, -1, 50, 2.0, 0, 0, 0 )
  25. TaskPlayAnim(ped, "rcmjosh4", "josh_leadout_cop2", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
  26. Citizen.Wait(600)
  27. ClearPedTasks(ped)
  28. holstered = false
  29. else
  30. blocked = false
  31. end
  32. else
  33. --elseif not IsPedArmed(ped, 4) then
  34. if not holstered then
  35. TaskPlayAnim(ped, "weapons@pistol@", "aim_2_holster", 8.0, 2.0, -1, 48, 10, 0, 0, 0 )
  36. Citizen.Wait(500)
  37. ClearPedTasks(ped)
  38. holstered = true
  39. end
  40. end
  41. else
  42. SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), true)
  43. end
  44. else
  45. holstered = false
  46. end
  47. end
  48. end)
  49.  
  50. Citizen.CreateThread(function()
  51. while true do
  52. Citizen.Wait(0)
  53. if blocked then
  54. DisableControlAction(1, 25, true )
  55. DisableControlAction(1, 140, true)
  56. DisableControlAction(1, 141, true)
  57. DisableControlAction(1, 142, true)
  58. DisableControlAction(1, 23, true)
  59. DisableControlAction(1, 37, true) -- Disables INPUT_SELECT_WEAPON (TAB)
  60. DisablePlayerFiring(ped, true) -- Disable weapon firing
  61. end
  62. end
  63. end)
  64.  
  65.  
  66. function CheckWeapon(ped)
  67. --[[if IsPedArmed(ped, 4) then
  68. return true
  69. end]]
  70. for i = 1, #Config.Weapons do
  71. if GetHashKey(Config.Weapons[i]) == GetSelectedPedWeapon(ped) then
  72. return true
  73. end
  74. end
  75. return false
  76. end
  77.  
  78.  
  79. function loadAnimDict(dict)
  80. while ( not HasAnimDictLoaded(dict)) do
  81. RequestAnimDict(dict)
  82. Citizen.Wait(0)
  83. end
  84. end
  85.  
  86. Citizen.CreateThread(function() while true do Citizen.Wait(30000) collectgarbage() end end) -- Corrigir vazamentos de RAM coletando lixo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement