Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.57 KB | None | 0 0
  1. function unholster1h(weaponHash)
  2.  
  3.     unholsteringactive = true
  4.  
  5.     local dict = "reaction@intimidation@1h"
  6.     local anim = "intro"
  7.     local PlayerData = exports["isPed"]:isPed("")
  8.     local ped = GetPlayerPed(-1)
  9.  
  10.     if PlayerData.job ~= nil and PlayerData.job.name == 'police' then
  11.         copunholster(weaponHash)
  12.         if weaponHash == GetHashKey("WEAPON_COMBATPISTOL") then
  13.             GiveWeaponComponentToPed(GetPlayerPed(-1), GetHashKey("WEAPON_COMBATPISTOL"), GetHashKey("COMPONENT_AT_PI_FLSH") )
  14.         end
  15.         Citizen.Wait(450)
  16.         unholsteringactive = false
  17.         return
  18.     end
  19.  
  20.     RemoveAllPedWeapons(ped)
  21.     local animLength = GetAnimDuration(dict, anim) * 1000
  22.     loadAnimDict(dict)
  23.     TaskPlayAnim(ped, dict, anim, 1.0, 1.0, -1, 50, 0, 0, 0, 0)
  24.     Citizen.Wait(900)
  25.  
  26.     GiveWeaponToPed(ped, weaponHash, getAmmo(weaponHash), 0, 1)
  27.    
  28.     SetCurrentPedWeapon(ped, weaponHash, 1)
  29.     Citizen.Wait(500)
  30.     ClearPedTasks(ped)
  31.     Citizen.Wait(1000)
  32.     unholsteringactive = false
  33.  
  34. end
  35.  
  36. function copunholster(weaponHash)
  37.   local dic = "reaction@intimidation@cop@unarmed"
  38.   local anim = "intro"
  39.   local ammoCount = 0
  40.    loadAnimDict( dic )
  41.  
  42.     local ped = GetPlayerPed(-1)
  43.     RemoveAllPedWeapons(ped)
  44.  
  45.     TaskPlayAnim(ped, dic, anim, 10.0, 2.3, -1, 49, 1, 0, 0, 0 )
  46.  
  47.     Citizen.Wait(600)
  48.  
  49.     GiveWeaponToPed(ped, weaponHash, getAmmo(weaponHash), 0, 1)
  50.    
  51.     SetCurrentPedWeapon(ped, weaponHash, 1)
  52.     ClearPedTasks(ped)
  53. end
  54.  
  55. function copholster()
  56.  
  57.   local dic = "reaction@intimidation@cop@unarmed"
  58.   local anim = "intro"
  59.   local ammoCount = 0
  60.    loadAnimDict( dic )
  61.  
  62.     local ped = GetPlayerPed(-1)
  63.     prevupdate = 0
  64.     updateAmmo()
  65.  
  66.     TaskPlayAnim(ped, dic, anim, 10.0, 2.3, -1, 49, 1, 0, 0, 0 )
  67.  
  68.     Citizen.Wait(600)
  69.     SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), 1)
  70.     RemoveAllPedWeapons(ped)
  71.     ClearPedTasks(ped)
  72. end
  73.  
  74. function holster1h()
  75.     unholsteringactive = true
  76.     local dict = "reaction@intimidation@1h"
  77.     local anim = "outro"
  78.     local PlayerData = exports["isPed"]:isPed("")
  79.   if PlayerData.job ~= nil and PlayerData.job.name == 'police' then
  80.         copholster()
  81.         Citizen.Wait(600)
  82.         unholsteringactive = false
  83.         return
  84.     end
  85.     local ped = GetPlayerPed(-1)
  86.     prevupdate = 0
  87.     updateAmmo()
  88.     local animLength = GetAnimDuration(dict, anim) * 1000
  89.     loadAnimDict(dict)
  90.     TaskPlayAnim(ped, dict, anim, 1.0, 1.0, -1, 50, 0, 0, 0, 0)  
  91.     Citizen.Wait(animLength - 2200)
  92.    
  93.     SetCurrentPedWeapon(ped, GetHashKey("WEAPON_UNARMED"), 1)
  94.     Citizen.Wait(300)
  95.     RemoveAllPedWeapons(ped)
  96.     ClearPedTasks(ped)
  97.     Citizen.Wait(800)
  98.     unholsteringactive = false
  99. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement