Disable main channel in certain maps

Helena

New member
Messages
238
Points
0
Emulator
rAthena
Hi hercules, forgive me if i put this in the wrong category.

can someone point me in the right direction? my players are very (a bit too) competitive and tend to spam the channel system (main channel in particular) during woe times and some pvp wars when one person/guild defeats another.

what i would like is for the main channel to be automatically disabled and not usable (no re-join or send messages) when a player enters certain maps (ie prtg_cas01). I looked into channels.conf but couldn't find an option to blacklist maps.

Could anyone help? Thank you so much!
default_smile.png


 
@@Helena

find clif_channel_msg inside clif.c

replace the whole function with

void clif_channel_msg(struct channel_data *chan, struct map_session_data *sd, char *msg){ DBIterator *iter; struct map_session_data *user; unsigned short msg_len; uint32 color; nullpo_retv(chan); nullpo_retv(sd); nullpo_retv(msg); if ( !map_flag_vs(sd->bl.m) ) { iter = db_iterator(chan->users); msg_len = strlen(msg) + 1; color = channel->config->colors[chan->color]; WFIFOHEAD(sd->fd,msg_len + 12); WFIFOW(sd->fd,0) = 0x2C1; WFIFOW(sd->fd,2) = msg_len + 12; WFIFOL(sd->fd,4) = 0; WFIFOL(sd->fd,8) = RGB2BGR(color); safestrncpy((char*)WFIFOP(sd->fd,12), msg, msg_len); for (user = dbi_first(iter); dbi_exists(iter); user = dbi_next(iter)) { if( user->fd == sd->fd ) continue; WFIFOHEAD(user->fd,msg_len + 12); memcpy(WFIFOP(user->fd,0), WFIFOP(sd->fd,0), msg_len + 12); WFIFOSET(user->fd, msg_len + 12); } WFIFOSET(sd->fd, msg_len + 12); dbi_destroy(iter); }}this will disallow anyone to use #main in any pvp/gvg/battleground maps
what do you mean like 'automatically disabled' ?

 
Back
Top