kangfredy Posted April 21, 2013 Posted April 21, 2013 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); } Quote
nanakiwurtz Posted April 21, 2013 Posted April 21, 2013 (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 April 21, 2013 by nanakiwurtz Quote
icabit Posted April 21, 2013 Posted April 21, 2013 (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 April 21, 2013 by icabit Quote
Question
kangfredy
guys i want to ask..how to make @afk cannot use if player die??
this is my afk function
2 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.