Meister Posted August 12, 2012 Posted August 12, 2012 (edited) Example. I want to give the player an @go command but there's a condition.. Condition: If and only if the player is a 1st job or not novice.. How to set it? Thanks in advance! -- I have a question. what if I want to disable @go command for novice should I try this? - script Sample -1,{ OnInit: bindatcmd("go","Sample::OnAtcommand"); end; OnAtcommand: if( Job == Novice ){ message strcharinfo(0),"@go command is disabled for your job/class"; }else{ opengo; end; } this? correct me if I'm wrong thanks. Edited August 12, 2012 by Arcenciel Split and Merged Quote
Euphy Posted August 12, 2012 Posted August 12, 2012 @emong: "opengo" is not a script command. As a workaround, you could redirect to normal @go with: atcommand "@go "+.@atcmd_parameters$[0]; Quote
Arcenciel Posted August 12, 2012 Posted August 12, 2012 You can either edit the source or create a script that would change a player's group when they're a first job. The only difference in the group being one has @go the other doesn't. EDIT: Or use this *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. Example: When a user types the command "@test", an angel effect will be shown. - script atcmd_example -1,{ OnInit: bindatcmd("test","atcmd_example::OnAtcommand"); end; OnAtcommand: specialeffect2 338; end; } EDIT 2: Noticed your post on the other topic and this topic. Split from the other topic and merged here. Quote
Peopleperson49 Posted August 13, 2012 Posted August 13, 2012 Why not just modifiy the source codes to only allow them to do it? Then you wouldn't even need the script to do @go. Peopleperson49 Quote
Euphy Posted August 13, 2012 Posted August 13, 2012 Why not just modifiy the source codes to only allow them to do it? Then you wouldn't even need the script to do @go. BindAtcmd was implemented to make things like this a little easier to write. That way you don't have to recompile every time you make a change. Quote
Peopleperson49 Posted August 13, 2012 Posted August 13, 2012 (edited) Thats good to know thanks. I checked the script_commands.txt and even the item_bonus.txt, but where do I read about this command? Peopleperson49 Edited August 13, 2012 by peopleperson49 Quote
Euphy Posted August 13, 2012 Posted August 13, 2012 Bindatcmd was added in r16471, documentation was added in r16473 to script_commands.txt. Quote
Ninja Posted August 14, 2012 Posted August 14, 2012 Bindatcmd was added in r16471, documentation was added in r16473 to script_commands.txt. Hi Euphy, i read the description of bindatcmd, but just to be clear, does this allow you to create custom atcommands? is there also a command which verifies if an at command exists? Quote
Euphy Posted August 14, 2012 Posted August 14, 2012 Yes, bindatcmd allows you to create new atcommands without modifying source. If you bind to an existing command, the atcommand will invoke your script and not the source function. There is no command which checks for an existing command. Quote
Ninja Posted August 14, 2012 Posted August 14, 2012 thank you very much. this is a helpful information Quote
Question
Meister
Example. I want to give the player an @go command but there's a condition..
Condition:
If and only if the player is a 1st job or not novice.. How to set it?
Thanks in advance!
--
I have a question. what if I want to disable @go command for novice should I try this?
this? correct me if I'm wrong thanks.
Edited by ArcencielSplit and Merged
10 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.