Hi ! Im trying to make a bindatcmd script for @refresh but has a 5minutes cooldown ... I just wondering why is it always @refresh failed ???? here is my script
//===================================
//
// @refresh (Remove Stuck Players)
//
//===================================
- script refresh -1,{
OnInit:
set .Minutes,5;
bindatcmd "refresh",strnpcinfo(0)+"::OnAtcommand";
end;
OnAtcommand:
if( .DelayTime <= gettimetick(2)) {
mes "[@refresh]";
mes "Stuck on NPC or unable to move?";
mes "This command has 5 minute cooldown";
next;
mes "[@refresh]";
mes "Use @refresh?";
switch(select("No.:Yes.")) {
case 1:
close;
case 2:
atcommand "@refresh";
set .DelayTime,gettimetick(2) + ( .Minutes * 60 );
close;
}
} else if( .DelayTime > gettimetick(2) ){
set .last,.DelayTime - gettimetick(2);
set .@min, .last % (24*60*60) % (60*60) / (60);
set .@sec, .last % (24*60*60) % (60*60) % (60);
message strcharinfo(0), "Wait for "+.@min+" minutes "+.@sec+" seconds before you can use @refresh again.";
end;
}
}
Hi ! Im trying to make a bindatcmd script for @refresh but has a 5minutes cooldown ... I just wondering why is it always @refresh failed ???? here is my script
//=================================== // // @refresh (Remove Stuck Players) // //=================================== - script refresh -1,{ OnInit: set .Minutes,5; bindatcmd "refresh",strnpcinfo(0)+"::OnAtcommand"; end; OnAtcommand: if( .DelayTime <= gettimetick(2)) { mes "[@refresh]"; mes "Stuck on NPC or unable to move?"; mes "This command has 5 minute cooldown"; next; mes "[@refresh]"; mes "Use @refresh?"; switch(select("No.:Yes.")) { case 1: close; case 2: atcommand "@refresh"; set .DelayTime,gettimetick(2) + ( .Minutes * 60 ); close; } } else if( .DelayTime > gettimetick(2) ){ set .last,.DelayTime - gettimetick(2); set .@min, .last % (24*60*60) % (60*60) / (60); set .@sec, .last % (24*60*60) % (60*60) % (60); message strcharinfo(0), "Wait for "+.@min+" minutes "+.@sec+" seconds before you can use @refresh again."; end; } }
Share this post
Link to post
Share on other sites