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

Adding the proper way to do resource precache #358

Closed Yarukon closed 6 months ago

Yarukon commented 6 months ago

(edit: tested on linux)

from CS2Fixes

example:

RegisterListener<Listeners.OnServerPrecacheResources>((manifest) =>
{
    manifest.AddResource("path/to/model");
    manifest.AddResource("path/to/material");
    manifest.AddResource("path/to/sound");
});

warning: this will only be called when initial startup / changing map

improvement: maybe find a better way to do the event

KillStr3aK commented 6 months ago

LGTM, and finally!

roflmuffin commented 6 months ago

@KillStr3aK Have you tried this on Linux or would you like me to

KillStr3aK commented 6 months ago

@KillStr3aK Have you tried this on Linux or would you like me to

I would like you to do so

Yarukon commented 6 months ago

@roflmuffin i've tested on linux and it works fine Snipaste_2024-03-02_07-27-00