Jump to content
  • 0

@afk command please


kyleanthonydizon

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  100
  • Reputation:   0
  • Joined:  10/22/16
  • Last Seen:  

Hi, I've been trying to implement an @afk command, but whenever I recompile, I stops somewhere =( Then when I start server, map-server is not showing. May I request for a working @afk command?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  912
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

Try this not tested

ACMD_FUNC(afk) {
    nullpo_retr(-1, sd);

    if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
        clif_displaymessage(fd, msg_txt(sd,1179)); // Autotrade is not allowed on this map.
        return -1;
    }

    if( pc_isdead(sd) ) {
        clif_displaymessage(fd, msg_txt(sd,1180)); // You cannot autotrade when dead.
        return -1;
    }

    sd->state.autotrade = 1;
    if( battle_config.at_timeout ) {
        int timeout = atoi(message);
        status_change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0);
    }

    channel_pcquit(sd,0xF); //leave all chan
    clif_authfail_fd(sd->fd, 15);

    return 0;
}
Quote

 

This is just quick rearch look for Chatterboy post ..

Edited by Poring King
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...