Santafe Posted November 7, 2017 Group: Members Topic Count: 91 Topics Per Day: 0.02 Content Count: 325 Reputation: 35 Joined: 06/01/13 Last Seen: October 7, 2019 Share Posted November 7, 2017 Hello everyone, I would like to request a bind at command to warp into a specific place like a mall using @mall, It warps to quiz_02 but it can only be used in towns, If used anywhere else it asks the player to be in a town. Thanks and regards, Santafe Quote Link to comment Share on other sites More sharing options...
0 sader1992 Posted November 8, 2017 Group: Content Moderator Topic Count: 55 Topics Per Day: 0.01 Content Count: 1691 Reputation: 716 Joined: 12/21/14 Last Seen: 11 hours ago Share Posted November 8, 2017 (edited) - script mall_command -1,{ OnMall: if(getmapflag(strcharinfo(3),mf_town)){ warp "quiz_02",0,0; }else{ message strcharinfo(0),"you have to be in town to use this command"; } end; OnInit: bindatcmd("mall",strnpcinfo(3)+"::OnMall",0,99); } Edited November 8, 2017 by sader1992 mail to mall 1 1 Quote Link to comment Share on other sites More sharing options...
0 Alayne Posted November 7, 2017 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 342 Reputation: 170 Joined: 02/25/12 Last Seen: January 24, 2022 Share Posted November 7, 2017 Can't test it but this should do the job prontera,119,42,0 script AtCommand::alaatcom HIDDEN_WARP_NPC,{ end; OnWarpAsked: freeloop 1; .@continue = 1; for( .@i = 0; .@i<getarraysize(.townMap$) && .@continue == 1; .@i++) { if(.townMap$[.@i] == strcharinfo(3)) { .@continue = 0; } } freeloop 0; if(.@continue == 0) { warp .warpMap$, .warpX, .warpY; } else { dispbottom "[Warp System] You must be in town to use this command"; } return 1; OnInit: bindatcmd "toquiz",strnpcinfo(3)+"::OnWarpAsked"; .warpMap$ = "quiz_02"; .warpX = 0; .warpY = 0; setarray .townMap$[0],"prontera","geffen","alberta"; //to fill end; } 1 Quote Link to comment Share on other sites More sharing options...
0 Santafe Posted November 7, 2017 Group: Members Topic Count: 91 Topics Per Day: 0.02 Content Count: 325 Reputation: 35 Joined: 06/01/13 Last Seen: October 7, 2019 Author Share Posted November 7, 2017 6 hours ago, Alayne said: Can't test it but this should do the job prontera,119,42,0 script AtCommand::alaatcom HIDDEN_WARP_NPC,{ end; OnWarpAsked: freeloop 1; .@continue = 1; for( .@i = 0; .@i<getarraysize(.townMap$) && .@continue == 1; .@i++) { if(.townMap$[.@i] == strcharinfo(3)) { .@continue = 0; } } freeloop 0; if(.@continue == 0) { warp .warpMap$, .warpX, .warpY; } else { dispbottom "[Warp System] You must be in town to use this command"; } return 1; OnInit: bindatcmd "toquiz",strnpcinfo(3)+"::OnWarpAsked"; .warpMap$ = "quiz_02"; .warpX = 0; .warpY = 0; setarray .townMap$[0],"prontera","geffen","alberta"; //to fill end; } Hello, thanks for the scrip, the command works but i get this warning and debug everytime i use it : [warning]: script:run_func:AtCommand at prontera (119,42) [debug]: Source(NPC): AtCommand at prontera (119,42) Quote Link to comment Share on other sites More sharing options...
0 Alayne Posted November 8, 2017 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 342 Reputation: 170 Joined: 02/25/12 Last Seen: January 24, 2022 Share Posted November 8, 2017 @sader1992 good point to you, didn't thought about using the mapflag ^^ Quote Link to comment Share on other sites More sharing options...
0 Santafe Posted November 8, 2017 Group: Members Topic Count: 91 Topics Per Day: 0.02 Content Count: 325 Reputation: 35 Joined: 06/01/13 Last Seen: October 7, 2019 Author Share Posted November 8, 2017 (edited) 9 hours ago, sader1992 said: - script mall_command -1,{ OnMall: if(getmapflag(strcharinfo(3),mf_town)){ warp "quiz_02",0,0; }else{ message strcharinfo(0),"you have to be in town to use this command"; } end; OnInit: bindatcmd("mall",strnpcinfo(3)+"::OnMall",0,99); } oh ma gerd works like a charm ty Sader <3 @Alayne thanks for your help too <3 Edited November 8, 2017 by Santafe Quote Link to comment Share on other sites More sharing options...
Question
Santafe
Hello everyone,
I would like to request a bind at command to warp into a specific place like a mall using @mall, It warps to quiz_02 but it can only be used in towns, If used anywhere else it asks the player to be in a town.
Thanks and regards,
Santafe
Link to comment
Share on other sites
5 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.