Brahms Posted October 14, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Share Posted October 14, 2016 (edited) Good day guys, may i request for script where in maintown you Can't do @go 0 commands until a certain player reach for example 100 base level.. Thank you in advance guys.. Edited October 14, 2016 by Akkarin Changed topic title to something more meaningful Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 14, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 14, 2016 A quick way to do this without changing any of the source would be to overwrite the @go command using bindatcmd: - script atcmd_go -1,{ OnInit: bindatcmd "go",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if(!getarraysize(.@atcmd_parameters$)) { message strcharinfo(0), "Invalid syntax."; end; } .@location = .@atcmd_parameters$[0]; if(.@location == 0){ if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@go 0"; } } else { atcommand "@go "+ .@location; } end; } Tested and works on my localhost, you'd need to edit to add more if/else's if you want to restrict other locations. 1 Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 Thank you so much for this.. ill try it out. thanks again.. @Akkarin; hi again. thank you for the script its 100% working. But i tried to add other commands to restrict the @warp to if your now atleast have a blvl 100. here's what happen: my @go 0 location is invek 148 162, when i tried to put my edited script that you proivided me, @go 0 & @warp invek actually disabled when your not atleast have a base lvl 100, its working. my problem is some Debug show in my map server console everytime i used @go 0 or @warp invek after i reach base level 100. Can you check this 1 for me? did i missed something? is there something wrong the way i edit it? thank you so much in advance for the help & support.. heres my edited script & Screenshot of my map console: Restriction.txt ss.bmp Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 15, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 15, 2016 Well... you need an elseif in there, and your error is because the script is trying to warp you to a map called "0". Give me 20 mins to get to a PC and i can rewrite it for you and test. Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 Geez, Thank you for the fast response.. Thank you so much Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 15, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 15, 2016 - script atcmd_go -1,{ OnInit: bindatcmd "go",strnpcinfo(3)+"::OnAtcommand"; bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if(!getarraysize(.@atcmd_parameters$)) { message strcharinfo(0), "Invalid syntax."; end; } .@cmd$ = .@atcmd_command$; .@location = .@atcmd_parameters$[0]; switch(.@cmd){ case "go": switch(.@location){ case 0: if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@go 0"; } break; case 1: if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@warp invek"; } break; case default: atcommand "@go "+ .@location; break; } break; case "warp": switch(.@location){ case "invek": if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@warp invek"; } break; case default: atcommand "@warp "+ .@location; break; } break; } end; } Currently untested, but this should provide you with a good base to edit without breaking it Should be fairly easy to follow so you can add additional locations in the future. Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 Thank you so much for your time. im going to try it. still having some problem sir Akkarin.. sorry for taking much of your time. heres the ss of my map server console: Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 15, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 15, 2016 Bah. Sometimes i forget which language i'm using *_* /me edits. - script atcmd_go -1,{ OnInit: bindatcmd "go",strnpcinfo(3)+"::OnAtcommand"; bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if(!getarraysize(.@atcmd_parameters$)) { message strcharinfo(0), "Invalid syntax."; end; } .@cmd$ = .@atcmd_command$; .@location$ = .@atcmd_parameters$[0]; dispbottom .@cmd$ +" used"; if( .@cmd$ == "@go" ){ dispbottom "found @go"; if( .@location$ == "0" ){ dispbottom "found 0"; if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@go 0"; } } else if( .@location$ == "1" ){ dispbottom "found 1"; if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@warp invek"; } } else { dispbottom "found something else"; atcommand "@go "+ .@location$; } } else if( .@cmd$ == "@warp" ){ dispbottom "found @warp"; if( .@location$ == "invek" ){ dispbottom "found invek"; if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@warp invek"; } } else { atcommand "@warp "+ .@location$; } } else { dispbottom "Odd.. nothing processed.."; } dispbottom "@ end"; end; } You can do away with all of the dispbottom's everywhere, they're just there for debugging. Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 (edited) Yay! it works! Thank you so much!, Thank you for the fast response & Thank you for giving me some knowledge.. Thank you.. I got another problem, Lol sorry for this.. Here's what happen, the whole @warp is working but the problem is everytime i do for example, @warp prontera 150,100, it drops me anywhere in prontera. the x,y this is not working. hehehe... same with the other maps. Edited October 15, 2016 by Brahms Quote Link to comment Share on other sites More sharing options...
0 TiMz Posted October 15, 2016 Group: Members Topic Count: 51 Topics Per Day: 0.01 Content Count: 192 Reputation: 9 Joined: 05/08/13 Last Seen: August 23, 2024 Share Posted October 15, 2016 Yay! it works! Thank you so much!, Thank you for the fast response & Thank you for giving me some knowledge.. Thank you.. I got another problem, Lol sorry for this.. Here's what happen, the whole @warp is working but the problem is everytime i do for example, @warp prontera 150,100, it drops me anywhere in prontera. the x,y this is not working. hehehe... same with the other maps. Don't forget to mark the best answer. Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 15, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 15, 2016 I got another problem, Lol sorry for this.. Here's what happen, the whole @warp is working but the problem is everytime i do for example, @warp prontera 150,100, it drops me anywhere in prontera. the x,y this is not working. hehehe... same with the other maps. Again, untested: - script atcmd_go -1,{ OnInit: bindatcmd "go",strnpcinfo(3)+"::OnAtcommand"; bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand"; end; OnAtcommand: if(!getarraysize(.@atcmd_parameters$)) { message strcharinfo(0), "Invalid syntax."; end; } .@cmd$ = .@atcmd_command$; .@location$ = .@atcmd_parameters$[0]; .@x$ = .@atcmd_parameters$[1]; .@y$ = .@atcmd_parameters$[2]; dispbottom .@cmd$ +" used"; if( .@cmd$ == "@go" ){ dispbottom "found @go"; if( .@location$ == "0" ){ dispbottom "found 0"; if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@go 0"; } } else if( .@location$ == "1" ){ dispbottom "found 1"; if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@warp invek"; } } else { dispbottom "found something else"; atcommand "@go "+ .@location$; } } else if( .@cmd$ == "@warp" ){ dispbottom "found @warp"; if( .@location$ == "invek" ){ dispbottom "found invek"; if(BaseLevel < 100){ dispbottom "You need to be atleast Base Level 100 to go there!"; } else { atcommand "@warp invek" + .@x$ + " " + .@y$; } } else { atcommand "@warp "+ .@location$ + " " + .@x$ + " " + .@y$; } } else { dispbottom "Odd.. nothing processed.."; } dispbottom "@ end"; end; } Just needed additional parameters adding for the x and y coordinates. Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 im here again. another error sir Akkarin.. everytime i try to @warp to any town with my base lvl is 100 the screen keep showing "Map not found" & "@warp failed" for my map server console here's the Screenshots.. Yay! it works! Thank you so much!, Thank you for the fast response & Thank you for giving me some knowledge.. Thank you.. I got another problem, Lol sorry for this.. Here's what happen, the whole @warp is working but the problem is everytime i do for example, @warp prontera 150,100, it drops me anywhere in prontera. the x,y this is not working. hehehe... same with the other maps. Don't forget to mark the best answer. yes i will.. mr. Akkarin is working hard for me and im very thankfull for that.. Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 15, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 15, 2016 I guess you could add a check to make sure that if .@x$ exists or is not null or is not 0 then echo out that line in the atcommand @warp line.. Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 I guess you could add a check to make sure that if .@x$ exists or is not null or is not 0 then echo out that line in the atcommand @warp line.. Sorry Akkarin but to be honest i dont know how to do that. Im really sorry. im just a newbie.. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted October 15, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted October 15, 2016 try this https://pastebin.com/9dWAt99d Add more maps with level restriction here. func_SetLevel( "prontera",30 ); // prontera need level 30. func_SetLevel( "payon",99 ); // payon need level 99. 1 Quote Link to comment Share on other sites More sharing options...
0 _Okuz_ Posted October 15, 2016 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 92 Reputation: 17 Joined: 08/11/12 Last Seen: August 30, 2017 Share Posted October 15, 2016 Wow, nice catch Emistry! +1 Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 15, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 15, 2016 (edited) try this https://pastebin.com/9dWAt99d Add more maps with level restriction here. func_SetLevel( "prontera",30 ); // prontera need level 30. func_SetLevel( "payon",99 ); // payon need level 99. Let me try emistry. Thanks! Hi Emistry i tried to edit the map as you instructed. but it seems im having a problem with the commands.. when i use @go 0 my screen shows map 0 doesnt exist. here's the script i edited and my map server console.. i just want to restrict @go 0 & @warp (my maintown) commands if the players have 99 baselevel below only. if the players reach baselevel 100 they can use the command // https://rathena.org/board/topic/107746-request-script-go-restrict-on-base-level/ - script Sample#at_go_restrict -1,{ function func_SetLevel { setd( ".map_" + getarg( 0,"" ) ), getarg( 1,1 ); return; } OnInit: bindatcmd( "go", strnpcinfo(3)+"::OnAtcommand" ); func_SetLevel( "invek",100 ); // prontera need level 30. func_SetLevel( "payon",99 ); // payon need level 99. end; OnAtcommand: if ( !.@atcmd_numparameters ) { dispbottom .@atcmd_command$+" <mapname> <x> <y>"; } else if ( getmapusers( .@atcmd_parameters$[0] ) == -1 ) { dispbottom "map '"+.@atcmd_parameters$[0]+"' doesn't exist."; } else if ( !getmapflag( .@atcmd_parameters$[0],mf_town ) || getmapflag( .@atcmd_parameters$[0],mf_nowarpto ) ) { dispbottom "you cant warp to this map."; } else if ( getd( ".map_" + .@atcmd_parameters$[0] ) > BaseLevel ) { dispbottom "You need higher level to warp to this map."; } else { warp .@atcmd_parameters$[0],atoi( .@atcmd_parameters$[1] ),atoi( .@atcmd_parameters$[2] ); } end; } Edited October 16, 2016 by Emistry Please use CODEBOX. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted October 16, 2016 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted October 16, 2016 (edited) try this. https://pastebin.com/9dWAt99d Edited October 16, 2016 by Emistry fix link Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 16, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 16, 2016 i cant see the link try this. https://pastebin.com/edit/9dWAt99d Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 19, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 19, 2016 (edited) A big thanks to all for making an effort about my request. maybe ill just stick to Akkarin's script for @go restriction only on a certain map. thanks to all the replies and effort.. -no error cause by this script. but the script @ warp restriction still not working properly. em.bmp Edited October 20, 2016 by Brahms Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted October 20, 2016 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted October 20, 2016 The error in your screenshot is not being caused by Emistry's script. Quote Link to comment Share on other sites More sharing options...
0 Brahms Posted October 20, 2016 Group: Members Topic Count: 48 Topics Per Day: 0.02 Content Count: 149 Reputation: 3 Joined: 07/29/16 Last Seen: August 6, 2019 Author Share Posted October 20, 2016 (edited) yea i solve that already. its not on emistry script. but still the @warp restriction is not working properly. when i use @warp prontera 150 150 it drops me randomly. so maybe ill just stick to your @go restriction.. Thank you Akkarin.. and by the way also thanks to emistry for the efforts. Edited October 20, 2016 by Brahms Quote Link to comment Share on other sites More sharing options...
Question
Brahms
Good day guys, may i request for script where in maintown you Can't do @go 0 commands until a certain player reach for example 100 base level.. Thank you in advance guys..
Edited by AkkarinChanged topic title to something more meaningful
Link to comment
Share on other sites
21 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.