Jump to content
  • 0
Sign in to follow this  
mrlongshen

Loading on warp

Question

-	script	atcmd_warpdelay	-1,{OnInit:	bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand",0,99;	end;OnAtcommand:	set .@min,2;	//delay in mins	set .@gmlvl,99;	// GM lvl to bypass the delay	set .@delay,.@min * 60;	if (warpdelay > gettimetick(2) && getgmlevel() < .@gmlvl) {		set .@delaytime,warpdelay - gettimetick(2);		message strcharinfo(0),"You must wait "+.@delaytime+" seconds to use this command again.";		end;	}	setarray .@param$,.@atcmd_parameters$[0],.@atcmd_parameters$[1],.@atcmd_parameters$[2];	set .@map$,implode(.@param$," ");	atcommand "@warp "+.@map$+"";	set warpdelay,gettimetick(2) + .@delay;	end;}

as you can see, this is a warp delay. btw. how to make the animation when player type @warp, that will a loading..

1 to 5 second then he will be warp to the location.. ermm.. loading.....

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Loading you mean progressbar?

 

-	script	atcmd_warpdelay	-1,{OnInit:	bindatcmd "warp",strnpcinfo(3)+"::OnAtcommand",0,99;	end;OnAtcommand:	set .@min,2;    //delay in mins	set .@gmlvl,99;    // GM lvl to bypass the delay	set .@delay,.@min * 60;	set .@loading,5;    // Loading in secs	if (warpdelay > gettimetick(2) && getgmlevel() < .@gmlvl) {		set .@delaytime,warpdelay - gettimetick(2);		message strcharinfo(0),"You must wait "+.@delaytime+" seconds to use this command again.";		end;	}	getmapxy(.@lmap$,.@lx,.@ly,0);	setarray .@param$,.@atcmd_parameters$[0],.@atcmd_parameters$[1],.@atcmd_parameters$[2];	set .@map$,implode(.@param$," ");	progressbar "ffff00",.@loading;    	atcommand "@warp "+.@map$+"";	getmapxy(.@nmap$,.@nx,.@ny,0);	if (.@lmap$ == .@nmap$ && .@lx == .@nx && .@ly == .@ny) end;	set warpdelay,gettimetick(2) + .@delay;	end;}

 

 

*progressbar "<color>",<seconds>;
 
This command works almost like sleep2, but displays a progress bar above 
the head of the currently attached character (like cast bar). Once the 
given amount of seconds passes, the script resumes. If the character moves 
while the progress bar progresses, it is aborted and the script ends. The 
color format is in RGB (0xRRGGBB). The color is currently ignored by the 
client and appears always green.

 

@edit, I modified your script, if wrong coordinates the delay will not apply :)

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.