roflmuffin / CounterStrikeSharp

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

Add RunInNTicks or RunOnTick #367

Closed busheezy closed 6 months ago

busheezy commented 6 months ago

It would be great to be able to do things like "run in 3 ticks."

RunInNTicks(3, () => Logger.LogInformation("wooo, 3 ticks!"));

and/or

var futureTick = Server.TickedTime + 3;
RunOnTick(futureTick, () => Logger.LogInformation("wooo, 3 ticks!"));

This has been discussed briefly here: https://github.com/roflmuffin/CounterStrikeSharp/issues/354#issuecomment-1980129038

dran1x commented 6 months ago

Killstreak made something for this a while ago, don't know if it still works or not.

https://discord.com/channels/1160907911501991946/1160925208203493468/1171270690016600114

busheezy commented 6 months ago

Yep, it's mentioned in the comment linked above.

dran1x commented 6 months ago

I was going to bring an issue up sooner or later about integrating it into CS#, it's nice.