Jump to content
  • 0
Kuroyama

bindatcmd in certain map

Question

Hi herc, just want to have a little help request.

 

if this script code is for mapflag town

if (!getmapflag(strcharinfo(3), MF_TOWN)) {
			message strcharinfo(0), "You may only use @sleep in towns.";
			end;
	}

what will be the script to check or getmap for certain map like new_1-1

that's all. thank you in advance!

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 1
3 hours ago, Kuroyama said:

Hi herc, just want to have a little help request.

 

if this script code is for mapflag town

if (!getmapflag(strcharinfo(3), MF_TOWN)) { message strcharinfo(0), "You may only use @sleep in towns."; end; }


if (!getmapflag(strcharinfo(3), MF_TOWN)) {
			message strcharinfo(0), "You may only use @sleep in towns.";
			end;
	}

what will be the script to check or getmap for certain map like new_1-1

that's all. thank you in advance!

im kinda confuse on your question.. are you asking to get the map name? because as the title says "bindcmd in certain map"

then maybe you asking.. "can only use the bindcmd in the certain map"

 

I can give you the script but i dont know if this is what you are looking for...

 

-	script	TestNPC	FAKE_NPC,{
OnInit:
	bindatcmd "test",strnpcinfo(3)+"::OnTestCmd";
end;

OnTestCmd:
	if(strcharinfo(3) == "new_1-1"){
		/* put the content here */
		/* this is only an example */
		message strcharinfo(0), "You got a "+getitemname(512)+".";
		getitem 512,100;
		end;
	}
	else{
		message strcharinfo(0), "Sorry but this command can only used in a certain map.";
		end;
	}
end;
}

 

Share this post


Link to post
Share on other sites
  • 0
5 hours ago, Daraen said:

Looked here already, thanks for the reference btw.

 

 

3 hours ago, Kuya Jeo said:

im kinda confuse on your question.. are you asking to get the map name? because as the title says "bindcmd in certain map"

then maybe you asking.. "can only use the bindcmd in the certain map"

 

I can give you the script but i dont know if this is what you are looking for...

 

- script TestNPC FAKE_NPC,{ OnInit: bindatcmd "test",strnpcinfo(3)+"::OnTestCmd"; end; OnTestCmd: if(strcharinfo(3) == "new_1-1"){ /* put the content here */ /* this is only an example */ message strcharinfo(0), "You got a "+getitemname(512)+"."; getitem 512,100; end; } else{ message strcharinfo(0), "Sorry but this command can only used in a certain map."; end; } end; }


-	script	TestNPC	FAKE_NPC,{
OnInit:
	bindatcmd "test",strnpcinfo(3)+"::OnTestCmd";
end;

OnTestCmd:
	if(strcharinfo(3) == "new_1-1"){
		/* put the content here */
		/* this is only an example */
		message strcharinfo(0), "You got a "+getitemname(512)+".";
		getitem 512,100;
		end;
	}
	else{
		message strcharinfo(0), "Sorry but this command can only used in a certain map.";
		end;
	}
end;
}

 

This one is what I meant to ask for help, Thank you @Kuya Jeo, didn't know that its just simple "if(strcharinfo(3) == "new_1-1")" will do.

Thank you so much!

Share this post


Link to post
Share on other sites
  • 0
9 hours ago, Kuroyama said:

Looked here already, thanks for the reference btw.

 

 

This one is what I meant to ask for help, Thank you @Kuya Jeo, didn't know that its just simple "if(strcharinfo(3) == "new_1-1")" will do.

Thank you so much!

no worries.. im glad that i help you solved your problem 😝

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

×
×
  • Create New...

Important Information

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