@@ -349,6 +349,9 @@ public void OnUpdate(EventArgs args)
349
349
else if ( ePly . SavedBackAction && ! ePly . TSPlayer . Dead )
350
350
ePly . SavedBackAction = false ;
351
351
352
+ if ( ePly . BackCooldown > 0 )
353
+ ePly . BackCooldown -- ;
354
+
352
355
if ( ePly . ptTime > - 1.0 )
353
356
{
354
357
ePly . ptTime += 60.0 ;
@@ -608,18 +611,36 @@ private void CMDmoon(CommandArgs args)
608
611
private void CMDback ( CommandArgs args )
609
612
{
610
613
var ePly = esPlayers [ args . Player . Index ] ;
614
+ if ( ePly . TSPlayer . Dead )
615
+ {
616
+ Send . Error ( args . Player , "Please wait till you respawn." ) ;
617
+ return ;
618
+ }
619
+ if ( ePly . BackCooldown > 0 )
620
+ {
621
+ Send . Error ( args . Player , "You must wait another {0} seconds before you can use /b again." , ePly . BackCooldown ) ;
622
+ return ;
623
+ }
611
624
612
625
if ( ePly . LastBackAction == BackAction . None )
613
626
Send . Error ( args . Player , "You do not have a /b position stored." ) ;
614
627
else if ( ePly . LastBackAction == BackAction . TP )
615
628
{
629
+ if ( Config . BackCooldown > 0 && ! args . Player . Group . HasPermission ( "essentials.back.nocooldown" ) )
630
+ {
631
+ ePly . BackCooldown = Config . BackCooldown ;
632
+ }
616
633
args . Player . Teleport ( ePly . LastBackX * 16F , ePly . LastBackY * 16F ) ;
617
- Send . Success ( args . Player , "Moved you to your position before your last teleport ." ) ;
634
+ Send . Success ( args . Player , "Moved you to your position before you last teleported ." ) ;
618
635
}
619
636
else if ( ePly . LastBackAction == BackAction . Death && args . Player . Group . HasPermission ( "essentials.back.death" ) )
620
637
{
638
+ if ( Config . BackCooldown > 0 && ! args . Player . Group . HasPermission ( "essentials.back.nocooldown" ) )
639
+ {
640
+ ePly . BackCooldown = Config . BackCooldown ;
641
+ }
621
642
args . Player . Teleport ( ePly . LastBackX * 16F , ePly . LastBackY * 16F ) ;
622
- Send . Success ( args . Player , "Moved you to your position before your last death ." ) ;
643
+ Send . Success ( args . Player , "Moved you to your position before you last died ." ) ;
623
644
}
624
645
else
625
646
Send . Error ( args . Player , "You do not have permission to /b after death." ) ;
0 commit comments