Santafe Posted November 7, 2017 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
0 Alayne Posted November 7, 2017 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
0 Santafe Posted November 7, 2017 Author 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
0 sader1992 Posted November 8, 2017 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
0 Alayne Posted November 8, 2017 Posted November 8, 2017 @sader1992 good point to you, didn't thought about using the mapflag ^^ Quote
0 Santafe Posted November 8, 2017 Author 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
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
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.