-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
57 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using CounterStrikeSharp.API.Core; | ||
using CounterStrikeSharp.API.Core.Attributes.Registration; | ||
using CounterStrikeSharp.API.Modules.Commands; | ||
using CounterStrikeSharp.API.Modules.Utils; | ||
using Jailbreak.Public.Behaviors; | ||
using Jailbreak.Public.Mod.Draw; | ||
using Jailbreak.Public.Mod.Warden; | ||
|
||
namespace Jailbreak.Warden.Markers; | ||
|
||
public class WardenMarkerBehavior : IPluginBehavior | ||
{ | ||
private readonly IWardenService _warden; | ||
private IDrawService _drawer; | ||
|
||
private DrawableShape? _marker; | ||
|
||
public WardenMarkerBehavior(IWardenService warden, IDrawService drawer) | ||
{ | ||
_warden = warden; | ||
_drawer = drawer; | ||
} | ||
|
||
public void Start(BasePlugin plugin) | ||
{ | ||
_marker = new BeamCircle(plugin, new Vector(), 40f, (int)Math.PI * 10); | ||
plugin.AddCommandListener("player_ping", CommandListener_PlayerPing); | ||
} | ||
|
||
[GameEventHandler] | ||
public HookResult OnPing(EventPlayerPing @event, GameEventInfo info) | ||
{ | ||
var player = @event.Userid; | ||
|
||
if (!_warden.IsWarden(player)) | ||
return HookResult.Handled; | ||
|
||
Vector vec = new Vector(@event.X, @event.Y, @event.Z); | ||
_marker?.Move(vec); | ||
_marker?.Update(); | ||
return HookResult.Handled; | ||
} | ||
|
||
HookResult CommandListener_PlayerPing(CCSPlayerController? player, CommandInfo info) | ||
{ | ||
return HookResult.Handled; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters