Jump to content
  • 0

how to put delay @pvpon @pvpoff commands?


Question

Posted (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 by Brynner

12 answers to this question

Recommended Posts

Posted

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.

Posted

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

Posted (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 by Brynner
Posted
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"

Posted

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.

Posted

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

Posted

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)

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...