Guest User

Untitled

a guest
Nov 25th, 2017
7,075
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. RegisterNetEvent('esx_basicneeds:onVodka')
  2. AddEventHandler('esx_basicneeds:onVodka', function(prop_name)
  3. if not IsAnimated then
  4. local prop_name = prop_name or 'prop_cs_whiskey_bottle'
  5. IsAnimated = true
  6. local playerPed = GetPlayerPed(-1)
  7. Citizen.CreateThread(function()
  8. local x,y,z = table.unpack(GetEntityCoords(playerPed))
  9. prop = CreateObject(GetHashKey(prop_name), x, y, z+0.2, true, true, true)
  10. AttachEntityToEntity(prop, playerPed, GetPedBoneIndex(playerPed, 18905), 0.12, 0.028, 0.001, 10.0, 175.0, 0.0, true, true, false, true, 1, true)
  11. RequestAnimDict('mp_player_intdrink')
  12. while not HasAnimDictLoaded('mp_player_intdrink') do
  13. Wait(0)
  14. end
  15. TaskPlayAnim(playerPed, 'mp_player_intdrink', 'loop_bottle', 1.0, -1.0, 2000, 0, 1, true, true, true)
  16. Wait(3000)
  17. IsAnimated = false
  18. ClearPedSecondaryTask(playerPed)
  19. DeleteObject(prop)
  20. end)
  21. end
  22. end)
RAW Paste Data