Jump to content
  • 0

guide on adding @afk commands


donkeyg

Question


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

guide on adding @afk commands

Edited by donkeyg
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  90
  • Reputation:   12
  • Joined:  08/22/12
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  89
  • Reputation:   3
  • Joined:  05/05/13
  • Last Seen:  

I've made this, and recompiled, and my map server isnt starting now. any idea?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  32
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   28
  • Joined:  01/16/12
  • Last Seen:  

-Insert useless comment here-

Are you writing one or asking for one?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

i need an guide.. sorry typo

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  2244
  • Reputation:   182
  • Joined:  11/19/11
  • Last Seen:  

do you have the diff you want to implement? What problems do you have exactly

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  344
  • Topics Per Day:  0.08
  • Content Count:  1060
  • Reputation:   1
  • Joined:  02/13/12
  • Last Seen:  

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 ><

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  80
  • Reputation:   0
  • Joined:  07/03/12
  • Last Seen:  

yea I want to know how to add @afk commands too

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...