Jump to content
  • 0
Sign in to follow this  
simplynice

Attach timer to player

Question

I'd like to attach a timer to a player.

 

Example:

 

I will talk to NPC and after talking to NPC . the NPC will block the player to talk into that NPC for  1 week.

 

It's an account based attachment of time.

 

The purpose of the 1 week time is it cannot talk to the NPC even if he goes offline and online again.

 

I just need an idea easy enough to understand.

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Try this : 

 


 

prontera,150,150,0	script	Sample	100,{	.@npc$ = strnpcinfo(1);	.@block_time = 7; // 7 days		if ( gettimetick(2) < #timer ) {		mes .@npc$;		mes "You can only talk to me once a week";		.@time_left = ( ( #timer - gettimetick(2) ) / 60 );		mes "Time left : " +.@time_left+ " minutes";		close;	}	mes .npc$;	mes "Talk to me again after " +.@block_time+ " days.";	#timer = gettimetick(2) + ( .@block_time * 24 * 60 * 60 );	close;}
Edited by Patskie

Share this post


Link to post
Share on other sites
  • 0

if need some idea try this

 

prontera.gat,151,184,5 script Awesome Guy 100,{
if(#ticker<gettimetick(2)) {
mes "I think you're really awesome.";
next;
mes "Now you have to wait a week before you can hear that again.";
set #ticker, gettimetick(2)+60*60*24*7;
} else {
mes "Come back next week for your complement.";
}
close;
}

Share this post


Link to post
Share on other sites
  • 0

 

Try this : 

 


 

prontera,150,150,0	script	Sample	100,{	.@npc$ = strnpcinfo(1);	.@block_time = 7; // 7 days		if ( gettimetick(2) < #timer ) {		mes .@npc$;		mes "You can only talk to me once a week";		.@time_left = ( ( #timer - gettimetick(2) ) / 60 );		mes "Time left : " +.@time_left+ " minutes";		close;	}	mes .npc$;	mes "Talk to me again after " +.@block_time+ " days.";	#timer = gettimetick(2) + ( .@block_time * 24 * 60 * 60 );	close;}

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.