Jump to content

Search the Community

Showing results for tags 'playvideo'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. function playVideo (posX, posY, width, height, url, duration, canClose, postGUI) if not posX or not posY or not width or not height or not url then return false end local webBrowser = false closeButton = guiCreateButton (0.97, 0, 0.03, 0.03, "X", true) guiSetAlpha (closeButton, 0.5) guiSetVisible (closeButton, false) if not isElement (webBrowser) then webBrowser = createBrowser (width, height, false, false) function createVideoPlayer () function webBrowserRender () dxDrawImage (posX, posY, width, height, webBrowser, 0, 0, 0, tocolor(255,255,255,255), postGUI) end loadBrowserURL (webBrowser, url) setTimer (function() addEventHandler ("onClientRender", getRootElement(), webBrowserRender) showChat (false) if canClose then guiSetVisible (closeButton, true) showCursor (true) end end, 500, 1) setElementFrozen (localPlayer, true) if duration then videoTimer = setTimer (function() removeEventHandler ("onClientRender", getRootElement(), webBrowserRender) setElementFrozen (localPlayer, false) guiSetVisible (closeButton, false) showCursor (false) showChat (true) destroyElement (webBrowser) end, duration, 1) end addEventHandler ("onClientGUIClick", closeButton, function (button, state) if button == "left" then if isTimer (videoTimer) then killTimer (videoTimer) videoTimer = nil removeEventHandler ("onClientRender", getRootElement(), webBrowserRender) setElementFrozen (localPlayer, false) guiSetVisible (closeButton, false) showCursor (false) showChat (true) destroyElement (webBrowser) end end end, false) end setTimer (createVideoPlayer, 500, 1) end end
×
×
  • Create New...