roflmuffin / CounterStrikeSharp

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

Problem/BUG -> EventEnterBuyzone & EventExitBuyzone #476

Closed malloc2k closed 4 months ago

malloc2k commented 4 months ago

The Hooks to these events seem to be broken (at least for me)

Heres the code that I currently have:

public HookResult OnEnterBuyZone(EventEnterBuyzone @event, GameEventInfo info, HookMode post)
        {
            var player = @event.Userid;

            if(player == null || player.UserId == null)
                return HookResult.Continue;

            player.PrintToChat("Entered buyzone");

            return HookResult.Continue;
        }

And the same goes for the Exit buyzone.

This previously worked but after an update it doesnt anymore (im not sure which update).

KillStr3aK commented 4 months ago

keep in mind that every game event is triggered by the game itself and its rare that something is wrong on our side in this context. if its not fired then its possible that valve just stopped firing it at all

malloc2k commented 4 months ago

keep in mind that every game event is triggered by the game itself and its rare that something is wrong on our side in this context. if its not fired then its possible that valve just stopped firing it at all

But its kinda weird tho!! Why should it be like that?

malloc2k commented 4 months ago

Seems like the event does fire but it only works if I declare the hook to it on the old method