Jump to content
  • 0
Limestone

@commands delay

Question

6 answers to this question

Recommended Posts

Emistry is right. You should read the guide from the link he provided. You may learn how to add a delay for other commands. Anyway, here's my reply to your question.

Add this piece of code under nullpo_retr(-1, sd); on every command you want to have a delay.

  	 if( DIFF_TICK(gettick(),sd->pkmode_cd) < 60000 ) {
			char timeleft[100];
			sprintf(timeleft,"@pkmode is cooling down, you may use it again after %d seconds",60-(DIFF_TICK(gettick(),sd->pkmode_cd)/1000));
			clif_displaymessage(fd,timeleft);
			return -0;
	}
	sd->pkmode_cd = gettick();

And on pc.h

  unsigned short mapindex;
  unsigned char head_dir; //0: Look forward. 1: Look right, 2: Look left.
  unsigned int client_tick;
+  unsigned int pkmode_cd;

You just have to change every pkmode_cd for other commands.

Link to comment
Share on other sites

Well, it is "nullpo_h" or "nullpo_c" and where did you add the text ? At the end of all ?

And on "pc.h" do you enter litteraly "client_tick" or the number ?

[because seriously, with the link, it is not so easy to understand...]

Edited by Maxlam
Link to comment
Share on other sites

Well, it is "nullpo_h" or "nullpo_c" and where did you add the text ? At the end of all ?

atcommand.c, in functions ATCMD_FUNC("something"), below "nullpo_retr()" line.

And on "pc.h" do you enter litteraly "client_tick" or the number ?

[because seriously, with the link, it is not so easy to understand...]

"client_tick" should already be there (literally. it's a variable declaration).

The only line you have to add is the line with "+" before it (others should already be there; find them, then add the one line.)

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

Important Information

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