Limestone Posted March 11, 2012 Posted March 11, 2012 hi guys.. please help me on this request.. how can i add cooldown or delay on some GM commands? Quote
Emistry Posted March 11, 2012 Posted March 11, 2012 maybe you can try refer to this and edit your command @go_delay_when_hit Quote
Limestone Posted March 11, 2012 Author Posted March 11, 2012 hmm thats not what i want emistry, hmm example.. delay for @pk command Quote
Emistry Posted March 11, 2012 Posted March 11, 2012 please read the article 1st... follow the way how they implant the @go delay... the way is the same..just different commands... Quote
Legato Posted March 11, 2012 Posted March 11, 2012 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. Quote
Maxlam Posted March 13, 2012 Posted March 13, 2012 (edited) 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 March 14, 2012 by Maxlam Quote
Derceto Posted March 16, 2012 Posted March 16, 2012 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.) Quote
Question
Limestone
hi guys.. please help me on this request.. how can i add cooldown or delay on some GM commands?
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.