Guest User

Untitled

a guest
Oct 12th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. ESX = nil
  2. Citizen.CreateThread(function()
  3. while ESX == nil do
  4. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  5. Citizen.Wait(0)
  6. end
  7. end)
  8. ---------------------------------------------------------------
  9. function loadScaleform(scaleform)
  10. local scaleformHandle = RequestScaleformMovie(scaleform)
  11. if HasScaleformMovieLoaded(scaleformHandle) then
  12. return scaleformHandle
  13. else
  14. scaleformHandle = RequestScaleformMovie(scaleform)
  15. end
  16. end
  17.  
  18. local url = 'https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/467725488&color=%23ff5500&auto_play=true&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true'
  19. local scale = 0.1
  20. local sfName = 'generic_texture_renderer'
  21. local width = 1280
  22. local height = 720
  23. local sfHandle = nillocal txdHasBeenSet = false
  24. local duiObj = nil
  25.  
  26. Citizen.CreateThread(function()
  27. while true do
  28. if sfHandle ~= nil and not txdHasBeenSet then
  29. PushScaleformMovieFunction(sfHandle, 'SET_TEXTURE')
  30. PushScaleformMovieMethodParameterString('meows')
  31. PushScaleformMovieMethodParameterString('woof')
  32. PushScaleformMovieFunctionParameterInt(0)
  33. PushScaleformMovieFunctionParameterInt(0)
  34. PushScaleformMovieFunctionParameterInt(width)
  35. PushScaleformMovieFunctionParameterInt(height)
  36. PopScaleformMovieFunctionVoid()
  37. txdHasBeenSet = true
  38. end
  39.  
  40. if sfHandle ~= nil and HasScaleformMovieLoaded(sfHandle) then
  41. DrawScaleformMovie_3dNonAdditive(
  42. sfHandle,
  43. pos[0] - 1, pos[1], pos[2] + 2,
  44. 0, 0, 0,
  45. 2, 2, 2,
  46. scale * 1, scale * (9/16), 1, 2)
  47. end
  48. end
  49. end)
  50.  
  51. AddEventHandler('playerSpawned', function(resName)
  52. if resName == GetCurrentResourceName() then
  53. local sfHandle = loadScaleform(sfName)
  54. runtimeTxd = 'meows'
  55. local txd = CreateRuntimeTxd('meows')
  56. local duiObj = CreateDui(url, width, height)
  57. local dui = GetDuiHandle(duiObj)
  58. local tx = CreateRuntimeTextureFromDuiHandle(txd, 'woof', dui)
  59. end
  60. end)
  61.  
  62. AddEventHandler('onResourceStop', function(resource)
  63. DestroyDui(duiObj)
  64. SetScaleformMovieAsNoLongerNeeded(sfName)
  65. end)
  66.  
  67.  
  68.  
  69.  
  70. AddEventHandler('noPermissions', function()
  71. drawNotification("~r~Nie masz odpowiednich permisji!")
  72. end)
  73. function drawNotification(text) --Just Don't Edit!
  74. SetNotificationTextEntry("STRING")
  75. AddTextComponentString(text)
  76. DrawNotification(false, false)
  77. end
Add Comment
Please, Sign In to add comment