Skip to content

Commit

Permalink
Added fastplant
Browse files Browse the repository at this point in the history
  • Loading branch information
B3none committed Dec 26, 2023
1 parent ad006fc commit 882c1a0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
19 changes: 19 additions & 0 deletions Modules/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,23 @@ public static void GiveAndSwitchToBomb(CCSPlayerController player)
player.GiveNamedItem(CsItem.Bomb);
NativeAPI.IssueClientCommand((int)player.UserId!, "slot5");
}

public static void FastPlantBomb()
{
var bombEntities = Utilities.FindAllEntitiesByDesignerName<CC4>("weapon_c4").ToList();

if (!bombEntities.Any())
{
return;
}

var bomb = bombEntities.FirstOrDefault();
if (bomb == null)
{
return;
}

bomb.BombPlacedAnimation = false;
bomb.ArmedTime = 0.0f;
}
}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Retakes plugin written in C# for CounterStrikeSharp
- [x] Equipment allocation
- [x] Queue manager (Queue system)
- [x] Team manager (with team switch calculations)
- [ ] Better weapon allocation
- [ ] Better grenade allocation
- [ ] Add autoplant
- [ ] Add fastplant
- [ ] Implement config files
- [ ] Implement better spawn management system

## Installation
Expand Down
8 changes: 8 additions & 0 deletions RetakesPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,14 @@ public HookResult OnPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
return HookResult.Continue;
}

[GameEventHandler]
public HookResult OnBombBeginPlant(EventBombBeginplant @event, GameEventInfo info)
{
Helpers.FastPlantBomb();

return HookResult.Continue;
}

[GameEventHandler]
public HookResult OnWeaponFire(EventWeaponFire @event, GameEventInfo info)
{
Expand Down

0 comments on commit 882c1a0

Please sign in to comment.