Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.11 KB | None | 0 0
  1. function GetScaleform(str)
  2.     return RequestScaleformMovie(str)
  3. end
  4.  
  5. -- pass the above result into the following functions for them to work properly.
  6.  
  7. function UnloadScaleform(handle)
  8.     if IsLoaded(handle) then
  9.         SetScaleformMovieAsNoLongerNeeded(handle)
  10.     end
  11. end
  12.  
  13. function IsLoaded(handle)
  14.     return HasScaleformMovieLoaded(handle)
  15. end
  16.  
  17. function IsValid(handle)
  18.     return handle ~= 0
  19. end
  20.  
  21. function CallFunction(handle, func, ...)
  22.     args = {...}
  23.    
  24.     PushScaleformMovieFunction(handle, func)
  25.    
  26.     for i,v in ipairs(args) do -- Using ipairs ensures the order of args given.
  27.         if type(v) == "int" then
  28.             PushScaleformMovieFunctionParameterInt(v)
  29.         else if type(v) == "string" then
  30.             BeginTextCommandScaleformString()
  31.             AddTextComponentSubstringPlayerName(v) -- Why not PushScaleformMovieFunctionParameterString instead of this block????
  32.             EndTextCommandScaleformString()
  33.         else if type(v) == "float" then
  34.             PushScaleformMovieFunctionParameterFloat(v)
  35.         else if type(v) == "bool" then
  36.             PushScaleformMovieFunctionParameterBool(v)
  37. --[[    else if type(v) == "ScaleformArgumentTXD" then
  38.             PushScaleformMovieFunctionParameterString(v) ]] -- What do I do here?
  39.         else
  40.             print("Unknown Argument Type Passed Into Scaleform With Handle " .. handle)
  41.         end
  42.     end
  43.    
  44.     PopScaleformMovieFunctionVoid() -- Remove void to retrieve data from the func.
  45. end
  46.  
  47. function RenderFullscreen(handle, r, g, b, a) -- 255 for each by default
  48.     if r,g,b,a == nil then
  49.         r,g,b,a = 255
  50.     end
  51.     DrawScaleformMovieFullscreen(handle, r, g, b, a, 0)
  52. end
  53.  
  54. function RenderRegion(handle, x, y, width, height, r, g, b, a) -- 255 for each by default
  55.     if r,g,b,a == nil then
  56.         r,g,b,a = 255
  57.     end
  58.     DrawScaleformMovie(handle, x, y, width, height, r, g, b, a, 0
  59. end
  60.  
  61. function RenderScaleform3D(xpos, ypos, zpos, xrot, yrot, zrot, xscale, yscale, zscale)
  62.     DrawScaleformMovie3dNonAdditive(xpos, ypos, zpos, xrot, yrot, zrot, 2.0, 2.0, 1.0, xscale, yscale, zscale)
  63. end
  64.  
  65. function RenderAdditive3D(xpos, ypos, zpos, xrot, yrot, zrot, xscale, yscale, zscale)
  66.     DrawScaleformMovie3d(xpos, ypos, zpos, xrot, yrot, zrot, 2.0, 2.0, 1.0, xscale, yscale, zscale)
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement