Jump to content
  • 0

Autojoin main channel silently?


Question

Posted

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;
}

1 answer to this question

Recommended Posts

  • 0
Posted

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);
}

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...