Jump to content

Spectate During Client Download


Ma5ter

Recommended Posts

I want to know what i'll need to have clients spectate other clients that are finished downloading in game. I do not expect you to do this for me but, at the very least I want to know what i'll need in order to do this. Doing this because my download is huge. I know i'm asking a lot but how would I play music during downloads too?

Link to comment

Nobody is spectating and text doesnt show during download, but afterwards.

--server  
DownloadDisplay = textCreateDisplay() 
Text = textCreateTextItem("Welcome to Ma5ter's World, the download is large and we apologize for that inconvenience. ", 0.5, 0.5) 
textDisplayAddText(DownloadDisplay, Text) 
addEventHandler("onPlayerJoin", root, 
function() 
local player = getRandomPlayer() 
local x, y, z, x2, y2, z2 = getCameraMatrix(player) 
textDisplayAddObserver(DownloadDisplay, source) 
 -- slowly fade the camera in to make the screen visible 
fadeCamera(source, true, 5) 
-- set the player's camera to a fixed position, looking at a fixed point 
playSound("mall.mp3", true) 
setCameraMatrix( x+0.5, y, z, x2, y2, z2 ) 
end) 
   
addEvent("onClientDownloadFinish", true) 
 addEventHandler("onClientDownloadFinish", root, 
 function() 
if textDisplayIsObserver(DownloadDisplay, source) then 
textDisplayRemoveObserver(DownloadDisplay, source) 
     end 
end) 

--client 
 resourceRoot = getResourceRootElement (getThisResource()) 
function checkTransfer() 
 if isTransferBoxActive() == true then 
 setTimer(checkTransfer,1000, 1) 
            
        end 
 end 
 addEventHandler("onClientResourceStart", resourceRoot, checkTransfer) 
 Timer = setTimer(function() 
     if not isTransferBoxActive() then 
         triggerServerEvent("onClientDownloadFinish", localPlayer) 
         if isTimer(Timer) then killTimer(Timer) end 
     end 
 end, 1000, 0) 

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...