Ma5ter Posted June 30, 2014 Share Posted June 30, 2014 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
Max+ Posted June 30, 2014 Share Posted June 30, 2014 isTransferBoxActive playSound Example , https://forum.multitheftauto.com/viewtopic.php?f=91&t=67275 Link to comment
Ma5ter Posted July 3, 2014 Author Share Posted July 3, 2014 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
arezu Posted July 3, 2014 Share Posted July 3, 2014 You can use server-side functions during download, so you can spectate another player while downloading by using setCameraTarget server-side in onPlayerJoin event. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now