Once apon a time I found a code example for checking what game a plugin is being loaded into. Today I looked for it via searches and couldn't find it.
Thought it was something like "#if Oxide.Rust:" but that's not working.
Trying to get a universal plugin out with OnNewSave specific functionality for Rust and Hurtworld.
Could I please get a link or new example?
Checking what game the plugin is being used for...Solved
To check the game name: covalence.Game
For game-specific code, use preprocessors:
#if RUST
#if HURTWORLD
etc.
Thank you, Wulf.
In case anyone also needs this example:
#if RUST || HURTWORLD
void OnNewSave()
{
//Do epic things here.
}
#endifThis #if statement prevents compilation when condition not met.
Updated.
Correct. You can see examples in many of mine that support multiple games, such as Portgun.
Thank you again. Updated last comment.
Locked automatically