Jump to content
  • 0
Sign in to follow this  
bWolfie

Display channel MessageDelay

Question

In the following code in channel.c, when your tick is not at 0 it will direct you to message 1455, "You're talking too fast!"

 

    if (sd && chan->msg_delay != 0
     && DIFF_TICK(sd->hchsysch_tick + chan->msg_delay*1000, timer->gettick()) > 0
     && !pc_has_permission(sd, PC_PERM_HCHSYS_ADMIN)) {
        clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1455));
        return;
    }

 

I wish to display the remaining ticks (seconds) instead of a static message. E.g. message 1455, "You cannot send a message to this channel for another %d seconds."

 

Thanks.

Edited by True Zeal

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Bumping this to say I found the solution and wanted to post it for future users.

In channel.c, find:

clif->messagecolor_self(sd->fd, COLOR_RED, msg_sd(sd,1455));

Replace with:

char output[150];
sprintf(output, msg_txt(1550), DIFF_TICK(sd->hchsysch_tick + chan->msg_delay*1000, timer->gettick()) / 1000); // "You cannot send a message to this channel for another %d seconds."
clif->messagecolor_self(sd->fd, COLOR_RED, output);

In messages.conf, create a new custom message. In the example above, 1550 was used. You should use whatever the next available one is.

1550: You cannot send a message to this channel for another %d seconds.

Share this post


Link to post
Share on other sites
  • 0

Let me rephrase my question...

 

How do I send clifmessage->so it can send a number to %d in messages.conf?

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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