how can i make it automatically do pub when they execute the @afk command
heres the code
/*==========================================
* @afk by [cr0wmaster]
* Features: 1z required to use. Venders are forbidden to use this command.
*------------------------------------------*/
int atcommand_afk(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
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;
}