Jump to content

Run a Resource before download


Desaster

Recommended Posts

Server Side:

DownloadDisplay = textCreateDisplay() 
Text = textCreateTextItem("Your text here ...", 0.5, 0.5) 
textDisplayAddText(DownloadDisplay, Text) 
  
addEventHandler("onPlayerJoin", root, 
function() 
    textDisplayAddObserver(DownloadDisplay, source) 
end) 
  
addEvent("onClientDownloadFinish", true) 
addEventHandler("onClientDownloadFinish", root, 
function() 
    if textDisplayIsObserver(DownloadDisplay, source) then 
        textDisplayRemoveObserver(DownloadDisplay, source) 
    end 
end) 

Client Side:

Timer = setTimer(function() 
    if not isTransferBoxActive() then 
        triggerServerEvent("onClientDownloadFinish", localPlayer) 
        if isTimer(Timer) then killTimer(Timer) end 
    end 
end, 1000, 0) 

Link to comment
Server Side:
DownloadDisplay = textCreateDisplay() 
Text = textCreateTextItem("Your text here ...", 0.5, 0.5) 
textDisplayAddText(DownloadDisplay, Text) 
  
addEventHandler("onPlayerJoin", root, 
function() 
    textDisplayAddObserver(DownloadDisplay, source) 
end) 
  
addEvent("onClientDownloadFinish", true) 
addEventHandler("onClientDownloadFinish", root, 
function() 
    if textDisplayIsObserver(DownloadDisplay, source) then 
        textDisplayRemoveObserver(DownloadDisplay, source) 
    end 
end) 

Client Side:

Timer = setTimer(function() 
    if not isTransferBoxActive() then 
        triggerServerEvent("onClientDownloadFinish", localPlayer) 
        if isTimer(Timer) then killTimer(Timer) end 
    end 
end, 1000, 0) 

offtopic; Waaaow, 3 total new sections of the wiki for me! .___. Thanks TAPL

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...