viewing paste topic/4421- bst_delay | Diff

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
 src/map/atcommand.c | 17 +++++++++++++++++
 src/map/pc.h        |  1 +
 2 files changed, 18 insertions(+)
 
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 6177fad..93795de 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -9356,6 +9356,22 @@ static inline void atcmd_channel_help(int fd, const char *command, bool can_crea
        clif->message(fd,atcmd_output);
        return true;
 }
+
+ACMD(bst) {
+       if ( !message || !*message ) {
+               clif->message(fd, "Please, enter a message (usage: @bst <message>).");
+               return false;
+       }
+       if ( sd->bst_delay + 60 > (int)time(NULL) ) {
+               clif->message(fd, "There is a 60 seconds delay of using this command again");
+               return false;
+       }
+       sprintf( atcmd_output, "[Market] %s : %s", sd->status.name, message );
+       intif->broadcast2( atcmd_output, (int)strlen(atcmd_output)+1, strtol("0x9999FF", NULL, 0), 0x190, 12, 0, 0 );
+       sd->bst_delay = (int)time(NULL);
+       return true;
+}
+
 /**
  * Fills the reference of available commands in atcommand DBMap
  **/
@@ -9366,6 +9382,7 @@ void atcommand_basecommands(void) {
         * Command reference list, place the base of your commands here
         **/
        AtCommandInfo atcommand_base[] = {
+               ACMD_DEF(bst),
                ACMD_DEF2("warp", mapmove),
                ACMD_DEF(where),
                ACMD_DEF(jumpto),
diff --git a/src/map/pc.h b/src/map/pc.h
index 30a24c0..55e3231 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -452,6 +452,7 @@ struct map_session_data {
        const char* debug_func;
 
        unsigned int bg_id;
+       int bst_delay;
 
        /**
         * For the Secure NPC Timeout option (check config/Secure.h) [RR]
 
Viewed 670 times, submitted by AnnieRuru.