Jump to content
  • 0
Sign in to follow this  
Helena

Disable main channel in certain maps

Question

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! :)

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

@@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' ?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.