EvilPuncker Posted September 5, 2012 Posted September 5, 2012 I would like to suggest the addition of this patch from ToastOfDoom into rA: http://pastebin.com/fE8WGC9E 1 Quote
Elijah23 Posted September 5, 2012 Posted September 5, 2012 so this can be used to restrict a certain @command in a certain map? this would be helpful additon with rathena:) Quote
EvilPuncker Posted September 5, 2012 Author Posted September 5, 2012 so this can be used to restrict a certain @command in a certain map? yes Quote
EvilPuncker Posted September 8, 2012 Author Posted September 8, 2012 bump! this would be a helpful additon to rathena Quote
EvilPuncker Posted September 16, 2012 Author Posted September 16, 2012 sorry for bumping it again xD Quote
EvilPuncker Posted September 30, 2012 Author Posted September 30, 2012 well, seems like ToastOfDoom is back active would be nice to see this diff updated and added to svn Quote
GmOcean Posted September 30, 2012 Posted September 30, 2012 (edited) Hmm, I'm not saying it "shouldn't" be added, but we already currently have something like it. *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; *bindatcmd("command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}); This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. With this you can litterally do the exact same thing, and make it so player's can't use the command on certain maps. Additionally we have with i. *unbindatcmd "command"; *unbindatcmd("command"); This command will unbind a NPC event label from an atcommand. So, you can pretty much make atcommands only accessible after meeting requirements and so on. Edited September 30, 2012 by GmOcean Quote
EvilPuncker Posted September 30, 2012 Author Posted September 30, 2012 Hmm, I'm not saying it "shouldn't" be added, but we already currently have something like it. *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; *bindatcmd("command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}); This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. With this you can litterally do the exact same thing, and make it so player's can't use the command on certain maps. Additionally we have with i. *unbindatcmd "command"; *unbindatcmd("command"); This command will unbind a NPC event label from an atcommand. So, you can pretty much make atcommands only accessible after meeting requirements and so on. but that is a really weird way of doing this xDD Quote
GmOcean Posted September 30, 2012 Posted September 30, 2012 (edited) I wouldn't think so. - script test_npc -1,{ OnInit: bindatcmd("@storage","test_npc::OnStorage"); end; OnStorage: set .@maps$[0],"prontera","payon","alberta","etc..."; getmapxy(.@m$,.@x,.@y,0); for(set .@i,0; .@i<getarraysize(.@maps$); set .@i,.@i+1) {if(.@m$==.@maps$[.@i]){dispbottom "@storage is disabled on this map."; end;}} openstorage; end; } Personally, I just think that using the bindatcmd script command is better since it is more versatile. Your basically free to put any pre-requisists for using a command/limitations for using one while using the script. Example: Limit @warp to only work during 18:00 -> 00:00. Or making @storage only useable 5->10x a day, then after that charge them zeny or an item to use it further past that amount/time. There really is limitless possibilities, just depends on your imagination. Edited September 30, 2012 by GmOcean Quote
EvilPuncker Posted September 30, 2012 Author Posted September 30, 2012 (edited) I wouldn't think so. - script test_npc -1,{ OnInit: bindatcmd("@storage","test_npc::OnStorage"); end; OnStorage: set .@maps$[0],"prontera","payon","alberta","etc..."; getmapxy(.@m$,.@x,.@y,0); for(set .@i,0; .@i<getarraysize(.@maps$); set .@i,.@i+1) {if(.@m$==.@maps$[.@i]){dispbottom "@storage is disabled on this map."; end;}} openstorage; end; } Personally, I just think that using the bindatcmd script command is better since it is more versatile. Your basically free to put any pre-requisists for using a command/limitations for using one while using the script. Example: Limit @warp to only work during 18:00 -> 00:00. Or making @storage only useable 5->10x a day, then after that charge them zeny or an item to use it further past that amount/time. There really is limitless possibilities, just depends on your imagination. I know how could I use the way you told me to, but you don't really got what I'm trying to achieve here and I want it as simple as restrictatcmd(prontera,uptime,60); and btw now we have strcharinfo(3) so there is no need to use getmapxy just to get mapname xD Edited September 30, 2012 by EvilPuncker Quote
GmOcean Posted September 30, 2012 Posted September 30, 2012 Okay lol. I got what you were saying, I just thought maybe you didn't know the possibilities an existing command. But I agree, simpiler is better in some cases. 1 Quote
ToastOfDoom Posted November 19, 2012 Posted November 19, 2012 While yes this can be very easily implemented using bindatcmd, it would force you to go through the script engine pipeline which is abit excessive for just an extra comparison every atcommand. 1 Quote
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.