donkeyg Posted May 20, 2012 Posted May 20, 2012 (edited) guide on adding @afk commands Edited May 21, 2012 by donkeyg Quote
Kyo Posted December 27, 2012 Posted December 27, 2012 I did not test if the command works but here you go, open src/map/atcommand.c and find ACMD_FUNC(cart) { #define MC_CART_MDFY(x) \ sd->status.skill[MC_PUSHCART].id = x?MC_PUSHCART:0; \ sd->status.skill[MC_PUSHCART].lv = x?1:0; \ sd->status.skill[MC_PUSHCART].flag = x?1:0; int val = atoi(message); bool need_skill = pc_checkskill(sd, MC_PUSHCART) ? false : true; if( !message || !*message || val < 0 || val > MAX_CARTS ) { sprintf(atcmd_output, msg_txt(1390),command,MAX_CARTS); // Unknown Cart (usage: %s <0-%d>). clif_displaymessage(fd, atcmd_output); return -1; } if( val == 0 && !pc_iscarton(sd) ) { clif_displaymessage(fd, msg_txt(1391)); // You do not possess a cart to be removed return -1; } if( need_skill ) { MC_CART_MDFY(1); } if( pc_setcart(sd, val) ) { if( need_skill ) { MC_CART_MDFY(0); } return -1;/* @cart failed */ } if( need_skill ) { MC_CART_MDFY(0); } clif_displaymessage(fd, msg_txt(1392)); // Cart Added return 0; #undef MC_CART_MDFY } Then you place this code below it: /*========================================== * @afk by [cr0wmaster] * Features: 1z required to use. Venders are forbidden to use this command. *------------------------------------------*/ ACMD_FUNC(afk) { nullpo_retr(-1, sd); if (sd->vender_id) //check if that player's vending [cr0wmaster] { clif_displaymessage(fd, "You can't use this command while you're vending."); } else if(sd->status.zeny >= 1) { sd->status.zeny += -1; clif_updatestatus(sd, SP_ZENY); sd->state.logout = 1; clif_authfail_fd(fd, 15); } else { clif_displaymessage(fd, "You do not have enough money to use this command."); clif_displaymessage(fd, "@afk failed."); } return 0; } Then you find ACMD_DEF(mount2) replace it with the following ACMD_DEF(mount2), and add the following below ACMD_DEF(afk) Compile your server and you're done. Quote
0 Sunset Posted April 30, 2017 Posted April 30, 2017 I've made this, and recompiled, and my map server isnt starting now. any idea? Quote
Sharpienero Posted May 20, 2012 Posted May 20, 2012 -Insert useless comment here- Are you writing one or asking for one? Quote
Judas Posted May 21, 2012 Posted May 21, 2012 do you have the diff you want to implement? What problems do you have exactly Quote
donkeyg Posted May 21, 2012 Author Posted May 21, 2012 http://www.eathena.ws/board/index.php?showtopic=222414 i tried this.. still failed when compile the server with putty... can explain to more clearly about this script please >< Quote
jaynard09 Posted December 25, 2012 Posted December 25, 2012 yea I want to know how to add @afk commands too Quote
Question
donkeyg
guide on adding @afk commands
Edited by donkeyg7 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.