Jump to content
  • 0

@afk stuck in die.


Question

Posted

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);
    }
 

 

2 answers to this question

Recommended Posts

Posted (edited)
/*==========================================
* @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
Posted (edited)

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...