/*==========================================
* @autotrade by durf [Lupus] [Paradox924X]
* Turns on/off Autotrade for a specific player
*------------------------------------------*/
ACMD(autotrade) {
nullpo_retr(-1, sd);
if( map[sd->bl.m].flag.autotrade != battle_config.autotrade_mapflag ) {
clif->message(fd, msg_txt(1179)); // Autotrade is not allowed on this map.
return false;
}
if( pc_isdead(sd) ) {
clif->message(fd, msg_txt(1180)); // You cannot autotrade when dead.
return false;
}
if( !sd->state.vending && !sd->state.buyingstore ) { //check if player is vending or buying
clif->message(fd, msg_txt(549)); // "You should have a shop open to use @autotrade."
return false;
}
//BEGIN Addition by Moi (Autotrade time restrictions)
if (agit_flag == 1 || agit2_flag == 1) {
clif->message(fd, "You cannot use @autotrade while WoE is on.");
return 0;
}
time_t time_server;
struct tm *datetime; // <--- complaining