Brynner Posted July 15, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Share Posted July 15, 2012 (edited) how to put a delay on using @pvpon and @pvpoff. ex. the gm @pvpon and he use again the @pvpoff and he use again @pvpon. the next time he use the @pvpoff it will appear a message. "You cannot use @pvpoff twice within just 15mins." thanks in advance. Edited July 17, 2012 by Brynner Quote Link to comment Share on other sites More sharing options...
Brynner Posted July 17, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Author Share Posted July 17, 2012 bump for this Quote Link to comment Share on other sites More sharing options...
PokemonRO Posted July 17, 2012 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 63 Reputation: 3 Joined: 07/12/12 Last Seen: December 30, 2013 Share Posted July 17, 2012 An easy way is to make the commands turned on and off using an npc with a delay on the npc or else someone will need to give you source code for it Quote Link to comment Share on other sites More sharing options...
Brynner Posted July 17, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Author Share Posted July 17, 2012 An easy way is to make the commands turned on and off using an npc with a delay on the npc or else someone will need to give you source code for it i requesting for source code modification. if im looking for npc script why i putted it here?please don't spam on the threads if you can't answer what i exactly looking for. Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 17, 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 July 17, 2012 by refer this http://rathena.org/w..._delay_when_hit maybe you can try it like this.. doesnt sure this will work or not..... open src/map/pc.h find: unsigned int canuseitem_tick; // [skotlex] then add below: unsigned int pvpdelay_tick; open src/map/pc.c find: sd->canuseitem_tick = tick; then add below: sd->pvpdelay_tick = tick; open src/map/atcommand.c find: ACMD_FUNC(pvpon) then add this inside the function: unsigned int tick = gettick(); int delaytick = ( 15 * 60000 ); //This is the delay in milliseconds you can set what ever delay you want sd->pvpdelay_tick = tick+delaytick; //This is the timer find: ACMD_FUNC(pvpoff) then add this inside the function: unsigned int tick = gettick(); We are still in the @pvpoff function scroll down until you find this inside the function: nullpo_retr(-1, sd); then add below: if(DIFF_TICK(sd->pvpdelay_tick,tick)>0) { //This is for computing the delay if the cooldown or delay is not yet finish restrict using @pvpoff clif_displaymessage(fd,"There is a 15 minutes delay in using @off command"); return 0; } Quote Link to comment Share on other sites More sharing options...
Brynner Posted July 17, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Author Share Posted July 17, 2012 (edited) by refer this http://rathena.org/w..._delay_when_hit maybe you can try it like this.. doesnt sure this will work or not..... open src/map/pc.h find: unsigned int canuseitem_tick; // [skotlex] then add below: unsigned int pvpdelay_tick; open src/map/pc.c find: sd->canuseitem_tick = tick; then add below: sd->pvpdelay_tick = tick; open src/map/atcommand.c find: ACMD_FUNC(pvpon) then add this inside the function: unsigned int tick = gettick(); int delaytick = ( 15 * 60000 ); //This is the delay in milliseconds you can set what ever delay you want sd->pvpdelay_tick = tick+delaytick; //This is the timer find: ACMD_FUNC(pvpoff) then add this inside the function: unsigned int tick = gettick(); We are still in the @pvpoff function scroll down until you find this inside the function: nullpo_retr(-1, sd); then add below: if(DIFF_TICK(sd->pvpdelay_tick,tick)>0) { //This is for computing the delay if the cooldown or delay is not yet finish restrict using @pvpoff clif_displaymessage(fd,"There is a 15 minutes delay in using @off command"); return 0; } nice thanks it works. but if you use @pvpon it works the you need to wait for 15mins to use the @pvpoff. how can i make it i need to do to make 2 @pvpon before the @pvpoff works with delay? just like this? "You cannot use @pvpoff twice within just 15 minutes" Edited July 17, 2012 by Brynner Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 17, 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 July 17, 2012 ow can i make it i need to do to make 2 @pvpon before the @pvpoff works with delay? hmm ????? what mean Quote Link to comment Share on other sites More sharing options...
Brynner Posted July 17, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Author Share Posted July 17, 2012 ow can i make it i need to do to make 2 @pvpon before the @pvpoff works with delay? hmm ????? what mean just like this sir. "You cannot use @pvpoff twice within just 15 minutes" Quote Link to comment Share on other sites More sharing options...
Emistry Posted July 17, 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 July 17, 2012 edit here ?? clif_displaymessage(fd,"There is a 15 minutes delay in using @off command"); Quote Link to comment Share on other sites More sharing options...
Brynner Posted July 17, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Author Share Posted July 17, 2012 edit here ?? clif_displaymessage(fd,"There is a 15 minutes delay in using @off command"); nope sir. if i use @pvpon the script will works. then i will turn it off the @pvpoff will works. then i try to make it on again. but i want to turn it off now. then the display message will now appear. there is a 15mins delay is using @pvpoff commands. just like this sir. the current source is you can't use @pvpoff after you use @pvpon. you need to character select to bypass that delay. Quote Link to comment Share on other sites More sharing options...
Mystery Posted July 18, 2012 Group: Members Topic Count: 94 Topics Per Day: 0.02 Content Count: 2192 Reputation: 253 Joined: 11/11/11 Last Seen: June 24, 2020 Share Posted July 18, 2012 IN other words.. he wants to use @pvpon ONCE then use @pvpoff ONCE. After being used, he wants the second @pvpon to have a Delay for 15 minutes. Though I think this would be hard to do.. I'm not exactly sure how you could do this in the source.. =/ Quote Link to comment Share on other sites More sharing options...
Euphy Posted July 18, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted July 18, 2012 Agreed with Mysterious, it's way too much work for something you can do via script. I'd take PokemonRO's suggestion unless you can figure it out yourself, because I doubt anyone will write this for you... (I may be wrong) Quote Link to comment Share on other sites More sharing options...
Brynner Posted July 18, 2012 Group: Members Topic Count: 120 Topics Per Day: 0.02 Content Count: 1962 Reputation: 202 Joined: 01/08/12 Last Seen: 58 minutes ago Author Share Posted July 18, 2012 problem solve. thanks for the reply. i got a alternative solution for this. just like putting a delay on @afk commands. Quote Link to comment Share on other sites More sharing options...
Question
Brynner
how to put a delay on using @pvpon and @pvpoff.
ex. the gm @pvpon and he use again the @pvpoff and he use again @pvpon. the next time he use the @pvpoff it will appear a message.
"You cannot use @pvpoff twice within just 15mins."
thanks in advance.
Edited by BrynnerLink to comment
Share on other sites
12 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.