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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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