diff options
-rw-r--r-- | Changelog.txt | 2 | ||||
-rw-r--r-- | src/map/atcommand.c | 34 | ||||
-rw-r--r-- | src/map/atcommand.h | 3 |
3 files changed, 38 insertions, 1 deletions
diff --git a/Changelog.txt b/Changelog.txt index df6c81b12..fea5dc985 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,8 @@ Date Added 11/18 + * Added a line to @unmute, added @mute. [celest] + Usage: @mute <time in minutes> <character name> * Added save_flag for skill_status_change_start [celest] * Fixed muting not being saved when you quit/change characters/log off [celest] * *Hopefully* fixed the skill tree problem where you have to use 49 skill diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 6debf2256..bb2ce41c7 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -213,6 +213,7 @@ ATCOMMAND_FUNC(setbattleflag); // by MouseJstr ATCOMMAND_FUNC(unmute); // [Valaris] ATCOMMAND_FUNC(uptime); // by MC Cameri ATCOMMAND_FUNC(changesex); // by MC Cameri +ATCOMMAND_FUNC(mute); // celest #ifndef TXT_ONLY ATCOMMAND_FUNC(checkmail); // [Valaris] @@ -463,6 +464,8 @@ static AtCommandInfo atcommand_info[] = { { AtCommand_UnMute, "@unmute", 60, atcommand_unmute }, // [Valaris] { AtCommand_UpTime, "@uptime", 0, atcommand_uptime }, // by MC Cameri { AtCommand_ChangeSex, "@changesex", 1, atcommand_changesex }, // by MC Cameri + { AtCommand_Mute, "@mute", 99, atcommand_mute }, // [celest] + { AtCommand_Mute, "@red", 99, atcommand_mute }, // [celest] #ifndef TXT_ONLY // sql-only commands { AtCommand_CheckMail, "@checkmail", 1, atcommand_listmail }, // [Valaris] @@ -7696,6 +7699,7 @@ int atcommand_unmute( if((pl_sd=map_nick2sd((char *) message)) != NULL) { if(pl_sd->sc_data[SC_NOCHAT].timer!=-1) { + pl_sd->status.manner = 0; // have to set to 0 first [celest] skill_status_change_end(&pl_sd->bl,SC_NOCHAT,-1); clif_displaymessage(sd->fd,"Player unmuted"); } @@ -7771,6 +7775,36 @@ atcommand_changesex( return 0; } +/*================================================ + * @mute - Mutes a player for a set amount of time + *------------------------------------------------ + */ +int atcommand_mute( + const int fd, struct map_session_data* sd, + const char* command, const char* message) +{ + struct map_session_data *pl_sd = NULL; + char character[100]; + int manner; + + if (!message || !*message || sscanf(message, "%d %99[^\n]", &manner, character) < 1) { + clif_displaymessage(fd, "usage: @mute <time> <character name>."); + return -1; + } + + if ((pl_sd = map_nick2sd(character)) != NULL) { + pl_sd->status.manner -= manner; + if(pl_sd->status.manner < 0) + skill_status_change_start(&pl_sd->bl,SC_NOCHAT,0,0,0,0,0,0); + } + else { + clif_displaymessage(fd, msg_table[3]); // Character not found. + return -1; + } + + return 0; +} + #ifndef TXT_ONLY /* Begin SQL-Only commands */ /*========================================== diff --git a/src/map/atcommand.h b/src/map/atcommand.h index 396261a9c..acab72531 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -194,7 +194,8 @@ enum AtCommandType { AtCommand_SetBattleFlag, AtCommand_UnMute, AtCommand_UpTime, - AtCommand_ChangeSex, + AtCommand_ChangeSex, + AtCommand_Mute, // [celest] // SQL-only commands start #ifndef TXT_ONLY AtCommand_CheckMail, // [Valaris] |