Loading on warp

mrlongshen

Noobies
Messages
1,126
Points
0
Age
36
Location
localhost 127.0.0.1
Emulator
- 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.....

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


 
Last edited by a moderator:
Back
Top