Jump to content

Music by download screen


Recommended Posts

Hello scripters,

I have a question.

Is it possible to add music on the download screen?

Now i have a scripts that makes it able when you are download the resources you will see something of the server( a cam)

But is it also possible to add some music will you are wating?

Client.lua

addEventHandler("onClientResourceStart",resourceRoot,
   function ()
       triggerServerEvent("removeText",localPlayer)
   end
)

server.lua

dawnlodetext1 = "  welcome to SARS:RPG 3.0" --- the text up
dawnlodetext2 = "Downloading resources..." --- the text in medium
dawnlodetext3 = "http://www.sars-rpg.com/" --- the text under




dis = textCreateDisplay()
screentext = textCreateTextItem(dawnlodetext1,0.2,0.2,"medium",255,0,0,255,3)
textDisplayAddText(dis,screentext)


dis1 = textCreateDisplay()
screentext1 = textCreateTextItem(dawnlodetext2,0.3,0.4,"medium",0,255,0,255,3)
textDisplayAddText(dis1,screentext1)


dis2 = textCreateDisplay()
screentext2 = textCreateTextItem(dawnlodetext3,0.4,0.6,"medium",255,255,0,255,3)
textDisplayAddText(dis2,screentext2)



addEventHandler("onResourceStart",resourceRoot,
   function ()
       for i,p in ipairs(getElementsByType("player")) do
           textDisplayAddObserver(dis,p)
           textDisplayAddObserver(dis1,p)
           textDisplayAddObserver(dis2,p)
       end
   end
)




addEventHandler("onPlayerJoin",root,
   function ()

 fadeCamera(source, true, 5)
setCameraMatrix(source, -1662.5999755859, 443.70001220703, 94.5, -1673, 480.29998779297, 106.09999847412)
       textDisplayAddObserver(dis,source)
       textDisplayAddObserver(dis1,source)
       textDisplayAddObserver(dis2,source)
   end
)




addEvent("removeText",true)
addEventHandler("removeText",root,
   function ()
       textDisplayRemoveObserver(dis,source)
       textDisplayRemoveObserver(dis1,source)
       textDisplayRemoveObserver(dis2,source)
   end
)

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