Jump to content
  • 0

@afk stuck in die.


kangfredy

Question


  • Group:  Members
  • Topic Count:  112
  • Topics Per Day:  0.02
  • Content Count:  388
  • Reputation:   4
  • Joined:  05/01/12
  • Last Seen:  

guys i want to ask..how to make @afk cannot use if player die??

this is my afk function

 

/*==========================================
* @afk
*------------------------------------------*/
ACMD_FUNC(afk) {
 
        nullpo_retr(-1, sd);
        
        if(map[sd->bl.m].flag.pvp || map [sd->bl.m].flag.gvg){
        clif_displaymessage(fd, "kamu tidak di perbolehkan menggunakan di area pvp");
        return -1;}
        
        sd->state.autotrade = 1;
        sd->state.monster_ignore = 1;
        pc_setsit(sd);
        skill_sit(sd,1);
        clif_sitting(&sd->bl);
        clif_specialeffect(&sd->bl, 234,AREA);
        clif_authfail_fd(fd, 15);
    }
 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

/*==========================================
* @afk
*------------------------------------------*/
ACMD_FUNC(afk) {
        nullpo_retr(-1, sd);
        if(map[sd->bl.m].flag.pvp || map [sd->bl.m].flag.gvg){
        clif_displaymessage(fd, "kamu tidak di perbolehkan menggunakan di area pvp");
return -1;}
        if(pc_isdead(sd)) {
clif_displaymessage(fd, "You can't use @afk when you are dead.");
return -1;}
sd->state.autotrade = 1;
sd->state.monster_ignore = 1;
pc_setsit(sd);
skill_sit(sd,1);
clif_sitting(&sd->bl);
clif_specialeffect(&sd->bl, 234,AREA);
clif_authfail_fd(fd, 15);
}

;)

Edited by nanakiwurtz
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  353
  • Reputation:   70
  • Joined:  07/14/12
  • Last Seen:  

insert this in your @afk command in atcommand.c

 

 

 
    if (status_isdead(&sd->bl)){
    clif_displaymessage(sd->fd,"You can not use @afk while dead.");
    return 0;
    }

i use this code for most of my commands

so they can't use that specific command when they are dead

works great for me

tested and proven with @go, @warp and @storage(these are the commands i have tried this code with)

but looking at the code. its very much understandable what it does :)

Edited by icabit
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...