Jump to content
  • 0

@request 3 minutes delay


Get Backers

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.02
  • Content Count:  70
  • Reputation:   0
  • Joined:  11/23/20
  • Last Seen:  

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
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  32
  • Reputation:   29
  • Joined:  09/16/20
  • Last Seen:  

 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 ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.02
  • Content Count:  70
  • Reputation:   0
  • Joined:  11/23/20
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  90
  • Reputation:   34
  • Joined:  10/01/18
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.02
  • Content Count:  70
  • Reputation:   0
  • Joined:  11/23/20
  • Last Seen:  

Wow its working now thanks bro! i have last question how change display the seconds to minutes

Thanks.png

Edited by Get Backers
Link to comment
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.   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...