bindatcmd in certain map

Kuroyama

New member
Messages
128
Points
0
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!

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

 

Code:
-	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;
}
 
Looked here already, thanks for the reference btw.

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!

 
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 😝

 
Back
Top