Jump to content
  • 0

setting time limit per account


Question

Posted (edited)

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

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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