Jump to content
  • 0

Map Time Limit (warper)


rans

Question


  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.02
  • Content Count:  429
  • Reputation:   60
  • Joined:  08/19/12
  • Last Seen:  

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

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  666
  • Reputation:   93
  • Joined:  04/27/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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) ? "" : " " ) ); }
}
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.02
  • Content Count:  429
  • Reputation:   60
  • Joined:  08/19/12
  • Last Seen:  

thank you very much guys =)

Link to comment
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.   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.

×
×
  • Create New...