Jump to content

Sky

Members
  • Content Count

    2
  • Joined

  • Last visited

Posts posted by Sky


  1. Hello Hercules !
     
    Is it possible to send a message to a channel with a script command ? I couldn't find anything in the doc. It would be useful to send some information to a group of players.
    There is a source mod on rAthena forums for that but obviously it doesn't work on Hercules and I'm not able to convert it.

     
    http://rathena.org/board/topic/94041-npc-talk-to-a-channel/

     

    /*========================================== * channelmes (sends message to given channel) *------------------------------------------*/BUILDIN_FUNC(channelmes){	const char *channel_name = script_getstr(st,2), *msg = script_getstr(st,3);	struct Channel * channel = channel_name2channel(channel_name,NULL,0);		if( channel ) {		DBIterator *iter;		struct map_session_data *user;		char message[CHAN_MSG_LENGTH];		snprintf(message, CHAN_MSG_LENGTH, "[ #%s ] %s",channel->name, msg);		iter = db_iterator(channel->users);		for( user = (struct map_session_data*)dbi_first(iter); dbi_exists(iter); user = (struct map_session_data*)dbi_next(iter) ) {			//I didn't use clif_channel_msg or channel_send here, because they need a sender sd...			clif_colormes(user,channel->color,message);		}	}	return SCRIPT_CMD_SUCCESS;}BUILDIN_DEF(channelmes,"ss"),//usage:channelmes("#main","Hi, I am "+strcharinfo(0)+".");

     

     

     

    Can someone more experienced with source can take a look ?

×
×
  • Create New...

Important Information

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