Jump to content

Question

Posted (edited)

So i wrote this script to change the map BGM. (i got some part from other script too)

Please help me to add a delay request, and is it possible to make other player entered the map after request can hear it too?

casp_in01,49,187,6	script	Musician	479,{
mes "[Musician]";
mes "Relax for a sec, And you find T-ro the best place for u";
menu "Play a song for me",L_forme,"Play a song for everyone",L_foreveryone;
L_foreveryone:
	mes "What Song Would you like to play?";
	switch(select("I know a song:"+$@Songname$[0]+":"+$@Songname$[1]+":"+$@Songname$[2]+":None")) {
	case 1:
	mes "[Musician]";
	mes "Whats the file number.";
	mes "Example : 01,02,03 (in BGM file).";
	mes "Do not try to add your own music, other won't hear it.";
	mes "If you try to spam, you could be banned.!";
	next;
	input .@bgm$;
		playBGMall ""+.@bgm$+"",""+strcharinfo(3)+"";
		announce "Song ("+.@bgm$+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 2:
		playBGMall ""+$@Song$[0]+"",""+strcharinfo(3)+"";
		announce "Song ("+$@Songname$[0]+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 3:
		playBGMall ""+$@Song$[1]+"",""+strcharinfo(3)+"";
		announce "Song ("+$@Songname$[1]+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 4:
		playBGMall ""+$@Song$[2]+"",""+strcharinfo(3)+"";
		announce "Song ("+$@Songname$[2]+") is being played by "+strcharinfo(0)+"",bc_map,0x6bcea9;
		close;
	case 5:
		mes "[Musician]";
		mes "Keep Dancing!!!!";
		close;
		}
L_forme:
mes "What Song Would you like to play?";
	switch(select("I know a song:"+$@Songname$[0]+":"+$@Songname$[1]+":"+$@Songname$[2]+":None")) {
	case 1:
	mes "[Musician]";
	mes "Whats the file number.";
	mes "Example : 01,02,03 (in BGM file).";
	mes "Do not try to add your own music, other won't here it.";
	mes "If you try to spam, you could be banned.!";
	next;
	input .@bgm$;
		playBGM ""+.@bgm$+"";
		announce "Song ("+.@bgm$+") is being played",bc_map,0x6bcea9;
		close;
	case 2:
		playBGM ""+$@Song$[0]+"";
		announce "Song ("+$@Songname$[0]+") is being played",bc_self,0x6bcea9;
		close;
	case 3:
		playBGM ""+$@Song$[1]+"";
		announce "Song ("+$@Songname$[1]+") is being played",bc_self,0x6bcea9;
		close;
	case 4:
		playBGM ""+$@Song$[2]+"";
		announce "Song ("+$@Songname$[2]+") is being played",bc_self,0x6bcea9;
		close;
	case 5:
		mes "[Musician]";
		mes "Keep Dancing!!!!";
		close;
		}
oninit:
//Change music file names.
setarray $@Song$[0],"Eternity","03","04";
//music names.
setarray $@Songname$[0],"Eternity","Move your Body","Make a Move";
end;
}
caspen,168,224,6	duplicate(Musician)	Musiccian#caspen1	479
Edited by bearnope246

4 answers to this question

Recommended Posts

  • 0
Posted

You can't change the BGM played when someone new warps to a map since that is controlled via GRF files already.

 

On 7/21/2016 at 4:31 PM, Stolao said:

OnPCLoadMapEvent:

This special label triggers when a player steps in a map marked with the

'loadevent' mapflag and attaches its RID. The fact that this label requires a

mapflag for it to work is because, otherwise, it'd be server-wide and trigger

every time a player would change maps. Imagine the server load with 1,000 players

(oh the pain...)

Oh right, that could work, just have to save whichever is being played at the moment and just check if something is playing right?

  • 0
Posted

OnPCLoadMapEvent:

This special label triggers when a player steps in a map marked with the

'loadevent' mapflag and attaches its RID. The fact that this label requires a

mapflag for it to work is because, otherwise, it'd be server-wide and trigger

every time a player would change maps. Imagine the server load with 1,000 players

(oh the pain...)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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