Jump to content
  • 0

@request 3 minutes delay


Question

Posted (edited)

Good evening! anyone how to put a delay in 3 minutes before use request commands! 

 

 

ACMD_FUNC(request)
{
    if (!message || !*message) {
        clif_displaymessage(sd->fd,msg_txt(sd,277));    // Usage: @request <petition/message to online GMs>.
        return -1;
    }

    sprintf(atcmd_output, msg_txt(sd,278), message);    // (@request): %s
    intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
    clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], atcmd_output, false, SELF);
    clif_displaymessage(sd->fd,msg_txt(sd,279));    // @request sent.
    return 0;
}

Edited by Get Backers

4 answers to this question

Recommended Posts

  • 0
Posted
 ACMD_FUNC(request)
{
    if (!message || !*message) {
        clif_displaymessage(sd->fd,msg_txt(sd,277));    // Usage: @request <petition/message to online GMs>.
        return -1;
    }
   
   	if (DIFF_TICK(sd->refreshdelay_tick, gettick()) > 0)
		return 0;
	

    sprintf(atcmd_output, msg_txt(sd,278), message);    // (@request): %s
    intif_wis_message_to_gm(sd->status.name, PC_PERM_RECEIVE_REQUESTS, atcmd_output);
    clif_messagecolor(&sd->bl, color_table[COLOR_LIGHT_GREEN], atcmd_output, false, SELF);
    clif_displaymessage(sd->fd,msg_txt(sd,279));    // @request sent.
   	sd->refreshdelay_tick= gettick() + n; // <-- n = time in miliseconds
    return 0;
} 

Try this ?

  • 0
Posted

Hi sir got error 1>

atcommand.cpp(8809,9): error C2039: 'refreshdelay_tick': is not a member of 'map_session_data'
src\map\trade.hpp(7): message : see declaration of 'map_session_data'
rc\map\atcommand.cpp(8816,9): error C2039: 'refreshdelay_tick': is not a member of

  • 0
Posted
4 hours ago, Get Backers said:

Hi sir got error 1>

atcommand.cpp(8809,9): error C2039: 'refreshdelay_tick': is not a member of 'map_session_data'
src\map\trade.hpp(7): message : see declaration of 'map_session_data'
rc\map\atcommand.cpp(8816,9): error C2039: 'refreshdelay_tick': is not a member of

Which means you must define the missing part of refreshdelay_tick.

Anyways try this one: usedelay_tick.diff


Note: If you know how to use this you can use this in any commands to give them delay of using.

  • Love 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...