Jump to content
  • 0

how to put delay @pvpon @pvpoff commands?


Brynner

Question


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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

12 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

bump for this

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  63
  • Reputation:   3
  • Joined:  07/12/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

ow can i make it i need to do to make 2 @pvpon before the @pvpoff works with delay?

hmm ?????

what mean

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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"

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

edit here ??

clif_displaymessage(fd,"There is a 15 minutes delay in using @off command");

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

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)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  118
  • Topics Per Day:  0.03
  • Content Count:  1942
  • Reputation:   197
  • Joined:  01/08/12
  • Last Seen:  

problem solve. thanks for the reply. i got a alternative solution for this. just like putting a delay on @afk commands.

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