Jump to content
  • 0
Sign in to follow this  
butasro

Requesting for @BGM

Question

8 answers to this question

Recommended Posts

  • 0

Yes, but you need add music name to array (150~ names)

-[tab]script[tab]BGMCOMMAND[tab]FAKE_NPC,{
OnInit:
bindatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
setarray .musicName$[0], "1", "2", "3"; //add yours
end;

OnStartBGM:
	
	if(.@atcmd_parameters$[0] == "")
	{
		message strcharinfo(0), "BGM failed: invalid music name";
		end;
	}
	
	freeloop(1);
	for(.i = 0; .i < getarraysize(.musicName$); .i++)
	{
		if(.@atcmd_parameters$[0] == .musicName$[.i]){
			playbgmall .@atcmd_parameters$[0];
			message strcharinfo(0), "BGM: Played - " + .@atcmd_parameters$[0];
			end;
		}
	}
	freeloop(0);
	message strcharinfo(0), "BGM failed: invalid music name";
	end;
}

not tested

Edited by Kubix

Share this post


Link to post
Share on other sites
  • 0

unknown command T_T

-    script    BGMCOMMAND    FAKE_NPC,{
OnInit:
bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
setarray .musicName$[0], "1", "2", "3"; //add yours
end;

OnStartBGM:
    
    if(.@atcmd_parameters$[0] == "")
    {
        message strcharinfo(0), "BGM failed: invalid music name";
        end;
    }
    
    freeloop(1);
    for(.i = 0; .i < getarraysize(.musicName$); .i++)
    {
        if(.@atcmd_parameters$[0] == .musicName$[.i]){
            playbgmall .@atcmd_parameters$[0];
            message strcharinfo(0), "BGM: Played - " + .@atcmd_parameters$[0];
            end;
        }
    }
    freeloop(0);
    message strcharinfo(0), "BGM failed: invalid music name";
    end;
}

Share this post


Link to post
Share on other sites
  • 0

yep, my bad.

change this:

 

bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
 

 

to this:

 

bindatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
 

Share this post


Link to post
Share on other sites
  • 0

 

yep, my bad.

change this:

 

bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
 

 

to this:

 

bindatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
 

Thanks it worked ^^ woo!

 

 

yep, my bad.

change this:

 

bidnatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
 

 

to this:

 

bindatcmd "bgm", strnpcinfo(0) + "::OnStartBGM", 99, 99;
 

Thanks it worked ^^ woo!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.