Kuroyama 6 Posted January 29, 2021 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! Quote Share this post Link to post Share on other sites
1 Kuya Jeo 120 Posted January 29, 2021 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; } 2 Pollux and Kuroyama reacted to this Quote Share this post Link to post Share on other sites
0 Daraen 8 Posted January 29, 2021 https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L7923 Quote Share this post Link to post Share on other sites
0 Kuroyama 6 Posted January 29, 2021 5 hours ago, Daraen said: https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L7923 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! Quote Share this post Link to post Share on other sites
0 Kuya Jeo 120 Posted January 30, 2021 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 😝 Quote Share this post Link to post Share on other sites
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