Wakabayashi Posted November 7, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 03/22/17 Last Seen: November 25, 2023 Share Posted November 7, 2017 Hello rAthena Community. I would like to ask for some help.. is it possible to add a map restriction? This is the Friendwarper script: prontera,167,199,6 script Friend Warper 461,{ deletearray .@aid[0],128; deletearray @aid[0],128; set @j,0; set @select$,""; query_sql "SELECT `friend_account` FROM `friends` WHERE `char_id` = "+getcharid(0)+"",.@aid; set .@num,getarraysize(.@aid); for(set .@i,0;.@i<.@num;set .@i,.@i+1) if(isloggedin(.@aid[.@i])) { set @aid[@j],.@aid[.@i]; set @j,@j+1; set @select$,@select$+":"+rid2name(.@aid[.@i]); } set @menu,select(@select$)-2; if(isloggedin(@aid[@menu])) { getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu])); warp @m$,@x,@y; set @m$,""; set @x,0; set @y,0; set @j,0; set @select$,""; deletearray @aid[0],128; }else mes "He isn't online."; close; } Thanks for your time! Quote Link to comment Share on other sites More sharing options...
0 Haziel Posted November 7, 2017 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 596 Joined: 11/25/11 Last Seen: December 30, 2023 Share Posted November 7, 2017 Just insert a check after getting the target map. Would need to be a verification between those two lines: getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu])); warp @m$,@x,@y; Quote Link to comment Share on other sites More sharing options...
0 Wakabayashi Posted November 7, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 03/22/17 Last Seen: November 25, 2023 Author Share Posted November 7, 2017 Thanks for the quick answer Mr. Harziel. My Problem is that I don't know how to do this. Could you give me an example? I'll try this by my self.. maybe its not so hard. ^^ Quote Link to comment Share on other sites More sharing options...
1 Haziel Posted November 7, 2017 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 596 Joined: 11/25/11 Last Seen: December 30, 2023 Share Posted November 7, 2017 The simplest, to restrict for only one map, is this one: getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu])); if (@m$ == "prontera"){ mes "I can't be teleport you to your friend's location!"; close; } warp @m$,@x,@y; Changing Prontera to whichever map you want to avoid teleporting the person to. Quote Link to comment Share on other sites More sharing options...
0 Wakabayashi Posted November 7, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 03/22/17 Last Seen: November 25, 2023 Author Share Posted November 7, 2017 (edited) Ow.. this is great. Can I add more maps like this? getmapxy(@m$,@x,@y,0,rid2name(@aid[@menu])); if (@m$ == "prontera","morocc","izlude"){ mes "I can't be teleport you to your friend's location!"; close; } warp @m$,@x,@y; Edited November 7, 2017 by Wakabayashi Quote Link to comment Share on other sites More sharing options...
1 Haziel Posted November 7, 2017 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 596 Joined: 11/25/11 Last Seen: December 30, 2023 Share Posted November 7, 2017 That highly depends on the amount of maps you want to restrict and what they have in common. If it's just a few of them, you can do it like this: if (@m$ == "prontera" || @m$ == "morocc" || @m$ == "izlude"){ If there's a huge list you better look into for and arrays. Quote Link to comment Share on other sites More sharing options...
0 Wakabayashi Posted November 7, 2017 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 9 Reputation: 0 Joined: 03/22/17 Last Seen: November 25, 2023 Author Share Posted November 7, 2017 Okay, thanks you made my day. Quote Link to comment Share on other sites More sharing options...
Question
Wakabayashi
Hello rAthena Community.
I would like to ask for some help.. is it possible to add a map restriction?
This is the Friendwarper script:
Thanks for your time!
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.