File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,4 +13,9 @@ public class RepairAllCommand : BaseCommand
1313public class RepairCommand : BaseCommand
1414{
1515 public string Name { get ; set ; }
16- }
16+ }
17+
18+ [ Command ( "autorepair|autoheal" , Auth . Admin ) ]
19+ public class AutoRepairCommand : BaseCommand
20+ {
21+ }
Original file line number Diff line number Diff line change @@ -409,6 +409,24 @@ public static class RconScript
409409 "ObjectTemplate.armor.hpLostWhileCriticalDamage 18"
410410 } ;
411411
412+ public static readonly string [ ] AutoRepairOn = {
413+ "ObjectTemplate.activeSafe SupplyObject concreteblock_helipad_SupplyObject_helipad" ,
414+ "ObjectTemplate.radius 1000" ,
415+ // "ObjectTemplate.workOnSoldiers 1",
416+ // "ObjectTemplate.workOnVehicles 1",
417+ // "ObjectTemplate.healSpeed 3000",
418+ // "ObjectTemplate.refillAmmoSpeed 3000"
419+ } ;
420+
421+ public static readonly string [ ] AutoRepairOff = {
422+ "ObjectTemplate.activeSafe SupplyObject concreteblock_helipad_SupplyObject_helipad" ,
423+ "ObjectTemplate.radius 10" ,
424+ // "ObjectTemplate.workOnSoldiers 1",
425+ // "ObjectTemplate.workOnVehicles 1",
426+ // "ObjectTemplate.healSpeed 3000",
427+ // "ObjectTemplate.refillAmmoSpeed 3000"
428+ } ;
429+
412430 //def setFirearmProjectile(firearmTemp, projTemp):
413431 //host.rcon_invoke("ObjectTemplate.active " + firearmTemp)
414432 //host.rcon_invoke("ObjectTemplate.projectileTemplate " + projTemp)
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public class BF2Module : BaseModule,
2323 IHandleCommand < FlipCommand > ,
2424 IHandleCommand < StopCommand > ,
2525 IHandleCommand < RepairCommand > ,
26+ IHandleCommand < AutoRepairCommand > ,
2627 IHandleCommand < KillCommand > ,
2728 IHandleCommand < KillIdCommand > ,
2829 IHandleCommand < ScoreCommand > ,
@@ -305,6 +306,10 @@ public void Handle(ScriptModCommand command)
305306 commands = activate ? RconScript . HeliSupplyFlaresOn : RconScript . HeliFlareDefault ;
306307 break ;
307308
309+ case "auto-repair" :
310+ commands = activate ? RconScript . AutoRepairOn : RconScript . AutoRepairOff ;
311+ break ;
312+
308313 default :
309314 _gameServer . GameWriter . SendText ( $ "Unknown command: { command . Name } ") ;
310315 return ;
@@ -612,7 +617,15 @@ public void Handle(SwitchAllCommand command)
612617 SwitchAll ( ) ;
613618 }
614619
620+ private bool _autoRepairOn = false ;
621+
622+ public void Handle ( AutoRepairCommand command )
623+ {
624+ _autoRepairOn = ! _autoRepairOn ;
615625
626+ _gameServer . GameWriter . SendRcon ( _autoRepairOn ? RconScript . AutoRepairOn : RconScript . AutoRepairOff ) ;
627+ _gameServer . GameWriter . SendText ( _autoRepairOn ? "Auto repair on" : "Auto repair off" ) ;
628+ }
616629}
617630
618631public class PlayerSnapshot
You can’t perform that action at this time.
0 commit comments