Closed Gawnz1 closed 3 months ago
The CS2 hl2sdk does not expose any concept of pre/post event hooks, all event hooks are post hooks.
Technically, events are just fired by game code at specific points in time, there's no concept of pre/post here. Round starts in CS actually fire 2 events, one before (round_prestart
) and one after (round_start
) the round restart logic. There's also cs_pre_restart
which is fired 0.3s before the round restarts.
Thanks for the information, really appreciating it as I am a newbie and I did know that in Sourcemod (csgo) https://wiki.alliedmods.net/Events_(SourceMod_Scripting)#Hooking_Events they did exist, but I was not fully sure for here.
@xen-000 Yes, I reviewed everything before opening issue, but there is no pre for the round end, so I decided to ask if it is possible or is there any way? Maybe with signature or?
I'm sure you could find a function signature to pre-hook. But we avoid extra gamedata when possible, since it's susceptible to breaking on game updates. So the timer on round_time_warning
still makes more sense.
Such events/code can be handled at PRE round end I think? https://github.com/Source2ZE/CS2Fixes/blob/main/src/zombiereborn.cpp#L1627-L1636