Sky
-
Content Count
2 -
Joined
-
Last visited
Posts posted by Sky
-
-
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 ?
Script command send message to channel
in Source Requests
Posted
Ah that's too bad. Thanks for your reply.
Can I do a suggestion to the developpers about that ?