Jump to content
  • 0
Sign in to follow this  
glemor123

setting time limit per account

Question

how to set the time limit per account not per player? thank you

function t;function s;	if ( cooldown_warp > gettimetick(2) ) {		mes "you must wait "+ t( cooldown_warp - gettimetick(2) );		close;	}	warp .map$,0,0;	cooldown_warp = gettimetick(2) + 3600;// 3600 secs = 1h	addtimer ( 3 *60 *1000 ), strnpcinfo(3) +"::OnEvent";// 3mins	end;OnEvent:	dispbottom "Gold Hunt is Over";	warp "invek",146,173;	end;function t {	if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);	.@week = .@left / ( 86400 * 7 );	.@day = .@left / 86400;	.@hour = .@left % 86400 / 3600;	.@min = .@left % 3600 / 60;	.@sec = .@left % 60;	return ( ( .@week ? .@week +" week"+ s( .@week ) : "" ) + ( .@day ? .@day +" day"+ s( .@day ) : "" ) + ( .@hour ? .@hour +" hour"+ s( .@hour ) : "" ) + ( .@min ? .@min +" min"+ s( .@min ) : "" ) + ( .@sec ? .@sec +" sec"+ s( .@sec,1 ) : "" ) );function s { return ( ( getarg(0) > 1 ? "s" : "" ) + ( getarg(1,0) ? "" : " " ) ); }}
Edited by glemor123

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

I thought I replied to this already lol. I must have erased it oh wellz.

Hours * 3600 * 1000 = Hours in ticks3 * 3600 * 1000 = 10800000 (3 hours in ticks)

As for reading the format:

Seconds * 60 = 60seconds(1min) * 60(min) = 3600seconds(1hour) * 1000(ticks) = 3600000ticksSince we know what 1 hour is, we simplify it by doing this:(Hours we want) * 3600(1hour) * 1000(ticks) = hourswewant_in_ticksTo make it cleaner just do this:(Hours we want)  * ( 3600 * 1000 ) = hourswewant_in_ticks3 * ( 3600 * 1000 ) = 10800000
Edited by GmOcean

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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