Jump to content
  • 0
Thejuster

Accessing to talking function

Question

Hello, anyone know who are function to send message to game?

i have find this

int channel_send(struct Channel *channel, struct map_session_data *sd, const char *msg) {
    int idx = 0;

    if(!channel || !sd || !msg || (idx = channel_pc_haschan(sd, channel)) < 0)
        return -1;

    if(!pc_has_permission(sd, PC_PERM_CHANNEL_ADMIN) && channel->msg_delay != 0 && DIFF_TICK(sd->channel_tick[idx] + channel->msg_delay, gettick()) > 0) {
        clif_messagecolor(&sd->bl,color_table[COLOR_RED],msg_txt(sd,1455),false,SELF); //You're talking too fast!
        return -2;
    }
    else {
        char output[CHAT_SIZE_MAX];
        unsigned long color = channel->color;
        if((channel->opt&CHAN_OPT_COLOR_OVERRIDE) && sd->fontcolor && sd->fontcolor < channel_config.colors_count && channel_config.colors[sd->fontcolor])
            color = channel_config.colors[sd->fontcolor];
        safesnprintf(output, CHAT_SIZE_MAX, "%s %s : %s", channel->alias, sd->status.name, msg);
        clif_channel_msg(channel,output,color);
        sd->channel_tick[idx] = gettick();
    }
    return 0;
}

 

Componen\map-server\channel.cpp

but im not sure this is a correct function to send message in public chat to field.

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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...

Important Information

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