Limestone Posted March 11, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Share Posted March 11, 2012 hi guys.. please help me on this request.. how can i add cooldown or delay on some GM commands? Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 11, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted March 11, 2012 maybe you can try refer to this and edit your command @go_delay_when_hit Quote Link to comment Share on other sites More sharing options...
Limestone Posted March 11, 2012 Group: Members Topic Count: 155 Topics Per Day: 0.03 Content Count: 647 Reputation: 16 Joined: 11/21/11 Last Seen: December 28, 2022 Author Share Posted March 11, 2012 hmm thats not what i want emistry, hmm example.. delay for @pk command Quote Link to comment Share on other sites More sharing options...
Emistry Posted March 11, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share 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 Link to comment Share on other sites More sharing options...
Legato Posted March 11, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 87 Reputation: 1 Joined: 11/20/11 Last Seen: September 10, 2013 Share 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 Link to comment Share on other sites More sharing options...
Maxlam Posted March 13, 2012 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 78 Reputation: 0 Joined: 02/18/12 Last Seen: December 23, 2013 Share 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 Link to comment Share on other sites More sharing options...
Derceto Posted March 16, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 43 Reputation: 2 Joined: 01/17/12 Last Seen: February 15, 2014 Share 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 Link to comment Share on other sites More sharing options...
Question
Limestone
hi guys.. please help me on this request.. how can i add cooldown or delay on some GM commands?
Link to comment
Share on other sites
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.