Jump to content
Sign in to follow this  
Aveline™

Music Player 1.5

Recommended Posts

Hello guys i will want to share something with your. Actually this quest public but i'll rewrite this quest i think it was a little perfect.

 

Quest : 

--[[
	
	* fileName 	  : musicPlayerSystem.quest
	* date	   	  : 15.03.2014
	* author   	  : HaveBeen™
	* description : - 
	
]]--
quest musicPlayer begin
	state start begin
		function load()
			local data = {}
			data.MapNames = {
				-- MapIndex	   MapName
				[1] 		= "Shinsoo Kingdom",
				[21]	    = "Chunjo Kingdom",
				[41]	    = "Jinno Kingdom",
			}
			data.MapIndexs = {1,21,41}
			data.Notice = "%s enjoy the music begins. Music name : %s"
			data.Notice2 = "For all the kingdoms of music. Music name : %s"
			data.Options = {"Add music for one map","Add music for all map","Close"}
			return data
		end
		function is_admin()
			local gmList = {"HaveBeen"}
			if(table.getn(gmList) >= 1) then
				if(gmList[1] == pc.name) then
					return true
				else
					return false
				end
			else
				for i = 1,table.getn(gmList),1 do
					if(gmList[i] == pc.name) then
						return true
					else
						return false
					end
				end
			end
		end
		when letter with pc.is_gm() and musicPlayer.is_admin() begin
			send_letter("Music Player")
		end
		when button or info begin
			say_title("Music Player:")
			say("")
			---
			say("What do you want?")
			local data = musicPlayer.load()
			local s = select_table(data.Options)
			if(s >= table.getn(data.Options)) then
				return
			end
			say_title(string.format("%s : ",data.Options[s]))
			say("")
			---			
			if(s >= 1) then
				say("Select a map.")
				say("")
				local q = {}
				for i = 1,table.getn(data.MapIndexs),1 do
					table.insert(q,data.MapNames[data.MapIndexs[i]])
					table.insert(q,"Close")
				end
				local t = select_table(q)
				if(t >= table.getn(q)) then
					return
				end
				say_title(string.format("%s enjoy the music",q[t]))
				say("")
				---
				say("Please write music name..")
				say("")
				local music = input()
				if(music == "" or tostring(music) == nil) then
					return
				end
				say_title(string.format("%s enjoy the music",q[t]))
				say("")
				---
				say("Music is starting.. ")
				say("Thanks! ")
				add_bgm_info(data.MapIndexs[t],music,0.5)
				notice_all(string.format(data.Notice,q[t],music))
			elseif(s >= 2) then
				say("Please write music name..")
				say("")
				local music = input()
				if(music == "" or tostring(music) == nil) then
					return
				end
				say_title(string.format("%s enjoy the music",q[t]))
				say("")
				---
				say("Music is starting.. ")
				say("Thanks! ")
				i = 0
				repeat
					i = i + 1
					add_bgm_info(data.MapIndexs[i],music,0.5)
				until i == table.getn(data.MapIndexs)
				notice_all(string.format(data.Notice2,music))
			end
		end
	end
end

I hope you're like it.

 

Regards.

  • Love 4

Share this post


Link to post

Ok that worked
Buuut when i reload q ch1 ch99 
There is no new quest....

 

Share this post


Link to post

Don't work.

When I click on letter nothing appears.

Share this post


Link to post

The music need to be in the client right?

Of course.

Share this post


Link to post

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
Sign in to follow this  
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.