sourcemod
sourcemod copied to clipboard
Add mark/info about all optional parameters
Help us help you
- [x] I have checked that my issue doesn't exist yet.
- [x] I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
- [x] I can always reproduce the issue with the provided description below.
Environment
(This is about the online docs, local env not relevant)
Description
It would be helpful for SourceMod scripters like myself, if the API (docs) were more explicit about which properties are optional or not.
For instance, the StringMap.SetValue Method makes no mention that the replace parameter is actually optional (as far as I can tell).
In my personal opinion, every optional parameter of every function in the entire SourceMod API (or any API for that matter) should be explicitly marked as "optional" in the API docs.

StringMap sm = new StringMap();
// bool SetValue(const char[] key, any value, bool replace)
sm.SetValue("x", 123); // <--- this compiles and runs just fine, even though the "replace" parameter is not set
I'd suggest using sourcemod.dev instead.