roflmuffin / CounterStrikeSharp

CounterStrikeSharp allows you to write server plugins in C# for Counter-Strike 2/Source2/CS2
https://docs.cssharp.dev
Other
709 stars 110 forks source link

[BUG] EventBotTakeover not fired #474

Open bet0v opened 1 month ago

bet0v commented 1 month ago

Hi, when writing this in the Load method of my plugin, I never see the corresponding log RegisterEventHandler<EventBotTakeover>((@event, info) => { Console.WriteLine($"EventBotTakeover"); return HookResult.Continue; }); Wether in Post or Pre HookMode. I'm correctly registering to many other events without issues. Please note that I do see a message in the logs when taking control of a bot (that is weirdly ordered if I'm honest) : Player [BotName] took control bot [PlayerName] ([PlayerIndex])

My goal is to set the bot pawn's health when a player takes control of it (so the new player's pawn). Please tell me if I am trying to use the wrong event to achieve this goal.

Thanks in advance and keep up the good work!