Jump to content
  • 0

Autojoin main channel silently?


7en

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  60
  • Reputation:   2
  • Joined:  07/24/12
  • Last Seen:  

Hi, I was wondering if theres a way to make players autojoin the main/trade channel silently, I'm currently using a script below to autojoin, but the text 'You are now in the "xxxx" channel takes up the whole chat whenever a player logins. As I have other things to display when players login.

 

-	script	nologin	FAKE_NPC,{

OnPCLoginEvent:
	atcommand "@join #main";
	atcommand "@join #support";
	atcommand "@join #trade";

end;
}
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   38
  • Joined:  04/28/13
  • Last Seen:  

src/map/channel.c

 

Search

int channel_mjoin(struct map_session_data *sd) {
	if(!sd) return -1;

	if( !map[sd->bl.m].channel ) {
		map[sd->bl.m].channel = channel_create(channel_config.map_chname,NULL,channel_config.map_chcolor,CHAN_TYPE_MAP,sd->bl.m);
	}

	if( !( map[sd->bl.m].channel->opt & CHAN_OPT_ANNOUNCE_JOIN ) ) {
		char mout[60];
		sprintf(mout, msg_txt(sd,1435),channel_config.map_chname,map[sd->bl.m].name); // You're now in the '#%s' channel for '%s'.
		clif_disp_onlyself(sd, mout, strlen(mout));
	}

	return channel_join(map[sd->bl.m].channel,sd);
}

And replace with:

int channel_mjoin(struct map_session_data *sd) {
	if(!sd) return -1;

	if( !map[sd->bl.m].channel ) {
		map[sd->bl.m].channel = channel_create(channel_config.map_chname,NULL,channel_config.map_chcolor,CHAN_TYPE_MAP,sd->bl.m);
	}
/*
	if( !( map[sd->bl.m].channel->opt & CHAN_OPT_ANNOUNCE_JOIN ) ) {
		char mout[60];
		sprintf(mout, msg_txt(sd,1435),channel_config.map_chname,map[sd->bl.m].name); // You're now in the '#%s' channel for '%s'.
		clif_disp_onlyself(sd, mout, strlen(mout));
	}
*/
	return channel_join(map[sd->bl.m].channel,sd);
}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...