Jump to content
  • 0

npc warp every 24h


Question

Posted

hi, I would like a npc give you the possibility to enter a map every 24 hours, like:

----------------------------------------------------------------------------------------------

mes: do you want to enter?
choice: yes, quit


yes:
(if you have already entered and 24 hours have not passed)
mes: you can't, 24 hours must pass!
(if 24 hours have passed)
mes: ok! (warp to xxx)


quit:
mes: bye!

----------------------------------------------------------------------------------------------

thanks!

2 answers to this question

Recommended Posts

  • 0
Posted

try this

prontera,0,0,0	script daily_warper	444,{
	if(LASTENTERTIME > gettimetick(2)){
		mes "you can enter once every 24hr";
		mes "come back after " + gettimestr("%Y-%m/%d %H:%M:%S",21,LASTENTERTIME);
		end;
	}
	LASTENTERTIME = gettimetick(2) + (60*60*24);
	warp "payon",0,0;
end;
}

 

  • 0
Posted
9 hours ago, sader1992 said:

try this


prontera,0,0,0	script daily_warper	444,{
	if(LASTENTERTIME > gettimetick(2)){
		mes "you can enter once every 24hr";
		mes "come back after " + gettimestr("%Y-%m/%d %H:%M:%S",21,LASTENTERTIME);
		end;
	}
	LASTENTERTIME = gettimetick(2) + (60*60*24);
	warp "payon",0,0;
end;
}

 

perfect, work! tnx!!! just explain to me what is the value 21?
in: ("% Y-% m /% d% H:% M:% S", 21, LASTENTERTIME)

tnx!

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