Jump to content
  • 0
Sign in to follow this  
butasro

Requesting for @BGM

Question

8 answers to this question

Recommended Posts

  • 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

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;
 

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

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

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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