Jump to content
  • 0

Map Time Limit (warper)


Question

Posted
hi,

 

Anyone know how to put a time limit in a map? 

like 3 mins and you'll be kick out of the map and Cool down to warp again in that map.. using the Warper .. ?? 

 

thnx..

3 answers to this question

Recommended Posts

Posted (edited)

Well, this is just a basic script to do what you want. You can expand it further by using this template.

prontera,150,180,4	script	TimeWarper	123,{
	if(cooldown){mes "Sorry, your still on CoolDown and cannot enter yet. You will be notified when you can."; close;}
	mes "[TimeWarper]";
	mes "Hi, would you like to be warped?";
	if(select("Yes:No") == 1){warp .loc$[0],atoi(.loc$[1]),atoi(.loc$[2]); end;}
	close;
	OnTimeLimit:
	addtimer((.CD*60000),strnpcinfo(3)+"::OnCoolDown");
	set cooldown,1;
	end;
	OnCoolDown:
	set cooldown,0;
	dispbottom "Your may now be warped again.";
	end;
	OnPCLoadMapEvent:
	if( strcharinfo(3) == .loc$[0] ){addtimer( (.TL*60000),strnpcinfo(3)+"::OnTimeLimit");}
	end;
	OnInit:
	set .TL,3; //TimeLimit in Minutes.
	set .CD,5; //CoolDown in Minutes.
	setarray .loc$[0],"<mapname>","<x>","<y>";
	end;
}
<mapname>    mapflag    loadevent
Edited by GmOcean
Posted

or like that

prontera,150,160,5	script	warp anywhere	78,{
function t;
function s;

	if ( cooldown_warp > gettimetick(2) ) {
		mes "you must wait "+ t( cooldown_warp - gettimetick(2) );
		close;
	}
	warp "geffen", 0,0;
	cooldown_warp = gettimetick(2) + 3600;// 3600 secs = 1h
	addtimer ( 3 *60 *1000 ), strnpcinfo(3) +"::OnEvent";// 3mins
	end;
OnEvent:
	dispbottom "end of timer";
	warp "prontera", 0,0;
	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) ? "" : " " ) ); }
}
}

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